Sign in to follow this  
Followers 0
holyearth

Loop question

6 posts in this topic

#1 ·  Posted (edited)

I have a while loop that is going constantly. But -- every 30 minutes I want the loop to stop and close a running process then resume the loop...

Here is my code that is not working:

$begin = TimerInit ()

While 1

$dif = TimerDiff ($begin)

MouseMove(60, 400)

MouseMove(222, 100)

if $dif > 1800000 then ;after 30 mins do this then go back to loop above

MouseMove(444, 100)

ExitLoop

WEnd

WEnd

This is not working for me. Once the 444,100 mousemove starts it wont stop.

Thanks for the help!

Edited by holyearth

Share this post


Link to post
Share on other sites



You never reset your timer in $begin.

:)

How do I do that?

Share this post


Link to post
Share on other sites

How do I do that?

$begin = TimerInit()

You only did that once, and didn't reset it again once you reached the timeout.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

$begin = TimerInit()

You only did that once, and didn't reset it again once you reached the timeout.

:)

I tried it, but it doesnt work:

$begin = TimerInit ()

While 1

$dif = TimerDiff ($begin)

MouseMove(60, 400)

MouseMove(222, 100)

While $dif > 6000

WinMove("Notepad", "", 216, 8) ; x , y

$begin = TimerInit ()

WEnd

WEnd

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Tried this, and it works:

While 1

$dif = TimerDiff ($begin)

MouseMove(60, 400)

MouseMove(222, 100)

If $dif > 6000 then

WinMove("Notepad", "", 216, 8) ; x , y

$begin = TimerInit ()

EndIf

WEnd

Edited by holyearth

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