Hello guys!
I need loop in that script randomly counted. Can u help me ?
#w:: Random, rand, 100, 1000 send {space down} Loop { send {w down} send {e down} send {3 down} send {3 up} } Esc::ExitApp return
Hello guys!
I need loop in that script randomly counted. Can u help me ?
#w:: Random, rand, 100, 1000 send {space down} Loop { send {w down} send {e down} send {3 down} send {3 up} } Esc::ExitApp return
I need loop in that script randomly counted.
If you mean the number of loops is random:
Loop, %rand%
Once you make kon's change, do note that when the Loop does it's 100, 1000, or anywhere in between number of times sending those keys, it will run whatever line comes after that closing bracket }
. This will be the ExitApp line with your given code.
Additionally, why do you need to keep sending w and e into down states? Once you send them down, you need to send an up stroke to release them. When you send {w down} after w is already down, it's like trying to press a key that is stuck on your keyboard. It's already there doing it's job.
I just need to hold it down, all the time, but, when i made this like "send {space down} it doesn't work.
Do you know how can i hold w, e and space all the time down and randomly clicking "3" ?
Once you make kon's change, do note that when the Loop does it's 100, 1000, or anywhere in between number of times sending those keys, it will run whatever line comes after that closing bracket
}
. This will be the ExitApp line with your given code.
Additionally, why do you need to keep sending w and e into down states? Once you send them down, you need to send an up stroke to release them. When you send {w down} after w is already down, it's like trying to press a key that is stuck on your keyboard. It's already there doing it's job.
Cleaned it up a bit. Since there's no delay between 3-down and 3-up, there's not really a point it separating them. This will send space, w, and e down, while sending 3 as fast as possible for 100-1000 iterations. Inserting a sleep would probably be better for what you want. If you want the 3 to be randomly clicked (timing), you need to sleep for rand
with Random being inside the loop.
#w:: Random, rand, 100, 1000 send {space down}{w down}{e down} Loop %rand% { send {3} ;sleep 10 } ;send {space up}{w up}{e up} return Esc::ExitApp
OS: Windows 7 Ultimate / Windows 8.1 Pro | Editor: Notepad++
I just need to hold it down, all the time,
and randomly clicking "3" ?
Taking MAsonjar13's code (note that any line that starts with a semicolon is a comment and is not an executed code)
#w:: send {space down}{w down}{e down} Loop { send {3} Random, rand, 100, 1000 sleep %rand% } ;send {space up}{w up}{e up} return Esc::ExitApp
Based on the quotes from what you said in the follow up reply, this sounded more like what you wanted.
This code will make it so repeatedly a random value of 100 through 1000 is chosen and the script will wait that many milliseconds between {3}
keystrokes. This will always hold down Space, W, and E, and then randomly send the 3 key and each lag time between {3}
keystrokes will be different than the previous.
I left that one comment line there because I made the Loop an indefinite loop - you'll only ever get it to stop when you press Esc.