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嵌套