Hold Right mouse button sending.

Ask gaming related questions (AHK v1.1 and older)
Sziho
Posts: 3
Joined: 21 May 2017, 11:48

Hold Right mouse button sending.

21 May 2017, 11:57

Hello,.
I am trying to write a script, that when I press and hold the right mouse button, it starts spamming 2, 3, 4 and right click.
also to ignore that I am holding down shift.

i.e.: an action rpg, where you have to hold shift to stand still, and just spam the buttons mentioned above.

So far this is my code, and it spams when I right click, but the script stops when I press shift + the Rbutton. and I need it to funcion both if shift is pressed or not.

Code: Select all

~$RButton::
    While GetKeyState("RButton","P"){
        Send {2}
		Send {3}
		Send {4}
		Click Right   
        Sleep 100  ;  milliseconds
    }
return

end::exitapp ;
Thanks for your help in advance
neomulemi6
Posts: 216
Joined: 30 Jun 2016, 06:01

Re: Hold Right mouse button sending.

21 May 2017, 21:28

The Send command automatically releases any modifier keys (shift, ctrl, alt). You need to use {Blind} like so:

Code: Select all

~$RButton::
While GetKeyState("RButton","P") {
	Send {Blind}{2}
	Send {Blind}{3}
	Send {Blind}{4}
	Click Right   
	Sleep 100  ;  milliseconds
}
return

end::exitapp ;
Sziho
Posts: 3
Joined: 21 May 2017, 11:48

Re: Hold Right mouse button sending.

23 May 2017, 10:23

thanks, it's working perfectly with

Code: Select all

*~$RButton::
While GetKeyState("RButton","P") {
	Send {Blind}{Shift}
	Send {Blind}{2}
	Send {Blind}{3}
	Send {Blind}{4}
	Click Right   
	Sleep 100  ;  milliseconds
}
return

end::exitapp ;

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 101 guests