Loop gets stuck spamming

Ask gaming related questions
VandilFish
Posts: 6
Joined: 08 Mar 2018, 08:49

Loop gets stuck spamming

19 Mar 2018, 00:02

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!

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 20 Mar 2018, 23:52, edited 1 time in total.
VandilFish
Posts: 6
Joined: 08 Mar 2018, 08:49

Re: Loop gets stuck spamming

20 Mar 2018, 23:52

Can someone help me!
Helgef
Posts: 3226
Joined: 17 Jul 2016, 01:02
Contact:

Re: Loop gets stuck spamming

21 Mar 2018, 12:57

Similar topic here.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 21 guests