here is a script someone helped me make so far all it does is just send "r" if the left mouse button hasn't been click in 10 secs
but i also need it to click on the colors 0xA77336 ,0x135EE2 ,0x03D9F3 as soon as it appears on my screen
and i could start the whole script by pressing ctrl+[key1] always running unless i press Ctrl+[key2]
here is what i did but only the sending "r" if the mouse hasn't been clicked works while the color clicker doesn't
is there a better way to click these colors
or is there a better way to make this script?
any help would be appreciated.
Code: Select all
z:: ; the trigger can be anything i put [z] as a example
PixelSearch, Px, Py, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0xA77336, 0x135EE2, 0x03D9F3, 0, Fast ; 0xA77336, 0x135EE2, 0x03D9F3 are the 3 colors i want it to look for
if ErrorLevel
Send, z ;the way i did it here it has to be the same as the trigger[z] so it can loop, only if the colors arent found
else
click %Px%, %Py% ;even if the colors is found it needs to do the "else" then run the trigger[z] once more once more
Sleep, 10
click %Px%, %Py%
Sleep 10
send, z
return
;mouse click wait ten seconds then send "r"
#Persistent
MouseGetPos, Xold, Yold
MoveTime := A_TickCount + 10000
SetTimer, Mouse, 100
Return
Mouse:
MouseGetPos, X, Y
If (X <> Xold Or Y <> Yold)
{
MoveTime := A_TickCount + 10000
Xold := X, Yold := Y
}
If (MoveTime < A_TickCount)
{
SendInput, r
MoveTime := A_TickCount + 10000
}
Return
e:: ;exit app it can be anything i put e as a example
ExitApp
return
#SingleInstance,force