罗技 G502 Hero 脚本

问题描述 投票:0回答:1

我正在尝试通过 G Hub(罗技应用程序)鼠标脚本存档 Pubg Mobile Emulator 游戏中的无后坐力...当我按下开火按钮时,它应该继续开火并保持我的目标向下。我编写了一些代码来在射击时瞄准,除了 Pubg Mobile Emulator 之外,它在任何地方都可以工作。在 Pubg Mobile 模拟器中,它可以单发运行,但不能在自动射击中运行。谁能帮我解决这个问题吗?

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
                --Sleep(10)
                Sleep(10)
                MoveMouseRelative(0, 5)
            until not IsMouseButtonPressed(1)
        end
    end
end
lua scripting mouse logitech logitech-gaming-software
1个回答
0
投票

这是我完成工作的。

EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
    if IsKeyLockOn("capslock" ) and false then -- change false to true to enable
        if IsMouseButtonPressed(1) then
            repeat
                MoveMouseRelative(0,3)
                Sleep(10)
            until not IsMouseButtonPressed(1)
        end
    end
end

😁

function OnEvent(event, arg)
-- OutputLogMessage("event = %s, arg = %s\n", event, arg);
-- OutputLogMessage(""..tostring(IsMouseButtonPressed(3)).."\n")
if (event == "PROFILE_ACTIVATED") then
    EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
    ReleaseMouseButton(2) -- to prevent it from being stuck on
end

if IsKeyLockOn("capslock") and (IsMouseButtonPressed(3) or IsMouseButtonPressed(5)) then
    recoil = true
else
    recoil = false
end

if (recoil and IsMouseButtonPressed(1)) then
    multiplier = 1.00
    Sleep(10)
    repeat
        MoveMouseRelative(0, multiplier * 3)
        Sleep(10)
        MoveMouseRelative(0, multiplier * 2)
        Sleep(10)
        MoveMouseRelative(0, multiplier * 3)
        multiplier = multiplier + 0.02
        OutputLogMessage("M: %f \n", multiplier);
        Sleep(5)
    until not IsMouseButtonPressed(1)
end

结束

© www.soinside.com 2019 - 2024. All rights reserved.