Jump to content
Sign in to follow this  
Bonestein

loopy loops

Recommended Posts

Bonestein

How do you make a loop inside of a loop?

like this

<----------------------return to this point and run the loop again

$i = 0

Do

sleep(6500)

send ("1")

sleep(4500)

send ("5", $i)

$i = $i + 1

Until $i = 45

----------------------------------->send back to the top or line of choice.

until I manually close or stop it?

Share this post


Link to post
Share on other sites
SmOke_N

I don't know what you mean by "manually"... generally there are conditions that will happen to make you "manually" do it.

Global $bBool
HotKeySet("{HOME}", "Start_Stop_That_Damn_Loop")

While 1
    Sleep(1000000)
WEnd

Func  Start_Stop_That_Damn_Loop()
    $bBool = Not $bBool
    Local $i
    While $bBool
        Sleep(100)
        Send(1)
        Send($i);No idea what you are doing with $i in your example, there are only 2 flags, 0 and 1
        $i += 1
    WEnd
EndFunc
Using the Home key, you can start and stop it at your leisure.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
SmOke_N

I was just going off of the example in the online documentation

http://www.autoitscript.com/autoit3/docs/keywords/Do.htm

it put the extra $i in there, so I used it there also. I will take these examples and learn from them, thank you for your assistance.

It put the $i in a MsgBox so you can visually see what Do/Until is doing.... It didn't put it in a Send command that shows in the help file what the parameters are and their limitations/expectations.

All I'm saying is read first what you can and can't do with a function, or you'll be asking questions later on it that could have been solved by simply reading the help file on param usage.

Good Luck, and you're welcome.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  

×