From 6a71fcfee4c73ac31340bf03014258023b5e0379 Mon Sep 17 00:00:00 2001 From: yan Date: Sun, 15 Feb 2026 20:21:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(AutoPlan):=20=E6=B7=BB=E5=8A=A0=E5=A4=8D?= =?UTF-8?q?=E6=B4=BB=E9=87=8D=E8=AF=95=E6=9C=BA=E5=88=B6=E5=92=8C=E5=9C=B0?= =?UTF-8?q?=E8=84=89=E8=8A=B1=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实现复活重试逻辑,最多重试5次 - 只对秘境复活场景进行重试处理 - 添加地脉花任务的异步函数框架 - 完善自动执行列表中的地脉花调用 - 修复代码中的空格格式问题 --- repo/js/AutoPlan/main.js | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/repo/js/AutoPlan/main.js b/repo/js/AutoPlan/main.js index 21abe49b3..940a3d61f 100644 --- a/repo/js/AutoPlan/main.js +++ b/repo/js/AutoPlan/main.js @@ -86,9 +86,33 @@ async function autoDomain(autoFight) { log.debug(`副本轮数:${autoFight.domainRoundNum}`) } log.debug(`副本轮数:${domainParam.domainRoundNum}`) - await dispatcher.RunAutoDomainTask(domainParam); + + // 复活重试 + for (let i = 0; i < 5; i++) { + try { + await dispatcher.RunAutoDomainTask(domainParam); + // 其他场景不重试 + break; + } catch (e) { + const errorMessage = e.message + // 只有选择了秘境的时候才会重试 + if (errorMessage.includes("复活") && domainParam.DomainName) { + continue; + } + throw e; + } + } } +/** + * 自动执行地脉花任务的异步函数 + * @param autoLeyLineOutcrop + * @returns {Promise} + */ +async function autoLeyLineOutcrop(autoLeyLineOutcrop) { + //todo :地脉花 + +} /** * 自动执行列表处理函数 @@ -97,10 +121,10 @@ async function autoDomain(autoFight) { async function autoRunList(autoRunOrderList) { //计划执行 for (const item of autoRunOrderList) { - if (item.runType===config.user.runTypes[0]){ + if (item.runType === config.user.runTypes[0]) { await autoDomain(item.autoFight); - }else if (item.runType===config.user.runTypes[1]){ - //todo :地脉花 + } else if (item.runType === config.user.runTypes[1]) { + await autoLeyLineOutcrop(item.autoLeyLineOutcrop); } } } @@ -313,7 +337,7 @@ async function main() { let runConfig = config.run.config; //"队伍名称|秘境名称/刷取物品名称|刷几轮|限时/周日|周几执行(0-6)不填默认执行|执行顺序,..." const autoRunOrderList = await initRunOrderList(runConfig); - const list = autoRunOrderList.filter(item => item.runType===config.user.runTypes[0]&&item.autoFight.DomainRoundNum > 0) + const list = autoRunOrderList.filter(item => item.runType === config.user.runTypes[0] && item.autoFight.DomainRoundNum > 0) if (list?.length > 0) { await autoRunList(list); } else {