Page 1 of 1

Hold 1 key down

Posted: 18 Nov 2016, 23:08
by H4TE
Sorry guys. I've googled for over 2 hours, and not a single "hold key down" script works out of the 30-40 i've tried.... "Send {space down}" does not work.

What I am trying to do, is simply hold 1 key down, non stop so it auto-loots aka picks up what ever I am doing in game. Until I turn the damn thing off :lolno:

Re: Hold 1 key down

Posted: 18 Nov 2016, 23:37
by H4TE
Finally found one that works. Sorry... After that long search lol. If anyone else comes across this issue...

#MaxThreadsPerHotkey 2

Toggle := !Toggle
while Toggle
Send, {space Down}
Sleep, 50
Send, {space Up}

F2 will toggle spacebar spam.

Re: Hold 1 key down

Posted: 19 Nov 2016, 17:14
by hugin
It should be tons of scripts and code out there to fit the need for what you are trying to achieve :)

What you have found is a basic toggle script and are to find all over the Interwebz, including the old and the new site of AHK.
Many times, especially when new to a subjects like AHK, it can be hard to know what too look for, so here is a link to a small repository of useful starter scripts that can be handy to learn and implement in to your scripts. It might not be exact what you are looking for in term of what your goal is, but it is a good start for sure.
It also include your findings for the toggle script.

Good luck!