Hey Boiler!
Perhaps my reply was a bit too fast, see below for my complete script. The aim is to look for image Test.bmp, which is the "I'm Feeling Lucky" button on the Goolgle homepage, if found, show ToolTip acknowledging it was found, and then , using your provided answer, ControlClick in the center, in relation to the X & Y of the image found. Hélas, it does not work. Attached is a link to the Google homepage.
https://www.google.com/
Code: Select all
#WinActivateForce
SetTitleMatchMode 2
setcontroldelay, -1
gosub, progman
gosub, mousecenter
sleep, 1500
ifwinexist, Mozilla Firefox
winactivate, Mozilla Firefox
winwaitactive, Mozilla Firefox
sleep, 1000
loop, 5
{
ImageSearch, X, Y, 0, 0, A_screenwidth, A_Screenheight, *15 c:\temp\test.bmp
if errorlevel = 0
goto, found
}
found:
ToolTip, Image Found :), A_Screenwidth/2, A_Screenheight*0.25
sleep, 3000
tooltip
sleep, 1500
controlclick, % "x" (x+67) "y" (y+15),,, left, 1, NA Pos,,
goto, end
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
progman:
loop
{
winminimizeall
WinActivate, ahk_class Progman
controlfocus,, ahk_class Progman
ifwinactive, ahk_class Progman
break
else continue
}
return
mousecenter:
mousemove, A_screenwidth/2, A_Screenheight*0.35
return
esc::goto, end
Pause::Pause
end:
mousemove, A_Screenwidth/2, A_Screenheight/2
gui, destroy
loop, 5
{
Progress, b fm12 zh0 w100 zy0 ZX0 wm1000 cwff0000,, EXITING SCRIPT!,, arial black
sleep, 125
progress, off
sleep, 125
}
exitapp
Maybe something wrong with the syntax, not sure. Hopefully you can provided some help, and as always, it will be greatly appreciated.
Regards
Mr Mojo
[Mod edit: Changed code box from .txt type to .ahk type.]