首页 > 解决方案 > 尝试在 Lua 脚本上调用 nil 值

问题描述

我想创建一个简单的脚本,在罗技游戏软件中通过 Lua 不断单击鼠标左键。但是,它一直在“EnablePrimaryMouseButtonEvents (true)”行上说“尝试调用 nil 值”这是我的脚本:

EnablePrimaryMouseButtonEvents (true)

function OnEvent(event, arg)
  if IsKeyLockOn("scrolllock") then
    if IsMouseButtonPressed(1) then
      repeat
        PressMouseButton(1)
        Sleep(15)
      until not IsMouseButtonPressed(1)
    end
  end
end

标签: lualogitech-gaming-software

解决方案


推荐阅读