Logitech G502 Hero 脚本编写

我正在尝试通过 G Hub(Logitech 应用程序)鼠标脚本在 Pubg Mobile Emulator 游戏中实现无后坐力……当我按下射击按钮时,它应该继续射击并保持我的瞄准向下。我编写了一些代码来在射击时保持瞄准向下,在除了 Pubg Mobile Emulator 以外的所有地方都可以正常工作。在 Pubg Mobile Emulator 中,这适用于单发射击但不适用于自动射击。有人可以帮助我吗?

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) -- 防止卡住
    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
                --Sleep(10)
                Sleep(10)
                MoveMouseRelative(0, 5)
            until not IsMouseButtonPressed(1)
        end
    end
end
点赞
用户16899594
用户16899594

这是我的代码,可以完成任务。

EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
    if IsKeyLockOn("capslock" ) and false then -- 更改 false 为 true 以启用
        if IsMouseButtonPressed(1) then
            repeat
                MoveMouseRelative(0,3)
                Sleep(10)
            until not IsMouseButtonPressed(1)
        end
    end
end
2021-09-13 12:59:39