by Fatboyfun » Mon Dec 13, 2010 9:32 pm
Here you go... 2112
This is a Mortscript that suspends the device when both iGO Primo is running AND external power is removed.
You run Power.exe to start iGO, The script monitors the external power and suspends the device one second after it is removed, If the device is switched on without power it immediately suspends again, If Primo exits the script exits as well.
[color="red"]MAKE A BACKUP OF YOUR DEVICE BEFORE ATTEMPTING THIS.[/color]
You will need to edit the red parts of Power.mscr below with notepad on your PC to match your device.
Run ("[color="red"]\Storage Card\Primo\iGO.exe[/color]") [color="red"]*1[/color]
WaitFor ("NAVI",[color="red"]20[/color]) [color="red"]*2[/color]
While (WndExists("NAVI"))
While (ExternalPowered(True))
Sleep [color="red"]1000[/color] [color="red"]*3[/color]
If (Not WndExists("NAVI"))
Exit
EndIf
EndWhile
PowerOff
EndWhile
Exit
[color="red"]*1 [/color]Path to iGO on your device
[color="red"]*2 [/color]Set this number to match how long Primo starts up in seconds so it doesn't suspend itself while starting up, If power is removed during this time it will suspend after the time is up
[color="red"]*3 [/color]Set this number in milliseconds (1000 = one second) to match how long you want the device to wait before suspending after power is removed, AT LEAST ONE SECOND IS BEST otherwise the device may lag, If you get problems with file corruption then increase this number
[color="red"]Installation[/color]
Put all three files somewhere on the device, Make the edits to power.mscr if required and then run power.exe to start iGO Primo. As normal with mortscript you can rename Power.exe/mscr if you need to.
Currently sleeping...