我想创建一个简单的脚本,在罗技游戏软件中通过 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