主要实现是 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