没学过编程,随便乱搞的,2000点多行,但是功能还是实现了,难为我了,有没有大佬帮忙优化?
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg ==6) then--当按下鼠标6键然后
PressAndReleaseKey("b")--按下并弹起按键b
Sleep(10)--延迟20毫秒
PressAndReleaseKey("spacebar")--按下空格键
Sleep(200)
local i=math.random(1,37)--随机变量1到37
if i==1 then
PressAndReleaseKey("num0")
Sleep(10)
elseif i==2 then
PressAndReleaseKey(1)
Sleep(10)
elseif i==3 then
PressAndReleaseKey(2)
Sleep(10)
elseif i==4 then
PressAndReleaseKey(3)
Sleep(10)
elseif i==5 then
PressAndReleaseKey(4)
Sleep(10)
elseif i==6