1

我正在编写一个反冲脚本,我希望能够使用左键和右键单击来激活它。这就是我到目前为止所拥有的。我想使用 mb1 和 mb2 使其工作,而不仅仅是 mb1。

function OnEvent(event, arg)
  OutputLogMessage("event = %s, arg = %d\n", event, arg)
  if (event == "PROFILE_ACTIVATED") then
    EnablePrimaryMouseButtonEvents(true)
  elseif event == "PROFILE_DEACTIVATED" then
    ReleaseMouseButton(2) -- to prevent it from being stuck on
  end
  if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
    recoil = not recoil
    spot = not spot
  end
  if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
    if recoil then
      repeat
        MoveMouseRelative(-2, 5)
        Sleep(10)
        MoveMouseRelative(2, -5)
        Sleep(21)
      until not IsMouseButtonPressed(1)
    end
  end
end
4

0 回答 0