I simplified this for some users and changed the keys on it for people who are used to using these keys.
I did nothing to the actual DllCall just thought I'd help ease newer people with comments saying what the key does.
Code:
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
NRA := 1
; This is your toggle button "Insert". (When ran it's automatically toggled.)
Insert::Suspend
; Clicking your left mouse button or shooting will activate your script.
~LButton::
while GetKeyState("LButton") & NRA
{
DllCall("mouse_event", uint, 1, int, 0, int, 2, uint, 0, int, 0)
Sleep, 15
DllCall("mouse_event", uint, 1, int, 0, int, 2, uint, 0, int, 0)
Sleep, 5
}
return
; Nades
~MButton::
if GetKeyState("LButton")
{
NRA := 0
Sleep, 3000
MouseClick, Left,,,,, U
NRA := 1
}
return
; Pressing "End" on your keyboard will close AutoHotKey.
End::ExitApp