Code: Select all
Global program = "enter program here"
Global PixelTest = 0
clickTest(){
CoordMode Pixel Client
CoordMode Mouse Client
;------------------------------------------------Select Color-------------------------------------------------
Loop
{
mousegetpos, x, y
PixelGetColor,Selected_Color,%x%,%y%, Fast RGB
tooltip, RButton Select Color - %Selected_Color% , (x + 20), (y + 20), 1
If (GetKeyState("RButton", "P")){
break
}
}
KeyWait, RButton, L
MouseGetPos,tpx,tpy
PixelGetColor,Selected_Color,%tpx%,%tpy%, Fast RGB
Tooltip,
;------------------------------------------------Select Top Left---------------------------------------------
Loop{
mousegetpos, x, y
tooltip, Select Top Left %x% - %y%, (x + 20), (y + 20), 1
If (GetKeyState("RButton", "P")){
break
}
;Sleep 200
}
KeyWait, RButton, L
MouseGetPos,tlx,tly
Tooltip,
;------------------------------------------------Select Bottom Right-----------------------------------------
Loop{
mousegetpos, x, y
tooltip, Select Bottom Right %x% - %y%, (x + 20), (y + 20), 1
If (GetKeyState("RButton", "P")){
break
}
;Sleep 200
}
KeyWait, RButton, L
MouseGetPos,brx,bry
Tooltip,
;------------------------------------------------Pixel Color Test-------------------------------------------
Loop{
if(PixelTest < 19){
PixelSearch, x, y, %tlx%, %tly%, %brx%, %bry%, %Selected_Color%, 1, Fast RGB
if(ErrorLevel = 0){
PixelTest++
Tooltip, Successes - %PixelTest%
;WinActivate %program%
;WinWait %program%
}
if(ErrorLevel = 1){
MsgBox, Can't find it, select new color
PixelTest := 0
WinActivate %program%
WinWait %program%
Loop
{
mousegetpos, x, y
PixelGetColor,Selected_Color,%x%,%y%, Fast RGB
tooltip, RButton Select Color - %Selected_Color% , (x + 20), (y + 20), 1
If (GetKeyState("RButton", "P")){
break
}
}
KeyWait, RButton, L
MouseGetPos,tpx,tpy
PixelGetColor,Selected_Color,%tpx%,%tpy%, Fast RGB
Tooltip,
}
}
if(PixelTest >= 19){
Tooltip,
;currentTask := "Tested the color " Selected_Color " successfully"
SoundPlay, *-1
Clipboard :=
Clipboard = PixelSearch, x, y, %tlx%, %tly%, %brx%, %bry%, %Selected_Color%, 1, Fast RGB
PixelTest := 0
break
}
}
F7::
clickTest()
return
F12::
ExitApp
}