Jump to content

HOW TO? LOOP inside LOOP?


hakerche
 Share

Recommended Posts

I need help! I am new in programing and scripting so I don't know what to use to make loop inside of loop?

something like

start of loop 1

start of loop 2 until something

then after finished with loop 2 reset loop 2 and

continue of loop 1 until something

??? HOW ???

Link to comment
Share on other sites

Heres a simple one. I could help more if you would post what you are really looking for.

While 1 ;keeps running when not in error, While/WEnd
    $Count = 10  ;this is the starting value
    MsgBox(0, "Count", $Count)  ;standard message, title, value
    Do ;second loop, Do/Until
        $Count = $Count - 1 ;Reduce count by 1
        MsgBox(0, "Count", $Count) ;show new count
        Sleep(1000) ; brief pause
    Until $Count = 1 ;When to stop Do
Sleep(5000) ;did you want to restart 2?
WEnd  ;Start all over

its a repeat countdown btw

Edited by Hatcheda
Link to comment
Share on other sites

I need help! I am new in programing and scripting so I don't know what to use to make loop inside of loop?

something like

start of loop 1

start of loop 2 until something

then after finished with loop 2 reset loop 2 and

continue of loop 1 until something

??? HOW ???

Demo:

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

While 1
    For $x = 0 To 9
        For $y = 0 To 9
            For $z = 0 To 9
                Sleep(20)
                ToolTip("XYZ = " & $x & $y & $z)
            Next
        Next
    Next
WEnd

Func _Quit()
    Exit
EndFunc

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...