有没有办法缩短这段代码?
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
PressKey ("a")
Sleep (50)
if not IsMouseButtonPressed(1) then
ReleaseKey ("a")
return
end
PressKey ("a")
Sleep (200)
if not IsMouseButtonPressed(1) then
ReleaseKey ("a")
return
end
...
next all the same with sleep values only changing
我想使用重复直到,但我不能这样做,因为睡眠的值正在改变。有没有办法将睡眠值保存在表中(即 50、200、100、75、25、200),这样我就可以在代码中使用 Repeat-Until?我一直在尝试搜索,但我是 Lua 的新手。任何帮助表示赞赏,谢谢