I want to make a script that holds down keys for a given time, 3 different actions totally, and it loops them forever. I managed to write that, it works perfectly fine. The problem is, that i cannot toggle the loop, neither break, pause it, or even exit the program. What happens is, the keys that its still holding down, keep being held down until i press them once. What I want is that one button would toggle the loop, meaning it would start it, second press would either pause, or break. I specifically want the keys to stop being held down the moment i toggle the loop. I've tried at least 5 different methods, but the keys kept being held down, even after putting SendInput {key up}, or anything similar.
I am totally a beginner, so any help would be appreciated, as I have no clue how to solve this. Here's the loop i want to toggle with one button:
Code: Select all
Loop
{
SendInput {d down}{LButton down}
sleep 122000
SendInput {d up}{a down}{LButton down}
sleep 122000
SendInput {a up}{d down}{LButton down}
sleep 130000
SendInput {d up}{LButton up}
}
[Mod action: Moved topic to v1 section since this is v1 code. The main section is for v2.]