From fb27c50c7518556b9e22889748b8a8748e1389e1 Mon Sep 17 00:00:00 2001 From: DLmaster Date: Sat, 9 Nov 2024 11:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3log=5Ftext=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84log=E6=98=BE=E7=A4=BA=E4=BA=8E?= =?UTF-8?q?=E4=B8=AD=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTO_MAA.py | 66 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/AUTO_MAA.py b/AUTO_MAA.py index 1d28b11..51fce77 100644 --- a/AUTO_MAA.py +++ b/AUTO_MAA.py @@ -185,17 +185,30 @@ class MaaRunner(QtCore.QThread): # 合并日志 log = "".join(logs) # 更新MAA日志 - self.update_gui.emit( - self.data[index][0] - + "_第" - + str(i + 1) - + "次_" - + mode_book[j][5:7], - "\n".join([self.data[_][0] for _ in wait_index]), - "\n".join([self.data[_][0] for _ in over_index]), - "\n".join([self.data[_][0] for _ in error_index]), - log, - ) + if len(logs) > 10000: + self.update_gui.emit( + self.data[index][0] + + "_第" + + str(i + 1) + + "次_" + + mode_book[j][5:7], + "\n".join([self.data[_][0] for _ in wait_index]), + "\n".join([self.data[_][0] for _ in over_index]), + "\n".join([self.data[_][0] for _ in error_index]), + "".join(logs[-10000:]), + ) + else: + self.update_gui.emit( + self.data[index][0] + + "_第" + + str(i + 1) + + "次_" + + mode_book[j][5:7], + "\n".join([self.data[_][0] for _ in wait_index]), + "\n".join([self.data[_][0] for _ in over_index]), + "\n".join([self.data[_][0] for _ in error_index]), + "".join(logs), + ) # 判断MAA程序运行状态 result = self.if_maa_success(log, mode_book[j]) if result == "Success!": @@ -307,13 +320,30 @@ class MaaRunner(QtCore.QThread): # 合并日志 log = "".join(logs) # 更新MAA日志 - self.update_gui.emit( - self.data[index][0], - "\n".join([self.data[_][0] for _ in wait_index]), - "\n".join([self.data[_][0] for _ in over_index]), - "\n".join([self.data[_][0] for _ in error_index]), - log, - ) + if len(logs) > 10000: + self.update_gui.emit( + self.data[index][0] + + "_第" + + str(i + 1) + + "次_" + + mode_book[j][5:7], + "\n".join([self.data[_][0] for _ in wait_index]), + "\n".join([self.data[_][0] for _ in over_index]), + "\n".join([self.data[_][0] for _ in error_index]), + "".join(logs[-10000:]), + ) + else: + self.update_gui.emit( + self.data[index][0] + + "_第" + + str(i + 1) + + "次_" + + mode_book[j][5:7], + "\n".join([self.data[_][0] for _ in wait_index]), + "\n".join([self.data[_][0] for _ in over_index]), + "\n".join([self.data[_][0] for _ in error_index]), + "".join(logs), + ) # 判断MAA程序运行状态 result = self.if_maa_success(log, "人工排查") if result == "Success!":