#.::
Loop
{
CoordMode Pixel, Relative ; Interprets the coordinates below as relative to the screen rather than the active window.
ImageSearch, FoundX, FoundY, 10,65, 1356, 743, *8 C:\Users\Pilkojr\Documents\bweast1.png
if ErrorLevel = 2
{
MsgBox Could not conduct the search.
break
}
MouseMove, FoundX+3, FoundY+3
; Click
Sleep 200
}
ReturnThe above code is finding the image fine on the screen then moving the mouse to the required location, but it is also clicking whenever the image isn't found onscreen.
I'm trying to get the mouse to click on the found image only when the image is onscreen.
How would I insert an IF statement that would only click if and when the image is found?
Ta Pilkojr




