Jump to content

Looping


Recommended Posts

I looked in the helpfile, but I didn't really understand it. This is part of my script I want to loop:

Func Bot()

WinWaitActive("Project1")

Sleep(100)

MouseClick("left", 219, 501, 1)

Sleep(300)

Send("+{BACKSPACE 8}")

Sleep(500)

Send("99999999")

Sleep(300)

MouseClick("left", 269, 497, 1)

Sleep(500)

MouseClick("left", 535, 356, 1)

Sleep(5000)

MouseClick("left", 516, 498, 1)

Sleep(500)

MouseClick("left", 314, 213, 1)

Sleep(20000)

MouseClick("left", 333, 278, 1)

Sleep(100)

EndFunc()

Once it's done with that, how do you loop it? Thanks in advance. :o

Link to comment
Share on other sites

Check out While WEnd in the help files. Usually looks like:

While something is true, do these things. If something happens, exit. Otherwise, keep doing these things...

Examples in help file.

Edited by jefhal
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Look for "While" in the help file, that should get you started. Also, you don't need to create a function for it to be able to loop.

Check back with your new code and we'll go from there. :o

[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Link to comment
Share on other sites

example:

HotKeySet("{ESC}","_Exit")

While 1
  Bot()
Wend

Func Bot() 
    WinWaitActive("Project1")
    Sleep(100)
    MouseClick("left", 219, 501, 1)
    Sleep(300)
    Send("+{BACKSPACE 8}")
    Sleep(500)
    Send("99999999")
    Sleep(300)
    MouseClick("left", 269, 497, 1)
    Sleep(500)
    MouseClick("left", 535, 356, 1)
    Sleep(5000)
    MouseClick("left", 516, 498, 1)
    Sleep(500)
    MouseClick("left", 314, 213, 1)
    Sleep(20000)
    MouseClick("left", 333, 278, 1)
    Sleep(100)
EndFunc

Func _Exit()
    Exit
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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