Code: Select all
#MaxThreadsPerHotkey 8
numpad1::
CoordMode, Pixel, Window
ImageSearch, FoundX, FoundY, 10, 94, 1032, 776, C:\Users\home\AppData\Roaming\MacroCreator\Screenshots\Screen_20170922172311.png
toggle := !toggle
SetTimer, Trigger, -1
Trigger:
while(toggle)
{
Loop
{
if ErrorLevel = 0
MsgBox, 49, Continue?, Image / Pixel Found at %FoundX%x%FoundY%.`nPress OK to continue.
IfMsgBox, Cancel
return
else
if Errorlevel = 1
Loop
{
SetWinDelay,-1 ;~ to make winactivate etc snappier and less obtrusive
Sleep, 500
ChromeSend("{F5}")
Sleep, 500
return
}
}
return
}
return
ChromeSend(keys){ ;keys = the keys you want to be sent e.g. "asbnd{space}lk{enter}"
if (!WinActive("ahk_class Chrome_WidgetWin_1")){
WinGetActiveTitle,currActive
WinActivate,ahk_class Chrome_WidgetWin_1
WinWaitActive,ahk_class Chrome_WidgetWin_1
}
Send, %keys%
WinActivate,%currActive% ;no need to if this since it'll be empty if chrome was active
}
Also trying to get it to pause/toggle when the image apperas, im really not gettingit
any help pleaseeeeeeeeeeeeeeeeeeee