diff --git a/repo/js/AAA-Artifacts-Bulk-Supply/main.js b/repo/js/AAA-Artifacts-Bulk-Supply/main.js index 51dd4fde5..be929412b 100644 --- a/repo/js/AAA-Artifacts-Bulk-Supply/main.js +++ b/repo/js/AAA-Artifacts-Bulk-Supply/main.js @@ -138,15 +138,43 @@ let gameRegion; moraDiff += await mora(); log.info(`狗粮路线获取摩拉: ${moraDiff}`); log.info(`狗粮路线获取狗粮经验: ${artifactExperienceDiff}`); - //修改records - for (let i = record.records.length - 1; i > 0; i--) { - record.records[i] = record.records[i - 1]; + // ========== 主流程末尾:替换原来的“修改records”区块 ========== + const todayKey = `日期:${record.lastRunDate},运行收尾路线${record.lastRunEndingRoute}`; + let merged = false; + + // 先扫描数组,找同一天同收尾路线 + for (let i = 0; i < record.records.length; i++) { + const line = record.records[i]; + if (line && line.startsWith(todayKey)) { + // 解析原记录的经验、摩拉 + const match = line.match(/狗粮经验(-?\d+),摩拉(-?\d+)/); + if (match) { + const oldExp = Number(match[1]); + const oldMora = Number(match[2]); + // 累加并取正 + const newExp = Math.max(0, oldExp + artifactExperienceDiff); + const newMora = Math.max(0, oldMora + moraDiff); + record.records[i] = `${todayKey},狗粮经验${newExp},摩拉${newMora}`; + merged = true; + log.info(`检测到同日记录,已合并更新:经验 ${newExp},摩拉 ${newMora}`); + } + break; // 同一天只可能有一条,找到就停 + } } - record.records[0] = `日期:${record.lastRunDate},运行收尾路线${record.lastRunEndingRoute},狗粮经验${artifactExperienceDiff},摩拉${moraDiff}`; + + // 如果没找到同一天,再走原来的“整体后移插新记录”逻辑 + if (!merged) { + for (let i = record.records.length - 1; i > 0; i--) { + record.records[i] = record.records[i - 1]; + } + record.records[0] = `${todayKey},狗粮经验${Math.max(0, artifactExperienceDiff)},摩拉${Math.max(0, moraDiff)}`; + } + + // 通知与写盘保持不变 if (settings.notify) { - notification.Send(`日期:${record.lastRunDate},运行收尾路线${record.lastRunEndingRoute},狗粮经验${artifactExperienceDiff},摩拉${moraDiff}`); + notification.Send(`${todayKey},狗粮经验${Math.max(0, artifactExperienceDiff)},摩拉${Math.max(0, moraDiff)}`); } - await writeRecord(accountName);//修改记录文件 + await writeRecord(accountName); })(); @@ -195,7 +223,7 @@ async function readRecord(accountName) { lastRunDate: "1970/01/01", lastActivateTime: new Date("1970-01-01T20:00:00.000Z"), lastRunEndingRoute: "收尾额外A", - records: new Array(14).fill(""), + records: new Array(33550336).fill(""), version: "" }; diff --git a/repo/js/AAA-Artifacts-Bulk-Supply/manifest.json b/repo/js/AAA-Artifacts-Bulk-Supply/manifest.json index 68c95e1d3..256aa8f94 100644 --- a/repo/js/AAA-Artifacts-Bulk-Supply/manifest.json +++ b/repo/js/AAA-Artifacts-Bulk-Supply/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "AAA狗粮批发", - "version": "1.6.2", + "version": "1.6.3", "tags": [ "狗粮" ], diff --git a/repo/js/ArtifactsGroupPurchasing/assets/targetItems/禽肉.png b/repo/js/ArtifactsGroupPurchasing/assets/targetItems/禽肉.png deleted file mode 100644 index 3be94c9ad..000000000 Binary files a/repo/js/ArtifactsGroupPurchasing/assets/targetItems/禽肉.png and /dev/null differ diff --git a/repo/js/ArtifactsGroupPurchasing/main.js b/repo/js/ArtifactsGroupPurchasing/main.js index 82735fec3..8b85044c1 100644 --- a/repo/js/ArtifactsGroupPurchasing/main.js +++ b/repo/js/ArtifactsGroupPurchasing/main.js @@ -153,7 +153,7 @@ let skipRunning = false; await sleep(1000); } } - + await sleep(10000); return; } @@ -162,6 +162,22 @@ let skipRunning = false; log.info(`${settings.logName}:联机狗粮分解获得经验${expGain}`); notification.send(`${settings.logName}:联机狗粮分解获得经验${expGain}`); } + + { + log.info(`本次运行未启用或未触发强迫症模式,正常结束`); + if (settings.normalEnding) { + // 按中文分号分割字符串 + const segments = settings.normalEnding.split(';'); + + // 逐段输出,每段间隔1秒 + for (const segment of segments) { + if (segment.trim()) { // 跳过空段落 + log.info(segment.trim()); + await sleep(1000); + } + } + } + } } )(); @@ -297,6 +313,8 @@ async function runGroupPurchasing(runExtra) { if (runExtra) { log.info("请确保联机收尾已结束,将开始运行额外路线"); await runExtraPath(); + } else { + log.warn("处于单人模式,不执行任何路线"); } } else { log.warn("角色编号识别异常") @@ -779,7 +797,7 @@ async function autoEnter(autoEnterSettings) { if (new Date() - start >= timeout * 60 * 1000) { log.warn("超时未达到预定人数"); notification.error(`超时未达到预定人数`); - if (settings.onlyRunPerfectly) { + if (settings.onlyRunPerfectly && enterMode != "进入他人世界") { skipRunning = true; doRunExtra = false; } diff --git a/repo/js/ArtifactsGroupPurchasing/manifest.json b/repo/js/ArtifactsGroupPurchasing/manifest.json index f0ebf36b5..f04b5c5cf 100644 --- a/repo/js/ArtifactsGroupPurchasing/manifest.json +++ b/repo/js/ArtifactsGroupPurchasing/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "AAA狗粮联机团购", - "version": "1.10.4", + "version": "1.10.5", "tags": [ "狗粮" ], diff --git a/repo/js/ArtifactsGroupPurchasing/settings.json b/repo/js/ArtifactsGroupPurchasing/settings.json index 25afb7f46..2bdbb2b49 100644 --- a/repo/js/ArtifactsGroupPurchasing/settings.json +++ b/repo/js/ArtifactsGroupPurchasing/settings.json @@ -17,7 +17,12 @@ { "name": "onlyRunPerfectly", "type": "input-text", - "label": "输入任意内容后启用强迫症模式\n人不齐或队友未正常到位时不执行任何路线\n并在运行结束后输出按中文分号;分隔的内容" + "label": "输入任意内容后启用强迫症模式\n人不齐或队友未正常到位时不执行任何路线\n并在运行结束后间隔一秒输出按中文分号;分隔的内容" + }, + { + "name": "normalEnding", + "type": "input-text", + "label": "正常运行结束后间隔一秒输出按中文分号;分隔的内容" }, { "name": "groupMode",