Iceburg Posted April 17, 2009 Share Posted April 17, 2009 I have searched the forums, and can't find anything similar. Basically I am writing a small bot, with 4 options. I am doing: 4 buttons: A, B, C, D Each of the buttons have a function that they do if they are pressed. My issue is that if I press A, I want A to loop till the end of time, unless B, C, D is pressed. Goals: Add a progress bar to the GUI an wait 60 seconds, set choice A, then start over if nothing is pressed. Check the current date and time, and only set choice A if between xx:xx a.m. xx:xx p.m. Display time somewhere. Pause button stops timer / progress bar where it is at that time. My questions: 1.) How can I interrupt choice A, and the functions associated with it without having to finish the current loop to wait for another button? Choice A takes 45-60 seconds (by design) 2.) How do I assume choice A all the time unless something else is pressed? I may have some questions on the progress bar and getting the timing dead on, but I haven't researched that one enough to have solid questions. My code now: While 1 ;After every loop check if the user clicked something in the GUI window $msg = GUIGetMsg() Select ;Check if user clicked on the close button Case $msg = $GUI_EVENT_CLOSE ;Destroy the GUI including the controls GUIDelete() ;Exit the script Exit ;Check if user clicked on the "A" button Case $msg = $A func1() func2() ;Check if user clicked on the "B" button Case $msg = $B ;B function goes here ;Check if user clicked on the "Pause" button Case $msg = $Pause ;Pause function goes here ;Check if user clicked on the "Reset" button Case $msg = $Reset reset() EndSelect WEnd Link to comment Share on other sites More sharing options...
Iceburg Posted April 17, 2009 Author Share Posted April 17, 2009 Found this... AutoIt Restart ScriptI think this will help me through my first hurdles. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now