Sign in to follow this  
Followers 0
powderedonuts

Whats the function for restarting a loop?

2 posts in this topic

If Hex(PixelGetColor( 90, 142 ), 6) <> "007400" Then ;

(WHAT HERE? to restart the script from the beginning)

End If

I want to add this a bunch of times into my script so that if the pixel is no longer green The loop restarts instead of doing the whole thing.

HotKeySet("{F9}","Start")
HotKeySet("{F10}","End")
While 1
Sleep(100)
WEnd

Func Start()
While 1
If Hex(PixelGetColor( 90, 142 ), 6) <> "007400" Then;
Send("{SPACE}")
Sleep(10000)
Send("{SPACE}")
Sleep(200)
Else;
Send("{SPACE}")
Sleep(2000)
    Send("{UP down}");
Sleep(1600)
    Send("{UP up}");
    Send("{RIGHT down}");
Sleep(144 )
    Send("{RIGHT up}");
    Send("{UP down}");
Sleep(10700)
    Send("{UP up}");
Sleep(50000 + Random(5000, 6000, 7000))
Send("{SPACE}")
Sleep(50000 + Random(5000, 6000, 8000))
Send("{SPACE}")
Sleep(10000 + Random(5000, 6000, 8000))  
    Send("{UP down}");
Sleep(3500)
    Send("{UP up}");
Sleep(1000)
Send("1", 1)
Sleep(20000)
EndIf
Wend
EndFunc

Func End()
Exit
EndFunc

Please help, thanks. I want a command that checks the pixels between movements with the sleeps that will interrupt the process and restart the loop.

Share this post


Link to post
Share on other sites



ContinueLoop


[size="1"][font="Arial"].[u].[/u][/font][/size]

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