AHK Script starts to lag

Ask gaming related questions
H_pro1
Posts: 6
Joined: 24 May 2020, 10:40

AHK Script starts to lag

Post by H_pro1 » 23 Sep 2020, 09:33

My current auto clicker code is following;

Code: Select all

F2:: 
toggle := !toggle
return

#If (Toggle)
	
While, toggle
{
	LButton::
    		Click 2
		while (GetKeyState("Lbutton", "P")) {
        		Click 2
    		}
	return

	RButton::
    		Click 2
		while (GetKeyState("Rbutton", "P")) {
        		Click 2
    		}
	return	
}
return

#If
So when either of the mouse buttons is pressed, it double clicks and while the button is pressed, it keeps double clicking. The issue is, if I keep pressing the mouse, the mouse itself starts to lag, and windows starts to beep. Is there any kind of fix for this?

User avatar
Yakshongas
Posts: 591
Joined: 21 Jan 2020, 08:41
Facebook: Yakshongas

Re: AHK Script starts to lag

Post by Yakshongas » 23 Sep 2020, 09:58

Code: Select all

F2::Toggle := !Toggle


#If (Toggle = 1)
	LButton::
	    while (GetKeyState("Lbutton", "P")
        {
            Click 2
	    }
	return

	RButton::
    	While (GetKeyState("Rbutton", "P")
        {
            Click 2
        }
	return	
#If
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹

Post Reply

Return to “Gaming”