GHUB

--step是压枪强度,recoil的是启动判断变量
local step = 6
local recoil = false

function OnEvent(event, arg)
--日志输出,查看按键内容等
--OutputLogMessage("event = %s, arg = %d, step = %s, recoil = %s\n", event, arg, step, recoil)

--新版GHUB默认不会启用左键监听,需要启动时手动唤醒
if event == "PROFILE_ACTIVATED" then
EnablePrimaryMouseButtonEvents(true)
end

--判断你的按键,4是开关,5是还原,8是增强,7是减弱
if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
recoil = not recoil
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
step = 6
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
step = step + 2
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then
step = step - 2
end

--以下是核心触发内容,由于GHUB下SetMKeyState(3)无法触发只能换条路走了
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
repeat
Sleep(12)
MoveMouseRelative(0, step)
until not IsMouseButtonPressed(1)
end
end

 

posted @ 2023-05-14 11:07  代号-9527  阅读(168)  评论(0编辑  收藏  举报