From af24208cf310289c36d0c600d0d2523678d4cd98 Mon Sep 17 00:00:00 2001 From: DLmaster Date: Sat, 26 Oct 2024 15:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E5=91=BD=E4=BB=A4=E8=A1=8C=E4=B8=AD?= =?UTF-8?q?=E6=AD=A2MAA=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTO_MAA.py | 21 ++++++++++++++++++--- 更新说明.txt | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/AUTO_MAA.py b/AUTO_MAA.py index ca867d5..90f83ac 100644 --- a/AUTO_MAA.py +++ b/AUTO_MAA.py @@ -220,7 +220,12 @@ class MaaRunner(QtCore.QThread): "\n".join([self.data[_][0] for _ in error_index]), result, ) - os.system("taskkill /F /T /PID " + str(maa.pid)) + killprocess = subprocess.Popen( + "taskkill /F /T /PID " + str(maa.pid), + shell=True, + creationflags=subprocess.CREATE_NO_WINDOW, + ) + killprocess.wait() self.push_notification.emit( "用户日常代理出现异常!", "用户 " @@ -322,7 +327,12 @@ class MaaRunner(QtCore.QThread): "\n".join([self.data[_][0] for _ in error_index]), result, ) - os.system("taskkill /F /T /PID " + str(maa.pid)) + killprocess = subprocess.Popen( + "taskkill /F /T /PID " + str(maa.pid), + shell=True, + creationflags=subprocess.CREATE_NO_WINDOW, + ) + killprocess.wait() if_strat_app = True if self.if_run: time.sleep(10) @@ -387,7 +397,12 @@ class MaaRunner(QtCore.QThread): if self.mode in ["日常代理", "人工排查"]: # 关闭可能未正常退出的MAA进程 if not self.if_run: - os.system("taskkill /F /T /PID " + str(maa.pid)) + killprocess = subprocess.Popen( + "taskkill /F /T /PID " + str(maa.pid), + shell=True, + creationflags=subprocess.CREATE_NO_WINDOW, + ) + killprocess.wait() # 更新用户数据 modes = [self.data[_][15] for _ in all_index] uids = [self.data[_][16] for _ in all_index] diff --git a/更新说明.txt b/更新说明.txt index d3fb1fc..6772526 100644 --- a/更新说明.txt +++ b/更新说明.txt @@ -7,6 +7,7 @@ v4.0_beta ## 程序优化 - 进一步优化MAA配置流程 - 优化自定义基建配置方法 #7 +- 无命令行窗口中止MAA进程 - `gameid.txt`改由主程序进行初始化 - log获取部分集成为1个函数 - 消除部分if嵌套