How do send LAlt+Q in a parse statement?

Ask gaming related questions (AHK v1.1 and older)
jayblah
Posts: 13
Joined: 17 Oct 2016, 10:20

How do send LAlt+Q in a parse statement?

Post by jayblah » 14 May 2022, 23:53

Code: Select all

winTitle = ahk_exe gameprocess.exe
#MaxThreadsPerHotkey 2
#If WinActive(winTitle)
F1::
on := !on
SetKeyDelay, 110
While on
 Loop, Parse, % "qrd"
  Send % on ? A_LoopField : ""
Return
#If
I'd like to send LAlt+Q instead of just Q in this code: " Loop, Parse, % "qrd"

How do I do that? I assume Loop, Parse, % "!qrd" will not work? Also, what exactly is the code on line 9 (Send % on ? A_LoopField : "") doing?

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

Re: How do send LAlt+Q in a parse statement?

Post by Rohwedder » 15 May 2022, 02:42

Hallo,
try:

Code: Select all

winTitle = ahk_exe gameprocess.exe
#MaxThreadsPerHotkey 2
#If WinActive(winTitle)
F1::
on := !on
SetKeyDelay, 110
While on
	Loop, Parse,% "<!q", CSV
		Send % on ? A_LoopField : ""
Return
#If
or with the line:

Code: Select all

Loop, Parse,% "{LAlt Down},q,{LAlt Up}", CSV
This line with Ternary operator

Code: Select all

Send % on ? A_LoopField : ""
corresponds to:

Code: Select all

IF on
	Send % A_LoopField
Else
	Send % ""
https://www.autohotkey.com/docs/Variables.htm#ternary

Post Reply

Return to “Gaming Help (v1)”