newbquest2 wrote:@obeeb , I'm curious what the code does. what are these thread things - could you explain your version of the code, and original OP's version -- what's happening?
Threads in Autohotkey are exlained in the documentation
Threads. I can copy paste it here or you can just go read it, if something is not clear ask.
If you are asking about what is a Thread in general, a thread of execution simply means code that your process(program) currently executes if a process has 2 threads(not relevant to Autohotkey it only simulates threads) it means that it simultaneously executes more then one piece of code(or the same code 2 times) i.e. it does 2 things at the same time.
I will explain what the code does assuming you read the documentation.
The original code sends ltfeer and then starts a loop which does nothing for the first 700 milliseconds then sends 5 until 6 seconds have passed and then sends 3 for another second and exits the loop.
If I managed to guess OP's needs correctly he wants to press w, start the loop and while it runs press w again and send l when he does that.
Autohotkey by default allows only one thread to run for each hotkey so in order to do what he wants I needed to increase it to 2 with
#MaxThreadsPerHotkey.
With the current code when you press w the first time
running is set to true and the loop starts if you press w the second time while the loop runs it will send l and return.