timer - AHK script for a timed autofire function -
goal of script: continually press numpad0 10 seconds each time hotkey pressed.
current code:
toggle = 0 #maxthreadsperhotkey 2 timertoggle: toggle := !toggle sleep 10000 toggle := !toggle f12:: settimer, timertoggle, -1 while toggle{ send {numpad0} sleep 100 } return
at present, script run intended, once. attempting run again after first time nothing. missing?
your script doesn't toggle variable correctly. here cleaner version of trying uses a_tickcount
:
f12::settimer, holdnumpad, -1 holdnumpad: kdown := a_tickcount while ((a_tickcount - kdown) < 10000) { send {numpad0} sleep 100 } return
note pressing f12 while label running not have affect.
edit: made settimer use -1
period run once, mcl.
Comments
Post a Comment