Loop Left Click while Right click is pushed only

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
nightwolf92
Posts: 1
Joined: 26 Jun 2018, 19:53

Loop Left Click while Right click is pushed only

13 Aug 2018, 17:36

Can I get some help looping left click while right click is pressed?

I pieced this together and it 100% doesn't work.

Code: Select all

/::Suspend
  While GetKeyState("RButton","P")
  {
	LButton::
	Loop{ 
		SetMouseDelay 5
		Click 
	If (GetKeyState("LButton","P")=1)
	Break
		}
	}
Return
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Loop Left Click while Right click is pushed only

14 Aug 2018, 05:11

Hi,

You can check if this one will do its job:

Code: Select all

#SingleInstance force
#InstallMouseHook

rbutton::
while GetKeyState("rbutton", "P")
{
  while GetKeyState("lbutton", "P")
  {
    Click
    Sleep, 10
  }
}
return
Keep in mind that rbutton doesn't have an own functionality anymore.
If you still want to use rbutton alone, use

~rbutton::
Instead of:
rbutton::

While you hold rbutton and lbutton, left click gets spammed.
You can change the sleep time in case it's too fast or too slow.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, iamMG, Theda and 175 guests