Sign in to follow this  
Followers 0
powderedonuts

Need to implement a check point for my movement script.

2 posts in this topic

Here is my looping script that I'm working on that initiates based on the color of a green pixel.

What I need to implement now is a way for the script to keep checking the pixel, and if it turns not

green it restarts the loop (like if it is partially through the arrow key movements but not fully done).

How can I do this? Thanks.

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(220)
    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

Share this post


Link to post
Share on other sites



Like can I add a pixel get color function between each movement that will continue the

script if the color is green but if the pixel is no longer green restarts the whole thing?

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