Jump to content

Recommended Posts

Posted

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?

Posted

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]
Posted

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?

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.18.0 X86 - SciTE 4.4.6.0WIN 11 24H2 X64 - Other Examples Scripts

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]

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
×
×
  • Create New...