Loop "w" while holding LeftAlt Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Gattsu
Posts: 2
Joined: 17 May 2022, 02:25

Loop "w" while holding LeftAlt

Post by Gattsu » 17 May 2022, 02:36

Hello this is my first script, I want to loop "w" every 25 ms while im holding LeftAlt, so i tried this :

Code: Select all

<!::                                                   
    While(GetKeyState("<!", "P")) {
        Send w
        Sleep 25
    }

    Return
it works if im using a key like "x" but not with Alt

Rohwedder
Posts: 7627
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Loop "w" while holding LeftAlt  Topic is solved

Post by Rohwedder » 17 May 2022, 02:58

Hallo,
try:

Code: Select all

LAlt::
While GetKeyState("LAlt", "P") {
	Send w
	Sleep 25
}
Return

Gattsu
Posts: 2
Joined: 17 May 2022, 02:25

Re: Loop "w" while holding LeftAlt

Post by Gattsu » 17 May 2022, 03:00

It works thank you

Post Reply

Return to “Gaming Help (v1)”