TegraScript/scripts/systemwipe.te
suchmememanyskill c36b6909ea
Add some scripts
2020-04-01 21:06:29 +02:00

136 lines
No EOL
2.4 KiB
Text

printf("TegraScript system wiper");
printf("");
printf("Press vol+ to wipe from SYSMMC");
if (@EMUMMC){
printf("Press vol- to wipe from EMUMMC");
}
printf("Press power to exit");
printf("");
pause();
if (@BTN_VOL+){
printf("Mounting SYSMMC...");
mmc_connect("SYSMMC");
}
if (@BTN_VOL-){
@noemu = invert(@EMUMMC);
if (@noemu){
exit();
}
printf("Mounting EMUMMC...");
mmc_connect("EMUMMC");
}
if (@BTN_POWER){
exit();
}
mmc_mount("SYSTEM");
if (@RESULT){
printf("System failed to mount!");
pause();
exit();
}
setString("emmc:/save/", $basePath);
setColor("RED");
printf("Are you sure you want to wipe everything?");
printf("This includes:");
printf("- Saves");
printf("- Game Data");
printf("- All other data on the system");
printf("");
printf("Use this only as a last resort!");
printf("");
setColor("YELLOW");
wait(10);
printf("Press vol+ to continue");
printf("Press vol- or power to exit");
pause();
if (@BTN_POWER){
exit();
}
if (@BTN_VOL-){
exit();
}
@count = setInt(1);
printf("Deleting SYSTEM saves");
fs_openDir("emmc:/save");
setColor("RED");
?LOOP;
fs_readDir();
if (@ISDIRVALID){
combineStrings($basePath, $FILENAME, $path);
setPrintPos(0, 20);
printInt(@count);
@count = math(@count, "+", 1);
@check = compareStrings($FILENAME, "8000000000000120");
if (@check){
goto(?LOOP);
}
@check = compareStrings($FILENAME, "80000000000000d1");
if (@check){
goto(?LOOP);
}
@check = compareStrings($FILENAME, "8000000000000047");
if (@check){
goto(?LOOP);
}
printf($FILENAME);
fs_del($path);
goto(?LOOP);
}
printf("");
printf("");
printf("Deleting USER");
mmc_mount("USER");
if (@RESULT){
printf("User failed to mount!");
pause();
exit();
}
fs_delRecursive("emmc:/Album");
fs_mkdir("emmc:/Album");
fs_delRecursive("emmc:/Contents");
fs_mkdir("emmc:/Contents");
fs_mkdir("emmc:/Contents/placehld");
fs_mkdir("emmc:/Contents/registered");
fs_delRecursive("emmc:/save");
fs_mkdir("emmc:/save");
fs_delRecursive("emmc:/saveMeta");
fs_mkdir("emmc:/saveMeta");
fs_delRecursive("emmc:/temp");
fs_mkdir("emmc:/temp");
setColor("GREEN");
printf("");
printf("");
printf("Done! press any key to exit");
pause();
exit();