kazie Posted August 15, 2013 Posted August 15, 2013 I want to make a macro that spams up, down, up, down,... that's simple enough to make but i want it to only execute when i hold down a key. lets say that key is w. if i hold down w, the macro will spam up, down until i let go of w.
JohnOne Posted August 15, 2013 Posted August 15, 2013 _IsPressed() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators JLogan3o13 Posted August 15, 2013 Moderators Posted August 15, 2013 Kazie, can you explain exactly what you're trying to do? Often times there are much easier ways than sending keys. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Keltset Posted August 15, 2013 Posted August 15, 2013 (edited) #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("10", $hDLL) Then ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF) ; Wait until key is released. While _IsPressed("10", $hDLL) Sleep(250) WEnd ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF) ElseIf _IsPressed("1B", $hDLL) Then MsgBox(0, "_IsPressed", "The Esc Key was pressed, therefore we will close the application.") ExitLoop EndIf Sleep(200) WEnd DllClose($hDLL) This is directly from the help file and looks like you could easily insert and function into it to simply spam the keys you are after WHILE it is pressed... Look at the line with sleep(250) Edited August 15, 2013 by Keltset -K
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now