Script with image recognition

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Z3r0inyourworld
Posts: 1
Joined: 30 Jan 2023, 16:13

Script with image recognition

Post by Z3r0inyourworld » 30 Jan 2023, 16:57

So I've been meaning to make a script with different spam hotkeys running at different times, along with image recognition. I tried various ways but they didn't work.

My idea so far was

Code: Select all

#IfWinNotActive window1.exe

SendInput {Hotkey1, off}
SendInput {Hotkey2} (spam)

#IfWinActive ahk.exe window1.exe

SendInput {Hotkey2, Off}

(image 1 or 2 recognized) = SendInput {Hotkey3} (single use)
Sleep 100
SendInput {Hotkey4} (spam)
SendInput {Hotkey4, Off} (after 12m, or 720000ms)
sleep 100
SendInput {Hotkey5} (single use)
Sleep 100
SendInput {Hotkey1} (spam)

return
This whole thing but in a loop. The way I managed to make my spam hotkeys work so far was through toggles, but I'd like them to activate automatically. This was the toggle I use:

Code: Select all

*f2::
    toggle := !toggle
    if (toggle) {
        SetTimer, HotKey1, 1
    } else {
        SetTimer, HotKey1, Off
    }
return
Any help or resources to move in the right direction will be deeply appreciated.

Return to “Ask for Help (v1)”