我试图在使用 Lua 的 Logitech GHUB 中制作一个自动点击器脚本。我尝试了很多变体,但我总是遇到语法错误。我以前没有编码经验。
代码的要点是,当我按住 P 时,鼠标反复单击并等待这些单击之间的随机间隔。还计划在新闻和发布之间进行间隔。
EnablePrimaryMouseEvents(true)
function OnEvent(event, arg)
--OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
if IsKeyPressed("P") then
repeat
PressMouseButton(1)
ReleaseMouseButton(1)
Sleep(math.random(29, 36))
PressMouseButton(1)
ReleaseMouseButton(1) ---- Syntax Error(Show up almost everywhere when I change the code)
until not IsKeyPressed("P") then
end