游戏鼠标上的 LUA 脚本在 Origin 软件中不起作用

问题描述

即使我的游戏鼠标 Logitech G502 Hero 的 Lua 脚本在 Windows 桌面或我尝试的每个应用程序或游戏中都能正常工作,但它们在战地和 Origin 应用程序上不起作用。 自定义宏有效,但脚本无效。

有什么想法吗?或者其他人有同样的问题?

谢谢!埃马努伊·菲利波

这是一个我尝试过但不起作用的简单 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

解决方法

您忘记插入 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             
        until not IsMouseButtonPressed(3)
    end     
end