Try this script. It loads the image into a gui and then F1 searches for the image.
Code:
; change to the name of your image, in the same folder as this script
image_name=NTlogo.bmp
#singleinstance force
; if you change the value after 'if' to 1, all coordinates will be relative to screen/monitor
; if you leave the value at 0, all coordinates will be relative to current window
if 1 ; screen coordinates
coord=screen
else
coord=relative
tooltip, %coord% ; remind user of the mode
sleep, 1000
tooltip, ; hide the reminder
CoordMode, ToolTip, %coord%
CoordMode, Pixel, %coord%
CoordMode, Mouse, %coord%
CoordMode, Caret, %coord%
CoordMode, Menu, %coord%
; this two lines creates a window that has the image in it, for practice; this is temporary
gui, add, picture, , %image_name%
gui, show, , mywindow
SetTimer, WatchCursor, 100
return
; this shows the current location of the mouse,
; you can use this information to edit the search location
WatchCursor:
MouseGetPos,xpos , ypos , id, control
ToolTip, xpos: %xpos%`nypos: %ypos%,,, 2
return
; search for the image, it must be completely visible
f1::
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, %image_name%
if ErrorLevel = 2
tooltip Could not conduct the search.
else if ErrorLevel = 1
tooltip Image could not be found on the screen.
else
{
mousemove, %FoundX%, %FoundY%, 10
tooltip The image was found at %FoundX%x%FoundY%.
}
return
esc::
msgbox script closed by user
exitapp