Scripting: GM9VER environment variable

This commit is contained in:
d0k3 2018-01-18 15:13:24 +01:00
parent 5034e99832
commit 838a08df2a
2 changed files with 4 additions and 1 deletions

View File

@ -442,6 +442,8 @@ bool init_vars(const char* path_script) {
set_var("HAX", IS_SIGHAX ? (isntrboot() ? "ntrboot" : "sighax") : IS_A9LH ? "a9lh" : ""); // type of hax running from set_var("HAX", IS_SIGHAX ? (isntrboot() ? "ntrboot" : "sighax") : IS_A9LH ? "a9lh" : ""); // type of hax running from
set_var("ONTYPE", IS_O3DS ? "O3DS" : "N3DS"); // type of the console set_var("ONTYPE", IS_O3DS ? "O3DS" : "N3DS"); // type of the console
set_var("RDTYPE", IS_DEVKIT ? "devkit" : "retail"); // devkit / retail set_var("RDTYPE", IS_DEVKIT ? "devkit" : "retail"); // devkit / retail
char* ptr = set_var("GM9VER", GM9VER); // GodMode9 version, truncated below
while (*(ptr++) != '\0') if (*ptr == '-') *ptr = '\0';
upd_var(NULL); // set all dynamic environment vars upd_var(NULL); // set all dynamic environment vars
return true; return true;

View File

@ -29,6 +29,7 @@ ask "Continue running this script?"
ask -o -s "Really continue running this script?\n(I will completely ignore your answer)" ask -o -s "Really continue running this script?\n(I will completely ignore your answer)"
# ENVIRONMENTAL VARS # ENVIRONMENTAL VARS
# GM9VER is the GodMode9 version number
# REGION is the region of your device's SysNAND (USA, EUR, JPN, KOR, CHN, TWN or UNK for unknown) # REGION is the region of your device's SysNAND (USA, EUR, JPN, KOR, CHN, TWN or UNK for unknown)
# SERIAL is the serial number of your device # SERIAL is the serial number of your device
# GM9OUT is the standard output path # GM9OUT is the standard output path
@ -41,7 +42,7 @@ ask -o -s "Really continue running this script?\n(I will completely ignore your
# TIMESTAMP is the current time in hhmmss format # TIMESTAMP is the current time in hhmmss format
# DATESTAMP is the current date in YYMMDD format # DATESTAMP is the current date in YYMMDD format
# Use $[VAR] to get the *content* of a variable VAR # Use $[VAR] to get the *content* of a variable VAR
echo "Your region is $[REGION]\nYour serial number is $[SERIAL]\nYour std output path is $[GM9OUT]\nCurrent dir is $[CURRDIR]\nCurrent hax is $[HAX]\nYour system is a $[RDTYPE] $[ONTYPE]\nCurrent datestamp is: $[DATESTAMP]\nCurrent timestamp is: $[TIMESTAMP]\n \nYour sys / emu ID0 is:\n$[SYSID0]\n$[EMUID0]" echo "Your GodMode9 version is $[GM9VER]\nYour region is $[REGION]\nYour serial number is $[SERIAL]\nYour std output path is $[GM9OUT]\nCurrent dir is $[CURRDIR]\nCurrent hax is $[HAX]\nYour system is a $[RDTYPE] $[ONTYPE]\nCurrent datestamp is: $[DATESTAMP]\nCurrent timestamp is: $[TIMESTAMP]\n \nYour sys / emu ID0 is:\n$[SYSID0]\n$[EMUID0]"
qr "You can also have this as a QR code :)" "Your region is $[REGION]\nYour serial number is $[SERIAL]\nYour std output path is $[GM9OUT]\nCurrent dir is $[CURRDIR]\nCurrent hax is $[HAX]\nYour system is a $[RDTYPE] $[ONTYPE]\nCurrent datestamp is: $[DATESTAMP]\nCurrent timestamp is: $[TIMESTAMP]\n \nYour sys / emu ID0 is:\n$[SYSID0]\n$[EMUID0]" qr "You can also have this as a QR code :)" "Your region is $[REGION]\nYour serial number is $[SERIAL]\nYour std output path is $[GM9OUT]\nCurrent dir is $[CURRDIR]\nCurrent hax is $[HAX]\nYour system is a $[RDTYPE] $[ONTYPE]\nCurrent datestamp is: $[DATESTAMP]\nCurrent timestamp is: $[TIMESTAMP]\n \nYour sys / emu ID0 is:\n$[SYSID0]\n$[EMUID0]"
# ERRORMSG and SUCCESSMSG / 'set' COMMAND # ERRORMSG and SUCCESSMSG / 'set' COMMAND