Sign in to follow this  
Followers 0
BobDole909

Looping

5 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Yeah, I know I don't need a function, but that was PART of my script. Anyways, thanks for the help! :o

Share this post


Link to post
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.

 

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