Code: Select all
XButton1_QuickPress:
If (IsSuspended)
Return
ImagePath := A_MyDocuments "\autoHotkey_green_dragon_working.png" ; Silence.
; Store original mouse position
MouseGetPos, OrigX, OrigY
; Loop to check for image twice
Loop, 2
{
FoundX := FindClick(ImagePath, "o80", "n0")
if (FoundX)
{
Tooltip, Image Found! Clicking Image ; Leftover error-checking.
; Click, %FoundX% ; This is what I would use if I wanted to click the image that the image search found but I disabled it because I needed to send a keyboard command
Sleep, 100
;Send {NumpadDiv} ; Send slash key on the number pad
Sleep, 100
; Return mouse to original position
MouseMove, %OrigX%, %OrigY%
break ; Exit the loop as the image has been found and action has been taken
}
Sleep, 250 ; Wait for 500 milliseconds before checking again
}
; Proceed with quick press code even if image not found
ToolTip, ===> Activate Whisperer <===
SetTimer, ClearToolTip, -500
; Send {Alt Down}{Shift Down}{;}
Send {F24 Down}
Sleep 50
KeyWait XButton1
;Send {Alt Up}{Shift Up}
Send {F24 Up}
SoundBeep 1000
Return