EuphoricApathy Posted May 21, 2014 Share Posted May 21, 2014 (edited) I have a working script in autoit. I would like this script to run for 30 minutes,sleep for 1 minute and then continue. My script is looped so that it runs forever until i press esc. How can i accomplish this? The script below is just an example,if you want(it would be helpful) if you use it to show an example of how to accomplish this. func exitthescript() Exit EndFunc HotKeySet( "{ESC}", "exitthescript" ) while 1 MouseClick("left", 1 ) WEnd I know that i probably need to use a timer,and the sleep commands. im just unsure about using it with my loop. imanoob sorries >.< Edited May 21, 2014 by EuphoricApathy Link to comment Share on other sites More sharing options...
JohnOne Posted May 21, 2014 Share Posted May 21, 2014 Func exitthescript() Exit EndFunc ;==>exitthescript HotKeySet("{ESC}", "exitthescript") $Timer = TimerInit() While 1 If TimerDiff($Timer) >= 30 * (1000 * 60) Then Sleep(1000 * 60) $Timer = TimerInit() EndIf MouseClick("left", 1) WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
EuphoricApathy Posted May 21, 2014 Author Share Posted May 21, 2014 Func exitthescript() Exit EndFunc ;==>exitthescript HotKeySet("{ESC}", "exitthescript") $Timer = TimerInit() While 1 If TimerDiff($Timer) >= 30 * (1000 * 60) Then Sleep(1000 * 60) $Timer = TimerInit() EndIf MouseClick("left", 1) WEnd Thats it? This will keep my script running forver(till i press esc) have it sleep for 1 min every 30 min, and then continue? Thankyou!!! Link to comment Share on other sites More sharing options...
JohnOne Posted May 21, 2014 Share Posted May 21, 2014 Well earth might explode before forever but, yes, I suppose. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
EuphoricApathy Posted May 21, 2014 Author Share Posted May 21, 2014 Well earth might explode before forever but, yes, I suppose. lol,thx,tested it and its working fine. Link to comment Share on other sites More sharing options...
JohnOne Posted May 21, 2014 Share Posted May 21, 2014 Ace. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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