feat: 设置脚本时不再检测脚本运行状态,由用户手动保存
This commit is contained in:
@@ -76,7 +76,6 @@ class _TaskManager:
|
||||
if task_id in self.task_dict or (
|
||||
actual_id is not None and actual_id in self.task_dict
|
||||
):
|
||||
|
||||
raise RuntimeError(f"任务 {task_id} 已在运行")
|
||||
|
||||
logger.info(f"创建任务: {task_id}, 模式: {mode}")
|
||||
|
||||
@@ -862,15 +862,10 @@ class MaaManager:
|
||||
# 创建MAA任务
|
||||
logger.info(f"启动MAA进程: {self.maa_exe_path}")
|
||||
await self.maa_process_manager.open_process(self.maa_exe_path, [], 0)
|
||||
# 记录当前时间
|
||||
self.log_start_time = datetime.now()
|
||||
|
||||
# 监测MAA运行状态
|
||||
self.log_check_mode = "设置脚本"
|
||||
await self.maa_log_monitor.start(self.maa_log_path, self.log_start_time)
|
||||
# 等待用户完成配置
|
||||
self.wait_event.clear()
|
||||
await self.wait_event.wait()
|
||||
await self.maa_log_monitor.stop()
|
||||
|
||||
async def result_record(self):
|
||||
"""记录用户结果信息"""
|
||||
@@ -1297,15 +1292,6 @@ class MaaManager:
|
||||
else:
|
||||
self.maa_result = "Wait"
|
||||
|
||||
elif self.mode == "设置脚本":
|
||||
if (
|
||||
"MaaAssistantArknights GUI exited" in log
|
||||
or not await self.maa_process_manager.is_running()
|
||||
):
|
||||
self.maa_result = "Success!"
|
||||
else:
|
||||
self.maa_result = "Wait"
|
||||
|
||||
logger.debug(f"MAA 日志分析结果: {self.maa_result}")
|
||||
|
||||
if self.maa_result != "Wait":
|
||||
|
||||
@@ -529,16 +529,10 @@ class GeneralManager:
|
||||
60 if self.script_config.get("Script", "IfTrackProcess") else 0
|
||||
),
|
||||
)
|
||||
# 记录当前时间
|
||||
self.log_start_time = datetime.now()
|
||||
|
||||
# 监测MAA运行状态
|
||||
await self.general_log_monitor.start(
|
||||
self.script_log_path, self.log_start_time
|
||||
)
|
||||
# 等待用户完成配置
|
||||
self.wait_event.clear()
|
||||
await self.wait_event.wait()
|
||||
await self.general_log_monitor.stop()
|
||||
|
||||
async def result_record(self) -> None:
|
||||
"""记录用户结果信息"""
|
||||
@@ -821,12 +815,6 @@ class GeneralManager:
|
||||
else:
|
||||
self.general_result = "Success!"
|
||||
|
||||
elif self.mode == "设置通用脚本":
|
||||
if await self.general_process_manager.is_running():
|
||||
self.general_result = "Wait"
|
||||
else:
|
||||
self.general_result = "Success!"
|
||||
|
||||
logger.info(f"通用脚本日志分析结果: {self.general_result}")
|
||||
|
||||
if self.general_result != "Wait":
|
||||
|
||||
Reference in New Issue
Block a user