diff --git a/repo/js/CD-Aware-AutoGather/main.js b/repo/js/CD-Aware-AutoGather/main.js index 5e06da54..8f008c3d 100644 --- a/repo/js/CD-Aware-AutoGather/main.js +++ b/repo/js/CD-Aware-AutoGather/main.js @@ -4,7 +4,7 @@ const settingFile = "settings.json"; const defaultTime = getDefaultTime(); const CooldownDataBase = readRefreshInfo("CooldownData.txt"); -let stopTime = null; +let stopAtTime = null; let currentParty = null; class ReachStopTime extends Error { @@ -96,16 +96,17 @@ async function runScanMode() { // 采集选中的材料 async function runGatherMode() { + if (settings.stopAtTime) { + stopAtTime = settings.stopAtTime; + log.info("脚本已被配置为达到{0}后停止运行", stopAtTime); + } + const selectedMaterials = getSelectedMaterials(); if (selectedMaterials.length === 0) { log.error("未选择任何材料,请在脚本配置中勾选所需项目"); return; } - if (settings.Time) { - stopTime = settings.stopAtTime; - log.info("脚本已被配置为达到{0}后停止运行", stopTime); - } log.info("共{0}组材料路线待执行:", selectedMaterials.length); for (const item of selectedMaterials) { @@ -127,7 +128,7 @@ async function runGatherMode() { } } catch (e) { if (e instanceof ReachStopTime) { - log.info("达到设置的停止时间 {0},终止运行", stopTime); + log.info("达到设置的停止时间 {0},终止运行", stopAtTime); } else { throw e; } @@ -272,7 +273,7 @@ async function runPathTaskIfCooldownExpired(account, pathTask) { const lastTime = recordMap[fileName] || defaultTime; const progress = `[${i + 1}/${jsonFiles.length}]`; - if (settings.Time && isTargetTimeReached(stopTime)) { + if (stopAtTime && isTargetTimeReached(stopAtTime)) { throw new ReachStopTime("达到设置的停止时间,终止运行"); } diff --git a/repo/js/CD-Aware-AutoGather/manifest.json b/repo/js/CD-Aware-AutoGather/manifest.json index 32f3e54a..c42224ee 100644 --- a/repo/js/CD-Aware-AutoGather/manifest.json +++ b/repo/js/CD-Aware-AutoGather/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "带CD管理的自动采集", - "version": "1.2", + "version": "1.3", "bgi_version": "0.45.0", "description": "自动同步你通过BetterGI订阅的地图追踪任务,执行采集任务,并管理材料刷新时间(支持多账号)。\n首次使用前请先简单阅读说明(可在`全自动`——`JS脚本`页面,点击本脚本名称查看)", "authors": [