无法让这个工作。第一部分是切换功能(鼠标按钮 8),它通过按下和释放鼠标按钮 1 来发挥作用。第二部分(鼠标按钮 7)只是一个“点击使用”功能。
第一部分
local enabled = false
function IsLeftNotPressed()
return not IsMouseButtonPressed(1)
end
function OnEvent(event, arg)
if (event == "PROFILE_ACTIVATED") then
OutputLogMessage("PROFILE_ACTIVATED")
EnablePrimaryMouseButtonEvents(true)
return
elseif event == "PROFILE_DEACTIVATED" then
OutputLogMessage("PROFILE_DEACTIVATED")
ReleaseMouseButton(1) -- to prevent it from being stuck on
return
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
enabled = not enabled
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and enabled) then
repeat
--Sleep(2)
MoveMouseRelative(-3, 4)
if (IsLeftNotPressed()) then return end
Sleep(16)
MoveMouseRelative(-3, 4)
if (IsLeftNotPressed()) then return end
Sleep(17)
MoveMouseRelative(-3, 4)
if (IsLeftNotPressed()) then return end
Sleep(17)
MoveMouseRelative(-3, 4)
if (IsLeftNotPressed()) then return end
Sleep(17)
MoveMouseRelative(0, 0)
until (IsLeftNotPressed())
end
end
另一种武器的秒部分
local enabled = false
function IsLeftNotPressed()
return not IsMouseButtonPressed(1)
end
function OnEvent(event, arg)
if (event == "PROFILE_ACTIVATED") then
OutputLogMessage("PROFILE_ACTIVATED")
EnablePrimaryMouseButtonEvents(true)
return
elseif event == "PROFILE_DEACTIVATED" then
OutputLogMessage("PROFILE_DEACTIVATED")
ReleaseMouseButton(1) -- to prevent it from being stuck on
return
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then
enabled = not enabled
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and enabled) then
repeat
if (IsLeftNotPressed()) then return end
Sleep(92)
MoveMouseRelative(-2, 1)
if (IsLeftNotPressed()) then return end
Sleep(7)
MoveMouseRelative(-2, 1)
if (IsLeftNotPressed()) then return end
Sleep(6)
MoveMouseRelative(-2, 0)
if (IsLeftNotPressed()) then return end
Sleep(8)
MoveMouseRelative(-2, 0)
if (IsLeftNotPressed()) then return end
Sleep(6)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
Sleep(8)
MoveMouseRelative(-1, 0)
MoveMouseRelative(0, 0)
until (IsLeftNotPressed())
end
end
最后一件武器的第三部分
local enabled = false
function IsLeftNotPressed()
return not IsMouseButtonPressed(1)
end
function OnEvent(event, arg)
if (event == "PROFILE_ACTIVATED") then
OutputLogMessage("PROFILE_ACTIVATED")
EnablePrimaryMouseButtonEvents(true)
return
elseif event == "PROFILE_DEACTIVATED" then
OutputLogMessage("PROFILE_DEACTIVATED")
ReleaseMouseButton(1) -- to prevent it from being stuck on
return
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
enabled = not enabled
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and enabled) then
repeat
if (IsLeftNotPressed()) then return end
Sleep(5)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
Sleep(5)
MoveMouseRelative(-2, -1)
if (IsLeftNotPressed()) then return end
Sleep(85)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
Sleep(5)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
Sleep(5)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
Sleep(5)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
Sleep(80)
MoveMouseRelative(-1, 0)
if (IsLeftNotPressed()) then return end
MoveMouseRelative(0, 0)
until (IsLeftNotPressed())
end
end
先感谢您。