Help with this code pls

Ask gaming related questions (AHK v1.1 and older)
loadness
Posts: 1
Joined: 25 May 2022, 04:07

Help with this code pls

Post by loadness » 25 May 2022, 04:15

Hi, i have this code to send a series of keys on press and wait for right click. what i want is to wait for two keys at the same time, right click and left click to trigger the macro. how could i modify it to do that?

Code: Select all

#IfWinActive GTA:SA:MP
#SingleInstance, Force
#InstallMouseHook
#InstallKeybdHook
SetBatchLines -1

~$*RButton::

Loop
{
GetKeyState, RMB, RButton
If RMB=D
{
Keywait, Rbutton
sleep 50
Send, {Wheeldown}
sleep 50
Send, {c down}
sleep 5
Send, {c up}
sleep 5
Send, {Wheelup}
sleep 50
Send, {Wheeldown}
Sleep 50
}
}

#IfWinActive
F2::Pause

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

Re: Help with this code pls

Post by mikeyww » 25 May 2022, 05:16

Welcome to this AutoHotkey forum!

Press RButton first.

Code: Select all

RButton::RButton
RButton & LButton::
While GetKeyState("RButton", "P") & GetKeyState("LButton", "P") {
 Send x
 Send y
}
Return
Explained: Custom combinations

Post Reply

Return to “Gaming Help (v1)”