Attila Posted August 4, 2011 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?
hannes08 Posted August 4, 2011 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]
wakillon Posted August 4, 2011 Posted August 4, 2011 Look at Sleep function ! AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
Attila Posted August 4, 2011 Author 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?
wakillon Posted August 4, 2011 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.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
smartee Posted August 4, 2011 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
hannes08 Posted August 4, 2011 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]
Attila Posted August 4, 2011 Author 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!
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