Jump to content
Sign in to follow this  
computergroove

Nested for loop works first time but then stops

Recommended Posts

computergroove

Func 123()
Local $xPos1 = 47
Local $xPos2 = 19
Local $xPos3 = 44
For $i = 1 To 4
    MouseClick("Right", $xPos1,300)
    Sleep(500)
    MouseClick("Right", $xPos1,457,2,300)
    Sleep(500)
    MouseDown("Left")
    Sleep(2000)
    MouseUp("Left")
    For $i=1 To 4
        MouseClick("Left",$xPos2,425)
        Sleep(500)
    Next
    MouseClick("Right",$xPos2,425)
    Sleep(500)
    MouseClick("Right",$xPos2,425)
    Sleep(500)
    MouseClick("Left",$xPos3,91)
    $xPos1 = $xPos1 + 325
    $xPos2 = $xPos2 + 325
    $xPos3 = $xPos3 + 325
    Sleep(500)
Next
EndFunc

My script gets to the last line but then stops. Can anyone see why it wouldn't loop 4 times?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
ripdad

easy mistake to make -- change $i in 2nd loop to $j.


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
computergroove

Thanks


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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  

×