Jump to content

Recommended Posts

Posted

I seem to be having trouble with while statements inside of a while statement.

Does AutoIt allow While statements to be nested within a while loop?

Thanks.

  • Developers
Posted

I seem to be having trouble with while statements inside of a while statement.

Does AutoIt allow While statements to be nested within a while loop?

Thanks.

<{POST_SNAPBACK}>

yes... no problem....

Just post the portion you have problems with ...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

I seem to be having trouble with while statements inside of a while statement.

Does AutoIt allow While statements to be nested within a while loop?

Thanks.

<{POST_SNAPBACK}>

Of course, I use nested While/WEnd and Do/Until all the time.

Example:

Func GetFAFid()
   Local $path = "F:\path\ScanRte.ini"
   Local $unum = IniRead($path, "ScanRte", "UserNumber", "NotFound")
   If FileExists($path) = 0 Or $unum = "NotFound" Then
      Do
         Do
            $unum = InputBox("Initialization", "Please enter the number you use to route FAF to yourself", "U123456")
         Until Not @error And $unum <> ''
         $box = MsgBox(36, $unum, "Is " & $unum & " correct?")
         If $box = $no Then $unum = "NotFound"
      Until $box = $yes
      IniWrite($path, "ScanRte", "UserNumber", $unum)
   EndIf
   Return $unum
EndFunc ;==>GetFAFid
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Posted (edited)

I had problems before if I put something like this

while
do stuff
while
do stuff
wend
do stuff
wend

But solved it be doing this

while
do stuff
  while
do stuff
wend
do stuff
  wend

I think autoit needs someway of knowing which while goes to which wend and by hitting space between them you can do that.

I could be wrong here but it helped with mutiple if statements in a bot I made

If $alt1 = 1 Then
  If PixelGetColor(766 + $resolution2 ,537 + $resolution ) < 10000000 AND PixelGetColor(751 + $resolution2 ,537 + $resolution ) > 10000000 Then 
    If $follow = 1 Then
MouseClick("right")
sleep(100)
MouseClick("right")
  EndIf
Sleep(500)
Send("!1")
Sleep(4000)
  If $follow = 1 Then
Sleep(1000)
Send("!0")
Sleep(1000)
    EndIf
  Endif
Endif
Edited by megahyperion

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
  • Recently Browsing   0 members

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