Left Click looping after release? Please Help!

Ask gaming related questions (AHK v1.1 and older)
VandilFish
Posts: 6
Joined: 08 Mar 2018, 08:49

Left Click looping after release? Please Help!

17 Mar 2018, 04:50

The issue i'm having is sometimes when i lift the LeftMouseButton it continues to fire without pressing anything, it happen rarely but it happens. I do want it to auto fire and loop while holding down the leftMouseButton. Could anyone help me with this? Cheers!
Anyone that is able to help with this could you please explain what was wrong with it and maybe also fix it? Cheers!
PS: This is not my script, but i'm using it to help teach myself, I'm just stuck on this problem.

Code: Select all

#NoEnv
SendMode Input
 
_auto := true
 
~LButton::autofire()
~Numlock::_auto := ! _auto
~left::Suspend
 
autofire()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("LButton", "P")
{
SendInput {LButton DownTemp}
Sleep 1
mouseXY(0, 4)
Sleep 5
SendInput {LButton Up}
Sleep 25
}
else
break
} ;; loop
} ;; if
} ;; autofire()
 
mouseXY(x,y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
}
Last edited by VandilFish on 17 Mar 2018, 20:31, edited 1 time in total.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Left Click looping after release? Please Help!

17 Mar 2018, 04:56

Complimentary question what is the purpose of global _auto in the script?
Edit: Oops I mixed up the purpose of global variable I guess, but I know now.
Last edited by Nwb on 18 Mar 2018, 03:12, edited 2 times in total.
I am your average ahk newbie. Just.. a tat more cute. ;)
VandilFish
Posts: 6
Joined: 08 Mar 2018, 08:49

Re: Left Click looping after release? Please Help!

17 Mar 2018, 20:30

oh Yeah i probably should have said this isn't my script so that's also a reason i need help. I'm still learning.
Global and then _auto. _auto is auto fire, if i am correct?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 67 guests