Jump to content

Recommended Posts

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
Posted

$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

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...