Holding multiple keys for pre-defined time

Ask gaming related questions (AHK v1.1 and older)
YaBoiJB
Posts: 1
Joined: 19 Apr 2021, 19:00

Holding multiple keys for pre-defined time

19 Apr 2021, 19:16

Hello, I'm looking for help with a script which will hold A + Left Mouse Down for a set amount of time, then hold W for a set time, then D + Left Mouse Down for a set time, then W for a set time and then loop this process so long as a single key is held down.

I would greatly appreciate any advice, thank you in advance for your time.
User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: Holding multiple keys for pre-defined time

19 Apr 2021, 19:46

Code: Select all

F3::
SoundBeep, 1500
While GetKeyState("F3", "P") {
 If GetKeyState("F3", "P")
  hold(2000, "a", "LButton")
 If GetKeyState("F3", "P")
  hold(2000, "w")
 If GetKeyState("F3", "P")
  hold(2000, "d", "LButton")
 If GetKeyState("F3", "P")
  hold(2000, "w")
}
SoundBeep, 1000
Return

hold(wait, keys*){
 For index, key in keys
  Send {%key% down}
 Sleep, wait
 For index, key in keys
  Send {%key% up}
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 49 guests