Attila Posted August 4, 2011 Share Posted August 4, 2011 Hi there fellow AutoIter's.. I am making a little program and I need it to wait a certain time before it loops, how would I go about doing it? Link to comment Share on other sites More sharing options...
hannes08 Posted August 4, 2011 Share Posted August 4, 2011 Probably by using Sleep(), or a combination of TimerInit TimerDiff and Sleep. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
smartee Posted August 4, 2011 Share Posted August 4, 2011 Try Sleep() Link to comment Share on other sites More sharing options...
wakillon Posted August 4, 2011 Share Posted August 4, 2011 Look at Sleep function ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
smartee Posted August 4, 2011 Share Posted August 4, 2011 Hannes123 ninja fingers Link to comment Share on other sites More sharing options...
Nagato Posted August 4, 2011 Share Posted August 4, 2011 Did you mean "Sleep()" ? Link to comment Share on other sites More sharing options...
Attila Posted August 4, 2011 Author Share Posted August 4, 2011 I know about sleep, but I also need to loop the entire code. So basically I just need a loop. Could I get a quick example of a Do.. While? Link to comment Share on other sites More sharing options...
wakillon Posted August 4, 2011 Share Posted August 4, 2011 (edited) I know about sleep, but I also need to loop the entire code. So basically I just need a loop. Could I get a quick example of a Do.. While? See DateDiff or TimerDiff Functions. Like this #Include <Date.au3> Global $_Timer1 = _NowCalc ( ) While 1 $_NowCalc = _NowCalc ( ) If _DateDiff ( "s", $_Timer1, $_NowCalc ) >= 10 Then ExitLoop ; 10 sec Sleep ( 10 ) WEnd Edited August 4, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
smartee Posted August 4, 2011 Share Posted August 4, 2011 (edited) $i = 0 Do MsgBox(0, "Value of $i is:", $i) $i = $i + 1 Until $i = 10 Edit: Added code tags Edited August 4, 2011 by smartee Link to comment Share on other sites More sharing options...
hannes08 Posted August 4, 2011 Share Posted August 4, 2011 (edited) Highly-advanced-ninja-style-sleeping-loop: $i = 0 Do MsgBox(0, "Value of $i is:", $i) $i = $i + 1 Sleep(1000 * 60 * 5) ; Sleep for 5 Minutes Until $i = 10 Edited August 4, 2011 by Hannes123 Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Attila Posted August 4, 2011 Author Share Posted August 4, 2011 I got it. It was very difficult, must be that it's 4:30am and my brain is shutting down. Thanks for the input! 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