Page 1 of 1

Script for autofire

Posted: 23 Aug 2017, 04:55
by jacohawk
I'm trying to make a simple script that autofires (press LButton) only while holding RButton.
So, if I press LButton nothing happens, but if I press RButton and then LButton it autofires.
Can Anyone help me? :)

I have this script that works while LButton is holding:

Code: Select all

~$*LButton::			; Fires Automaticly when Autofire is on.
		if V_AutoFire = 1
	{
		Loop
	{
		GetKeyState, LButton, LButton, P
		if LButton = U
			Break
		MouseClick, Left,,, 1
		Gosub, RandomSleep
	}
	}
	Return 

Re: Script for autofire

Posted: 27 Aug 2017, 08:48
by Reloaded
Hi! :D

Code: Select all

#MaxThreadsperHotkey 2
RButton:: ;Here can you change which key it will toggle.
toggle := !Toggle
loop
{
if toggle
{
Click, X%xpos% Y%ypos%.
}

else
	break
}
return
I make a toggle, so you make right click and it make rapid fire Clicking by your mouse position and if you want stop it click again right button

Re: Script for autofire

Posted: 03 Sep 2017, 00:11
by SvenBent

Code: Select all

#if GetKeyState("ScrollLock","T")

LButton::
SetTimer MouseSpam, 99
Return

LButton up::
SetTimer MouseSpam, off
Return

#if

MouseSpam:
Click
Return
this just make the left mouse button have aturbo mode if scroll lock is activated
modify as you see fit

Re: Script for autofire

Posted: 03 Sep 2017, 14:55
by Reloaded
SvenBent wrote:

Code: Select all

#if GetKeyState("ScrollLock","T")

LButton::
SetTimer MouseSpam, 99
Return

LButton up::
SetTimer MouseSpam, off
Return

#if

MouseSpam:
Click
Return
this just make the left mouse button have aturbo mode if scroll lock is activated
modify as you see fit

This dont Work

Re: Script for autofire

Posted: 06 Oct 2017, 20:42
by SvenBent
Reloaded wrote:
SvenBent wrote:

Code: Select all

#if GetKeyState("ScrollLock","T")

LButton::
SetTimer MouseSpam, 99
Return

LButton up::
SetTimer MouseSpam, off
Return

#if

MouseSpam:
Click
Return
this just make the left mouse button have aturbo mode if scroll lock is activated
modify as you see fit

This dont Work

Works perfectly. you must be doing something wrong.

Re: Script for autofire

Posted: 06 Oct 2017, 22:29
by Xtra

Code: Select all

~RButton::AutoFire := 1
~RButton Up::AutoFire := 0

#If (AutoFire)
LButton::
    while GetKeyState("LButton","P")
    {
        Click
        RandomSleep()
    }
return
#If

RandomSleep(min:=20,max:=70)
{
    Random, rnd, min, Max
    Sleep rnd
}
HTH