Been using a code suggested in another thread by Capn Odin and it worked fine. But now I'd like to add an additional function to it. Here's the original code:
Code: Select all
toggle := false
F6::SetTimer, CheckColour, % (toggle := !toggle) ? "250" : "Off" ; Evaluats the label CheckColour every 0.25 sec or turns it off depending on "toggle"
CheckColour:
PixelGetColor, Res, 712, 1017, RGB ; 1050,907Gets the colour at the coordinates (100, 100) in the active window
if(Res = 0x46D507){ ; checks the found colour
SetTimer, clk, 50, On
} else { ;
SetTimer, clk, Off
}
ToolTip, % Res, 100, 0 ; Displays the found colour in the upper left corner of the active window
Return
clk:
{
sleep 500
Send, i
sleep, 500
Click, left, 458, 400
sleep, 500
Click, left, 458, 550 ; 550-500
Sleep, 5000
}
return
Numpad9::exitapp