Im working on a simple script that detect a color and click on different coordinates based on the color.
This is what Im using right now:
Code: Select all
x::
PixelGetColor, Pix, 123, 123
IfEqual, Pix, COLOR1 , click, 234, 234, 2
IfNOTEqual, Pix, COLOR1, click, 321, 321,
return
Pretty simple, if the color its the one I'm looking for then double click on coordinates if not, click on different coordinates.
But what I really want its a persistent script that detect one color if that color match, then go to the script on the top or similar, Im gonna try to write a scrit using simple english mixed with code just to show what I want:
Code: Select all
;step 1
PixelGetColor, Pix1, X1,Y1
if Pix1 = Color1 ;(ONLY IF, GO FOR THE NEXT PixelGetColor)
sleep 3000 ; Sleep 3 sec and go to the next pixelgetcolor (stop retriving Pix1)
;step 2
PixelGetColor, Pix2, X2,Y2
if Pix2 = Color2
Click, 123, 123,
else if Pix2 != Color2
; don't know if "else if" or not equal are valid, I want to be able to create as many condition as I want based on the color.
Click, 321, 321,
;step 3
sleep 10000
(star over)
I only want to start retriving Pix2 if Pix1 its correct, otherwise its keep searching for the color. I said persistent but If I had an On / Off key the better.
I'm really bad explaining things, but I hope someone can undestand and help me to do this code, once I have the code I will be able to modify at will and maybe twik it a little bit.
Thank you in advance
PS: I know that PixelGetColor can keep retriving color instead of stop, but what I want requiere multiple conditions and if those multiple conditions are true then take action.