Please help with button spamming
Posted: 18 Apr 2018, 18:20
Hi Guys, I don't understand AHK scripting at all, i've read quite a few of other peoples posts and cut and copped bits form a few to try and make what i GUESS is a script that i want?
Can someone please check it and fix it for me? lol
I want the script to work like this, if Diablo is the ACTIVE window then run the commands, if i click out of the window to my 2nd screen (which happens quite often, pause until the window is active again...eg i click back into it, then continue spamming the buttons without having to repress F2)
F2 starts the script and spam clicks "w" and "a" keys until F2 is pressed again. i'm not sure what the settimer 50 is, i assume 50ms per click? i think maybe i should change that to 150 or so?
#MaxThreadsPerHotkey, 2
SetTitleMatchMode, 2
DetectHiddenWindows, On
#If (WinActive("Diablo"))
return
sendkey() {
send w
send a
}
f2::
toggle := !toggle
settimer sendkey, % toggle ? "50" : "off"
return
#if
Can someone please check it and fix it for me? lol
I want the script to work like this, if Diablo is the ACTIVE window then run the commands, if i click out of the window to my 2nd screen (which happens quite often, pause until the window is active again...eg i click back into it, then continue spamming the buttons without having to repress F2)
F2 starts the script and spam clicks "w" and "a" keys until F2 is pressed again. i'm not sure what the settimer 50 is, i assume 50ms per click? i think maybe i should change that to 150 or so?
#MaxThreadsPerHotkey, 2
SetTitleMatchMode, 2
DetectHiddenWindows, On
#If (WinActive("Diablo"))
return
sendkey() {
send w
send a
}
f2::
toggle := !toggle
settimer sendkey, % toggle ? "50" : "off"
return
#if