Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.

Ask gaming related questions (AHK v1.1 and older)
fabithecrack2
Posts: 2
Joined: 27 May 2022, 09:20

Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.

Post by fabithecrack2 » 27 May 2022, 09:33

Im new to AutoHotkey and im trying to make a code that

Holds A for 3 sec
Holds D for 3 sec
Sleep for 10 seconds
Press E

And then loops. Can someone please help me?

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.

Post by mikeyww » 27 May 2022, 09:51

Welcome to this AutoHotkey forum!

Code: Select all

Loop, 2 {
 Send {a down}
 Sleep, 3000
 Send {a up}{d down}
 Sleep, 3000
 Send {d up}
 Sleep, 10000
 Send e
}

fabithecrack2
Posts: 2
Joined: 27 May 2022, 09:20

Re: Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.

Post by fabithecrack2 » 27 May 2022, 11:20

@mikeyww
Hi, thank you for this, it helped me quite a lot. However, what i need is something that simulates holding a and d. In the code you sent me, it only presses it once. I need it to move me in-game. Thank you!

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.

Post by mikeyww » 27 May 2022, 12:10

More ideas.

Code: Select all

Loop, 2 {
 end := A_TickCount + 3000
 While (A_TickCount < end)
  Send {a down}
 Send {a up}
 end := A_TickCount + 3000
 While (A_TickCount < end)
  Send {d down}
 Send {d up}
 Sleep, 10000
 Send e
}

Post Reply

Return to “Gaming Help (v1)”