Sign in to follow this  
Followers 0
Attila

Waiting Loop

11 posts in this topic

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?

Share this post


Link to post
Share on other sites



Probably by using Sleep(), or a combination of TimerInit TimerDiff and Sleep. :mellow:


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Try Sleep()

Share this post


Link to post
Share on other sites

Look at Sleep function ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
:mellow: Hannes123 ninja fingers

Share this post


Link to post
Share on other sites

Did you mean "Sleep()" ?

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

$i = 0
Do
    MsgBox(0, "Value of $i is:", $i)
    $i = $i + 1
Until $i = 10
Edit: Added code tags Edited by smartee

Share this post


Link to post
Share on other sites

#10 ·  Posted (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

:mellow: Edited by Hannes123

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

I got it. It was very difficult, must be that it's 4:30am and my brain is shutting down. Thanks for the input!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0