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?
Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.
-
- 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.
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
}
-
- 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.
@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!
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!
Re: Trying to make a code for a game that will hold A for 3 seconds, then D for 3 seconds.
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
}