holyearth Posted November 2, 2009 Share Posted November 2, 2009 (edited) I have a while loop that is going constantly. But -- every 30 minutes I want the loop to stop and close a running process then resume the loop... Here is my code that is not working: $begin = TimerInit () While 1 $dif = TimerDiff ($begin) MouseMove(60, 400) MouseMove(222, 100) if $dif > 1800000 then ;after 30 mins do this then go back to loop above MouseMove(444, 100) ExitLoop WEnd WEnd This is not working for me. Once the 444,100 mousemove starts it wont stop. Thanks for the help! Edited November 2, 2009 by holyearth Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 2, 2009 Share Posted November 2, 2009 You never reset your timer in $begin. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
holyearth Posted November 2, 2009 Author Share Posted November 2, 2009 You never reset your timer in $begin. How do I do that? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 2, 2009 Share Posted November 2, 2009 How do I do that?$begin = TimerInit()You only did that once, and didn't reset it again once you reached the timeout. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
holyearth Posted November 2, 2009 Author Share Posted November 2, 2009 $begin = TimerInit()You only did that once, and didn't reset it again once you reached the timeout. I tried it, but it doesnt work:$begin = TimerInit () While 1 $dif = TimerDiff ($begin) MouseMove(60, 400)MouseMove(222, 100)While $dif > 6000 WinMove("Notepad", "", 216, 8) ; x , y $begin = TimerInit () WEndWEnd Link to comment Share on other sites More sharing options...
holyearth Posted November 2, 2009 Author Share Posted November 2, 2009 (edited) Tried this, and it works: While 1 $dif = TimerDiff ($begin) MouseMove(60, 400) MouseMove(222, 100) If $dif > 6000 then WinMove("Notepad", "", 216, 8) ; x , y $begin = TimerInit () EndIf WEnd Edited November 2, 2009 by holyearth 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