Scripting


bacteria

Modder & Portablizer
Joined
Jan 12, 2006
Messages
1,119
Location
Hampshire, UK.
Website
moddedbybacteria.wordpress.com
There are a number of posts which show scripts, it would be very useful if those "in the know" could post here with what all the script commands are, what they do, and their syntax.

Perhaps people could post their successful scripts here (with a note of which firmware/s the script is useful for), with a brief line-by-line description of how each line works?

This could enable people to learn how to do it and make their own contributions to the Scene.

Perhaps, if people respond to this post, it could be a "sticky"?
 
bacteria posted on Feb 13 2006 at 09:41 AM said:
There are a number of posts which show scripts, it would be very useful if those "in the know" could post here with what all the script commands are, what they do, and their syntax.

I assume you mean bash scripts. It's really helpful to know a bit about *nix and the commands available, but this should help with the actual bash.
 
Last edited by a moderator:
i don't know bash that well, but there's not much to it...just open up a couple of the many scripts you should already have on your sd card and then you'll see what stuff does. basically all you'll usually be doing is navigating to a directory and launching an app. then you put some lines in after to make sure the gp2x menu comes up again.

here's the chopper one that was posted:

Code:
#!/bin/sh
cd runtime
./fxi ../chopper/chopper.dcb
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu

there is a binary called fxi in a folder called runtime. fxi is having an argument passed to it -- the name of a data file which is in the directory above it (called chopper). the last two lines get you back to the menu once the program ends.
 
actually, whoops...that chopper one's wrong. i didn't write it, but it shouldn't be ../chopper/chopper.dcb, it should be ../chopper.dcb
 
Back
Top