Press keys at different times

Ask gaming related questions (AHK v1.1 and older)
PrimalFear
Posts: 3
Joined: 23 Apr 2017, 22:21

Press keys at different times

23 Apr 2017, 22:51

I'm fairly new to AHK.
i want to send different keys at different times with a 1 second sleep in between like

send a every x ms
sleep for 1000 ms
send b every y ms
sleep for 1000 ms
send c every z ms

and so on
User avatar
PipeDreams
Posts: 165
Joined: 19 Dec 2015, 00:20

Re: Press keys at different times

23 Apr 2017, 23:14

Replace SoundBeep, 200, 50 with the Send Command

https://autohotkey.com/docs/commands/SetTimer.htm
https://autohotkey.com/docs/Tutorial.htm#s3

Code: Select all

#Persistent

3::
Go := !Go
{	If Go
	{	SetTimer, Alert1, 1000 ;1000 = 1sec.
	} Else
	{	SetTimer, Alert1, OFF
}	} Return

Alert1:
{	SoundBeep, 200, 50
} Return

~Esc:: ;Script Kill.
{	SoundBeep, 777, 50
	ExitApp
} Exit
PrimalFear
Posts: 3
Joined: 23 Apr 2017, 22:21

Re: Press keys at different times

23 Apr 2017, 23:17

um.. i never said anything about sound and there is no soundbeep to replace
User avatar
PipeDreams
Posts: 165
Joined: 19 Dec 2015, 00:20

Re: Press keys at different times

24 Apr 2017, 01:31

PrimalFear wrote:um.. i never said anything about sound and there is no soundbeep to replace
SoundBeep is just a proof of concept, to show HOW the script works. I was referring to replacing "SoundBeep, 200, 50" to a keystroke such as "A", in the example script I gave you. That is why I provided the beginners tutorial as well. So you can learn to become self-sufficient. What you are asking for is not that difficult to learn about.
PrimalFear
Posts: 3
Joined: 23 Apr 2017, 22:21

Re: Press keys at different times

24 Apr 2017, 12:46

Ah my bad, it was late at night and I couldn't register what I was reading apparently.

I tried the script and using it a bit. It does what I want it to but the times sync up once in awhile where it sends all they keys right after each other with no delay and it doesn't register with the program. Is there a way to have a pause in between each key, I tried putting 'sleep 1000' in different places but it didn't work.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis and 33 guests