AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to wait for a process to close and time file save ?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
awannaknow



Joined: 14 Jun 2009
Posts: 324

PostPosted: Sat Feb 06, 2010 1:53 pm    Post subject: How to wait for a process to close and time file save ? Reply with quote

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, Shocked : 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 Idea "whole knowledge of the Universe" package, DeLuxe version . . . Idea
Laughing Mmmm, ... with Add Ons and Plugs ins included, .... Wink
Back to top
View user's profile Send private message
shocked
Guest





PostPosted: Sat Feb 06, 2010 3:02 pm    Post subject: Reply with quote

while, expression
and not
!! while, command !!
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group