local rapid_fire_delay = 15 -- delay between simulation of LMB press/release
local LMB_Pressed
do -- initializing PRNG
local dt = 0
for c in GetDate():gmatch"." do
dt = (dt % 65537 * 23456 + c:byte())
end
math.randomseed(dt)
end
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 2 and IsKeyLockOn("scrolllock") then -- RMB press
for j = 1, math.random(4, 5) do -- first 4-5 bullets as rapid-fire
PressMouseButton(1)
Sleep(math.random(rapid_fire_delay, 2*rapid_fire_delay))
ReleaseMouseButton(1)
Sleep(math.random(rapid_fire_delay, 2*rapid_fire_delay))
if not IsMouseButtonPressed(3) then return end -- is RMB pressed?
end
PressMouseButton(1)
LMB_Pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 and LMB_Pressed then -- RMB release
ReleaseMouseButton(1)
LMB_Pressed = false
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
repeat
Sleep(15)
PressKey("SPACEBAR")
Sleep(15)
ReleaseKey("SPACEBAR")
until not IsMouseButtonPressed(5)
end
end
这条线的for j = 1, math.random(4, 5) do
意思是“从 4 到 5 个子弹的随机数量”。
如果你想要正好 3 个项目符号将此行更改为for j = 1, 3 do
编辑:
这是关于如何使快速射击只有在LMB双击后才能打开的说明。
通常缓慢的 LMB 点击不会触发快速射击。
local Prev_LMB_Time, LMB_Pressed = 0
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
if IsKeyLockOn("scrolllock") then
local tm = GetRunningTime()
tm, Prev_LMB_Time = tm - Prev_LMB_Time, tm
if tm < 200 then -- LMB double-click
for j = 1, 100 do
PressMouseButton(1)
Sleep(1)
ReleaseMouseButton(1)
Sleep(1)
if not IsMouseButtonPressed(4) then return end
end
end
end
PressMouseButton(1)
LMB_Pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 and LMB_Pressed then
ReleaseMouseButton(1)
LMB_Pressed = false
elseif event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
repeat
Sleep(15)
PressKey("SPACEBAR")
Sleep(15)
ReleaseKey("SPACEBAR")
until not IsMouseButtonPressed(5)
end
end
目前你在 GHUB:
Primary Click = G1
Back = G4 G8
您应该在 GHUB 中做什么(按此顺序):
- 将“Primary Click”绑定到 G8(从现在开始,使用 button#8 代替 LMB)
- 将“返回”绑定到 G1
- 设置脚本
Now you should have the following:
Primary Click = G8
Back = G1 G4
鼠标按钮#8 现在是“备用 LMB”,以防 LMB 工作不正常。