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 

Using GUI buttons to Pause/Resume

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



Joined: 19 Feb 2008
Posts: 6

PostPosted: Sat May 10, 2008 6:43 pm    Post subject: Using GUI buttons to Pause/Resume Reply with quote

Hi,

I have script which is functioning well. It has a couple of automatic loop type processes in it and some hotkeys. At some point I would like to be able to pause and then resume only a certain part of the script whilst the remainder of the script continues to function for the whole time. I want the entire script to start fully functional, and then to pause and resume one particular part of the script (called say, FRED) as I need to. I have created a GUI with a pause button and a seperate resume button to use for this task- my question is, how do I write the part of the script so that only FRED pauses when I hit the pause button, and resumes when I hit the resume button. I have tried all sorts of things but it seems beyond my noobish ways. Embarassed I'm still stunned I got the script to go in the first place Laughing
Back to top
View user's profile Send private message
sinkfaze



Joined: 19 Mar 2008
Posts: 113

PostPosted: Sat May 10, 2008 7:55 pm    Post subject: Reply with quote

Perhaps you could assign the loop to a SetTimer routine, assign the Pause button to turn off the timer for that routine and assign the Resume button to turn the timer back on.
Back to top
View user's profile Send private message
Logman



Joined: 19 Feb 2008
Posts: 6

PostPosted: Sun May 11, 2008 3:37 am    Post subject: Reply with quote

Ok, thanks, I will look into that. I just wanted to make sure it wasn't impossible before I spent to much time working out how. Wink
Back to top
View user's profile Send private message
Logman



Joined: 19 Feb 2008
Posts: 6

PostPosted: Sun May 11, 2008 5:18 am    Post subject: Reply with quote

Thanks very much, got it going Very Happy
Back to top
View user's profile Send private message
Peterm353



Joined: 07 Mar 2008
Posts: 2

PostPosted: Sun May 11, 2008 7:51 pm    Post subject: Reply with quote

I needed to breakl out of a process is it twas getting boring, so I just set a global variable from the gui. Click the Pause button, it sets a variable to 1 (paused).
Then when your loop finds the global variable has changed to 1 it pauses (or whatever you need).
Only drawback it has to check this global variable each time. Might be too slow for what you need.

P
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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