Hello,
I have a very simple script that goes like this.
$1:: ;
send {8}
send {f}
send {-}
send {0}
send {z}
return
This basically sends 8f-0z when i press 1. I use this is a game and i think the game has a problem with recognizing that many keys sent at the same time which messes up my macro. Is there a way i can add a miniscule, say 30 ms, delay between these keys?
Like this
$1:: ;
send {8}
30 ms delay
send {f}
30 ms delay
send {-}
30 ms delay
send {0}
30 ms delay
send {z}
return
I'm totally new to scripting and any help would be most appreciated.
Thanks
Adding a delay between keystrokes
Started by
Khalayne
, Feb 06 2012 12:48 AM
3 replies to this topic
#1
-
Posted 06 February 2012 - 12:48 AM
You should read about the Sleep command:
sleep, 30
#2
-
Posted 06 February 2012 - 03:26 AM
"My dear Mr Gyrth, I am never more serious than when I am joking."
~Albert Campion
-----------------------------------------------------------------------------------------------
Website | Demo scripts | Blog | External contact
~Albert Campion
-----------------------------------------------------------------------------------------------
Website | Demo scripts | Blog | External contact
It is possible it will still not be enough. Using Send and sleep was sometimes inreliable for me in busy fullscreen application (game). What helped me was this:
SetKeyDelay , 30, 30 ; first is delay between keypresses, and second is press duration ; we are using ControlSend here because Send and SendInput is not affected by SetKeyDelay. $1:: ControlSend, , 8, A ControlSend, , f, A ControlSend, , -, A ControlSend, , 0, A ControlSend, , z, A ReturnReferences: SetKeyDelay, ControlSend
#3
-
Posted 06 February 2012 - 08:35 AM
Whenever someone says "pls" because it is shorter than "please", I say "no" because it is shorter than "yes"
Awesome, thanks for a quick reply!
I'll give this a shot
I'll give this a shot
#4
-
Posted 06 February 2012 - 03:51 PM