Code:
####################Dump Home Menu to .cia####################
@Dump_Options_Dump_HomeMenu_to_.cia
set PREVIEW_MODE "GODMODE9 ALL-IN-ONE MEGASCRIPT\nby annson24\n \nDump Options\n>HomeMenu to .cia Dump"
if not ask "Dump HomeMenu to .cia?\n \nPlease make sure you have\nenough storage space."
goto MainMenu_Dump_Options
end
set OUTPATH "0:/gm9/out" <-----------ADD THIS INITIALIZATION (But not this text obviously)
set CIA2 "$[OUTPATH]/homemenu.cia"
echo "$[REGION] region detected."
if chk $[REGION] "JPN"
find $[OUTPATH]/0004003000008202* CIA1
elif chk $[REGION] "USA"
find $[OUTPATH]/0004003000008F02* CIA1
elif chk $[REGION] "EUR"
find $[OUTPATH]/0004003000009802* CIA1
elif chk $[REGION] "CHN"
find $[OUTPATH]/000400300000A102* CIA1
elif chk $[REGION] "KOR"
find $[OUTPATH]/000400300000A902* CIA1
elif chk $[REGION] "TWN"
find $[OUTPATH]/000400300000B102* CIA1
elif chk $[REGION] "UNK"
echo "Unknown Region.\nPlease contact the script author.\Aborting."
goto MainMenu_Dump_Options
else
echo "Operation failed."
goto MainMenu_Dump_Options
end
mv -w -n $[CIA1] $[CIA2]
echo "HomeMenu Dumped in:\n$[OUTPATH]"
if ask "Decrypt $[CIA2]?"
decrypt $[CIA2]
echo "$[CIA2] decrypted"
else
echo "Decrypt declined."
end
goto MainMenu_Dump_Options
@annson24, see if this reduces clutter without breaking function.
Edit - Hey, in case you adjust the code like that posted above, I need to share with you this info about using elif with if and end. It doesn't appear that to be correct when using else with elif in the big if/end. Else in a sub if / end is fine if it's only binary (true/false).
Allowed
Code:
if [argument statement]
[your action(s) if true]
else
[your action(s) if false]
end
Allowed
Code:
if [argument statement]
[your action(s) if true]
elif [Skip to this argument statement if previous argument is false.]
[your action(s) if true]
elif [Skip to this argument statement if previous argument is false.]
[your action(s) if true]
.
.
.
elif [Final argument statement]
[your action(s) if true]
end
Code:
if [argument statement]
[your action(s) if true]
elif [Skip to this argument statement if previous argument is false.]
[your action(s) if true]
elif [Skip to this argument statement if previous argument is false.]
[your action(s) if true]
.
.
.
else
[your action(s) if all previous arguments are false]
end
Edit #?? - Nvm. I think with else, you don't provide an argument. You're telling that if / end to default to doing that last action(s) when all other arguments fail.
Last edited by TurdPooCharger,








