awannaknow
Joined: 14 Jun 2009 Posts: 324
|
Posted: Sat Feb 06, 2010 1:53 pm Post subject: How to wait for a process to close and time file save ? |
|
|
HI Everyone,
I'm wrestling with this for a few days now, here it is :
I want to wait for a process to close.
As the process (a game) regularily crash, or worse blue screen the PC, I want to save the game files, let say, every 10 mns.
And finally, when the process close (or crash) I want to save the game files (a last time) before the ahk file exit.
I tried a solution with
process waitclose,
TimeSet
and also
While or If
But ... Bouhouhou, : I can't mix them all properly to get the right result.
Here is what I wrote (at least the last variation of all my trials):
| Code: |
While "Process, WaitClose, Run.exe" ;If I don't put the double quote I get the following error message : "Error at line 19.
;The following variable name contains an illegal character:"Run.exe"
;The script was not reloaded; the old version will remain in effect."
;Unfortunately, from all the test and variations I made from now, I guess that when I put the double quotes, process don't work anymore ...
{
while Timer > 0 jump
SetTimer, save_profiles2, 600000 ; create a label where to go to save game files
save_profiles2:
;Save Game Files every 10 mns to avoid total loss due to game crashing the whole system
FileCopyDir, %Profile_Installation_Path%%Profile_Saved_folder%, %Profile_Saved_path%%Profile_Saved_folder%\, 1
jump: ;want to make a jump here if the timer is above zero
return ; want to make it go to "line 1 While "Process, WaitClose, Run.exe"", to check again if the process is closed or not
}
|
I'm stuck on it for more than 3 days . . .
For next Christmas I'll ask for "whole knowledge of the Universe" package, DeLuxe version . . .
Mmmm, ... with Add Ons and Plugs ins included, ....  |
|