this me code i trying to search for two image, if found some image do something ,if found other image do something else.
this is mikey code with some adjustment by me ,
i dont know why image search didn't respond ,
i know wrong syntax in line 11,
Can anyone correct it for me please.
Code: Select all
CoordMode, Pixel
CoordMode, Mouse
NoHarm = img5.png
Harm = img6.png
f1::
loop
{
For k, v in ["%NoHarm%" , "%Harm%"]
{
ImageSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, %A_ScriptDir%\%v%
If ErrorLevel
Continue
Gosub, %v%
Break
}
Return
}
NoHarm:
MsgBox, No Harm Found!
Return
Harm:
MsgBox, Found Harm!
Return
End::ExitApp ; Exit script with Escape key
^!p::Pause ; Pause script with Ctrl+Alt+P
^!s::Suspend ; Suspend script with Ctrl+Alt+S
^!r::Reload ; Reload script with Ctrl+Alt+R
thanks in advance..