I have a simple color clicker code.
~C::
Loop
{
PixelSearch, Px, Py, 300, 300, 300, 300, 0x91595c, 5, Fast
if errorlevel
{
sleep 20
return
}
else
{
Send, {LButton Down}
Sleep, 250
Send, {LButton Up}
Sleep, 500
}
}
return
When pressing a C, its find a right color and send a click. But i tired to make it work ONLY when C is pressed and finish color search when C is not pressed.
What have you already tried? I tried to make this work with:
while KeyIsDown := GetKeyState("c", "P")
or
if KeyIsDown := GetKeyState("c")
But it just come to infinite loop or doesnt work. Can you have any ideas?