在 Origin 软件中,游戏鼠标的 LUA 脚本无法正常工作

尽管我的游戏鼠标 Logitech G502 Hero 的 Lua 脚本在 Windows 桌面、其他应用或游戏中均可正常工作,但在 Battlefield 和 Origin 应用中却无法正常工作。 自定义宏可以正常工作,但脚本不行。

有什么建议吗?或者有其他人有相同的问题吗?

谢谢!Emmanouil Filippou

这里是我尝试过的一个简单的 Lua 脚本示例,但它无法正常工作。

EnablePrimaryMouseButtonEvents(true)

function OnEvent(event, arg)
        if IsMouseButtonPressed(3)then
            repeat
                if IsMouseButtonPressed(1) then
                    repeat
                        MoveMouseRelative(0,5)
                        Sleep(33)
                    until not IsMouseButtonPressed(1)
                end
            until not IsMouseButtonPressed(3)
        end
end
点赞
用户1847592
用户1847592

您忘记插入 Sleep

EnablePrimaryMouseButtonEvents(true)

function OnEvent(event, arg)
    Sleep(20)
    if IsMouseButtonPressed(3) then
        repeat
            if IsMouseButtonPressed(1) then
                repeat
                    MoveMouseRelative(0,5)
                    Sleep(33)
                until not IsMouseButtonPressed(1)
            end
            Sleep(20)  --在此处插入了 Sleep
        until not IsMouseButtonPressed(3)
    end
end
2020-12-30 12:59:24