function OnEvent(event, arg) if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then -- 启动循环10次 for i = 1, 10 do MoveMouseTo(16557, 11189) Sleep(150) PressMouseButton(1) Sleep(150) ReleaseMouseButton(1) Sleep(150) MoveMouseTo(62193, 15185) Sleep(150) PressMouseButton(1) Sleep(150) ReleaseMouseButton(1) Sleep(150) MoveMouseTo(32729, 39653) Sleep(150) PressMouseButton(1) Sleep(150) ReleaseMouseButton(1) Sleep(150) end OutputLogMessage("操作已完成10次\n") elseif (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then -- 停止脚本,可以在这里添加停止脚本的代码 OutputLogMessage("脚本已关闭\n") endend