我开始学习如何使用 Logitech 软件针对不同的游戏配置文件使用 Lua 脚本。
首先我尝试使用 onevent (我知道它不是很先进)并创建了这个攻击组合脚本
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then --set flag for mb1
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then --set flag for mb1=false
mb1_pressed = false
end
end
if mb1_pressed then --using flags to determine whether to start attack or not
repeat
presskey("A")
Sleep(50)
releasekey("A")
Sleep(100)
--if MB1 is release, it will also break script. if i only tap mb1, this will only …Run Code Online (Sandbox Code Playgroud)