Mouse Right Hold + Left Click

Ask gaming related questions (AHK v1.1 and older)
Samson2
Posts: 3
Joined: 09 Jun 2021, 05:32

Mouse Right Hold + Left Click

09 Jun 2021, 05:41

Hello friends.

I'm looking for the following script (if possible).

I need an "autoclicker" for the left mouse button. However, this should only be activated if the right mouse button is held. If possible with an adjustable delay on the left mouse button and an "Off" button (insert button).

I would be very happy. :)

My Basic-Script:

Code: Select all

Insert::
  Hotkey, LButton, Toggle
  Hotkey, LButton Up, Toggle
Return
LButton::
  Loop
  {
     If (Stop)
        Break
     Send {lbutton}
  }
  Stop := 0
Return
LButton Up::Stop := 1
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

Re: Mouse Right Hold + Left Click

09 Jun 2021, 17:11

Hi try this

Code: Select all

Delay := 500 ;1000 ms = 1 second

*Insert::
RB_Toggle := !RB_Toggle
SoundBeep, % (RB_Toggle ? 2000 : 600)
return

#if RB_Toggle ; and WinActivate("ahk_exe notepad.exe")

~*RButton::
Loop {
	SendInput, {LButton Down}
	Sleep, 62
	SendInput, {LButton Up}
	Sleep, % Delay
}until !GetKeyState("RButton","P")
return

#if
:wave: There is always more than one way to solve a problem. ;)
Samson2
Posts: 3
Joined: 09 Jun 2021, 05:32

Re: Mouse Right Hold + Left Click

09 Jun 2021, 17:35

That's good but ... I want to hold down the left mouse button and let it "click". As if I were clicking myself, only that I hold it down.

Thank you for your support.
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

Re: Mouse Right Hold + Left Click

09 Jun 2021, 17:47

this on send clicks when holding bouth Right and Left

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Delay := 200 ;1000 ms = 1 second

*Insert::
RB_Toggle := !RB_Toggle
SoundBeep, % (RB_Toggle ? 2000 : 600)
return

#if RB_Toggle ; and WinActivate("ahk_exe notepad.exe")

~*RButton::
LB_Toggle := 1
return

~*RButton up::
LB_Toggle := 0
return
#if LB_Toggle ; and WinActivate("ahk_exe notepad.exe")

~*LButton::
Loop {
	SendInput, {LButton Down}
	Sleep, 62
	SendInput, {LButton Up}
	Sleep, % Delay
	if !GetKeyState("RButton","P")
		break
}until !GetKeyState("LButton","P")
return

#if
and this one just hold Left

Code: Select all

Delay := 200 ;1000 ms = 1 second

*Insert::
LB_Toggle := !LB_Toggle
SoundBeep, % (LB_Toggle ? 2000 : 600)
return

#if LB_Toggle ; and WinActivate("ahk_exe notepad.exe")

~*LButton::
Loop {
	SendInput, {LButton Down}
	Sleep, 62
	SendInput, {LButton Up}
	Sleep, % Delay
	if !LB_Toggle
		break
}until !GetKeyState("LButton","P")
return

#if
:wave: There is always more than one way to solve a problem. ;)
Samson2
Posts: 3
Joined: 09 Jun 2021, 05:32

Re: Mouse Right Hold + Left Click

09 Jun 2021, 18:26

The second is almost perfect, but it should only work if the right mouse button is held. So when I'm in scope.

Thank you so much for the effort!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 26 guests