本文主要是介绍罗技鼠标lua脚本随机按键输出,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
没学过编程,随便乱搞的,2000点多行,但是功能还是实现了,难为我了,有没有大佬帮忙优化?
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg ==6) then--当按下鼠标6键然后PressAndReleaseKey("b")--按下并弹起按键bSleep(10)--延迟20毫秒PressAndReleaseKey("spacebar")--按下空格键Sleep(200)local i=math.random(1,37)--随机变量1到37if i==1 thenPressAndReleaseKey("num0")Sleep(10)elseif i==2 thenPressAndReleaseKey(1)Sleep(10)elseif i==3 thenPressAndReleaseKey(2)Sleep(10)elseif i==4 thenPressAndReleaseKey(3)Sleep(10)elseif i==5 thenPressAndReleaseKey(4)Sleep(10) elseif i==6 thenPressAndReleaseKey(5)Sleep(10)elseif i==7 thenPressAndReleaseKey(6)Sleep(10) elseif i==8 thenPressAndReleaseKey(2)Sleep(10)elseif i==9 thenPressAndReleaseKey(8)Sleep(10) elseif i==10 thenPressAndReleaseKey(9)Sleep(10)elseif i==11 thenPressAndReleaseKey("a")Sleep(10) elseif i==12 thenPressAndReleaseKey("b")Sleep(10)elseif i==13 thenPressAndReleaseKey("c")Sleep(10) elseif i==14 thenPressAndReleaseKey("d")Sleep(10)elseif i==15 thenPressAndReleaseKey("e")Sleep(10) elseif i==16 thenPressAndReleaseKey("f")Sleep(10)elseif i==17 thenPressAndReleaseKey("g")Sleep(10) elseif i==18 thenPressAndReleaseKey("h")Sleep(10)elseif i==19 thenPressAndReleaseKey("i")Sleep(10) elseif i==20 thenPressAndReleaseKey("j")Sleep(10)elseif i==21 thenPressAndReleaseKey("k")Sleep(10) elseif i==22 thenPressAndReleaseKey("l")Sleep(10)elseif i==23 thenPressAndReleaseKey("m")Sleep(10) elseif i==24 thenPressAndReleaseKey("n")Sleep(10)elseif i==25 thenPressAndReleaseKey("o")Sleep(10) elseif i==26 thenPressAndReleaseKey("p")Sleep(10)elseif i==27 thenPressAndReleaseKey("q")Sleep(10) elseif i==28 thenPressAndReleaseKey("r")Sleep(10)elseif i==29 thenPressAndReleaseKey("s")Sleep(10) elseif i==30 thenPressAndReleaseKey("d")Sleep(10)elseif i==31 thenPressAndReleaseKey("t")Sleep(10) elseif i==32 thenPressAndReleaseKey("u")Sleep(10)elseif i==33 thenPressAndReleaseKey("v")Sleep(10) elseif i==34 thenPressAndReleaseKey("w")Sleep(10)elseif i==35 thenPressAndReleaseKey("x")Sleep(10) elseif i==36 thenPressAndReleaseKey("y")Sleep(10)elseif i==37 thenPressAndReleaseKey("z")Sleep(20) end
-- OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
这一段多复制粘贴几次,就多出几次随机按键,
我一下子复制粘贴搞到2000多行
循环语句不会用纯小白
哈哈
到最后功能还是实现了
看看结果
这篇关于罗技鼠标lua脚本随机按键输出的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!