Sign in to follow this  
Followers 0
vava

looping issues

2 posts in this topic

i would like to loop it buy i have while statments issues i belive my while 1+1=2 makes it no good but i cant find a way to go back to 6th line automaticaly

ty in advance

Dim $color = PixelGetColor(290, 461)

Dim $red = PixelGetColor(337,626)

Dim $yellow = PixelGetColor(476,577)

while 1+1=2

(while $color = PixelGetColor(290, 461)

wend

sleep (2000)

if $red = PixelGetColor(337,626) Then

MouseClick("left" , 290, 461 , 2 , 20)

MouseClick("left" , 670, 558 , 1 , 20)

else

if $yellow > PixelGetColor(476,577) then

MouseClick("left" , 413, 460 , 1 , 20)

else

MouseClick("left" , 619, 460 , 1 , 20)

endif

endif)

wend

Share this post


Link to post
Share on other sites



Maybe:

Dim $color = PixelGetColor(290, 461)
Dim $red = PixelGetColor(337, 626)
Dim $yellow = PixelGetColor(476, 577)

While 1
    While $color = PixelGetColor(290, 461)
        Sleep(100)
    WEnd
    Sleep(2000)
    
    If $red = PixelGetColor(337, 626) Then
        MouseClick("left", 290, 461, 2, 20)
        MouseClick("left", 670, 558, 1, 20)
    Else
        If $yellow > PixelGetColor(476, 577) Then
            MouseClick("left", 413, 460, 1, 20)
        Else
            MouseClick("left", 619, 460, 1, 20)
        EndIf
    EndIf
WEnd

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