1) the whole thing doesn't actually work - I launch the .AHK, press F5 with Notepad open and nothing happens when it should be sending W until F5 is pressed again or Esc is pressed.
2) I get errors saying that using Send, {w down} can't happen when it should? I would like to replace the generic W with this and have a up version before the break
3) I want to make it so that any key can be pressed to turn off the script however I can't seem to find anything related to this - is this not possible with AHK?
Code:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
#IfWinActive, ahk_exe Notepad.exe
F5::
if Running
{
Running := false
Return
}
Running := true
Loop {
Send, w
if not Running
Break
}
Running := false
return
Esc::
ExitApp
[Mod action: Moved topic to “Gaming”]