From 7995c67419a2fade578a513a958804719ed2b47d Mon Sep 17 00:00:00 2001 From: yan Date: Sun, 18 Jan 2026 12:34:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor(FullyAutoAndSemiAutoTools):=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0runPath=E5=87=BD=E6=95=B0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E6=88=98=E6=96=97=E9=9C=80=E6=B1=82=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为runPath函数添加current_name和parent_name参数,默认值为空字符串 - 注释掉原有的try-catch块以跳过战斗需求检查 - 在执行路径时传递当前名称和父名称参数 - 移除对团队战斗配置的验证逻辑 --- repo/js/FullyAutoAndSemiAutoTools/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repo/js/FullyAutoAndSemiAutoTools/main.js b/repo/js/FullyAutoAndSemiAutoTools/main.js index 064358e53..d1f3ff3f7 100644 --- a/repo/js/FullyAutoAndSemiAutoTools/main.js +++ b/repo/js/FullyAutoAndSemiAutoTools/main.js @@ -1356,7 +1356,7 @@ async function keyMousePressStart(key) { * 执行指定路径的脚本文件 * @param {string} path - 要执行的脚本路径 */ -async function runPath(path) { +async function runPath(path, current_name="", parent_name="") { // 参数验证 if (!path || typeof path !== 'string') { log.warn('无效的路径参数: {path}', path) @@ -1369,7 +1369,7 @@ async function runPath(path) { return } //检查战斗需求 - try { +/* try { if (!team.fight) { const one = JSON.parse(file.readTextSync(path)) if (one.info?.description?.includes("请配置好战斗策略")) { @@ -1381,7 +1381,7 @@ async function runPath(path) { } } catch (error) { log.error("检查战斗需求失败: {error}", error.message); - } + }*/ //切换队伍 if (team.fight) { if (!team.fightName) { @@ -1488,7 +1488,7 @@ async function runList(list = [], key = "") { } try { // 执行单个路径,并传入停止标识 - await runPath(path); + await runPath(path, onePath.current_name,onePath.parent_name); } catch (error) { log.error('执行路径列表中的路径失败: {path}, 错误: {error}', path, error.message); continue; // 继续执行列表中的下一个路径