Sign in to follow this  
Followers 0
Guest tso_xaser

Looping Script

3 posts in this topic

Hi everyone

I need some help getting this script to loop...

I have read the help file i cant work out what to put to get this script to loop

i want it to continue until i tell it to stop.

Here is the script

=========================

MouseMove(392, 13)

MouseClick("left")

Send ("{ENTER}")

Sleep(5000)

Send ("{ENTER}")

Sleep(10000)

MouseMove(1264, 974)

Sleep(5000)

MouseClick("left")

Sleep(5000)

Send ("{ENTER}")

Sleep(5000)

Send ("{ENTER}")

Sleep(480000)

=========================

it works so far but i need it to loop back to the start after the sleep(480000)

Please help

Thanks

Xaser

Share this post


Link to post
Share on other sites

check out this from the helpfile:

While...WEnd

--------------------------------------------------------------------------------

Loop based on an expression.

While <expression>

statements

...

WEnd

Parameters

expression If the expression is true the following statements up to the WEnd statement are executed. This loop continues until the expression is false.

Remarks

While...WEnd statements may be nested.

The expression is tested before the loop is executed so the loop will be executed zero or more times.

To create an infinite loop, you can use a non-zero number as the expression.

Related

ContinueLoop, Do...Until, ExitLoop

Example

$i = 0

While $i <= 10

MsgBox(0, "Value of $i is:", $i)

$i = $i + 1

WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

while 1; means to do this loop while 1 is true, which is forever
    _doStuff(); calls your function
    sleep(480000); sleeps for8 minutes
WEnd; do the loop again


Func _doStuff()
    MouseMove(392, 13)
    MouseClick("left")
    Send ("{ENTER}")
    Sleep(5000)
    Send ("{ENTER}")
    Sleep(10000)
    MouseMove(1264, 974)
    Sleep(5000)
    MouseClick("left")
    Sleep(5000)
    Send ("{ENTER}")
    Sleep(5000)
    Send ("{ENTER}")
EndFunc

Edit: oops, you beat me to it, :)

Edited by steveR

AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.

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