相关文章推荐
欢快的青蛙  ·  node.js - Why PM2 can ...·  11 月前    · 
腼腆的松球  ·  ora 06575-掘金·  1 年前    · 
_RPG_
粉丝: 375 文章: 6

主要实现是 match.random(a,b)

function OnEvent(event, arg)

--OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")

if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then

bool = not bool

OutputLogMessage("bool= %s \n  ", bool)

end


if (event == "MOUSE_BUTTON_PRESSED" and IsKeyLockOn("capslock")) then

OutputLogMessage("OPENKEY= %s \n  ", IsKeyLockOn("capslock"))

if(  bool ) then

repeat

--random1

random1 = math.random(0, 100)

--random2

random2 = math.random(0, 100)

--核心执行

Sleep(random1)

PressAndReleaseKey("1")

Sleep(random2)

OutputLogMessage("random1=%s\n random2=%s\n ", random1, random2)

until not IsKeyLockOn("capslock")

bool =false

OutputLogMessage("bool = %s \n  ", bool)

end

end

if (event == "MOUSE_BUTTON_PRESSED" and not IsKeyLockOn("capslock") and bool ==false ) then

OutputLogMessage("CLOSE= %s \n  ", IsKeyLockOn("capslock"))

end

end


投诉或建议
1.罗技语法
if (Boolean) then--操作dowhile boolean do--操作endfor i=1,10 doendrepeat--循环体until Booleanfunction aaa()--caozuoend--mainfunction OnEvent(event, arg)--调用aaa自定义函数aaa()end