diff --git a/repo/js/AAA-Artifacts-Bulk-Supply/README.md b/repo/js/AAA-Artifacts-Bulk-Supply/README.md index 37a7afb08..e20e360e0 100644 --- a/repo/js/AAA-Artifacts-Bulk-Supply/README.md +++ b/repo/js/AAA-Artifacts-Bulk-Supply/README.md @@ -82,6 +82,8 @@ https://www.kdocs.cn/wo/sl/v13uXscL ## 更新日志 +### 1.1.4(2025.08.27) +1.尝试修正经验识别 ### 1.1.3(2025.08.26) 1.更正联机收尾路线逻辑 ### 1.1.2(2025.08.25) diff --git a/repo/js/AAA-Artifacts-Bulk-Supply/main.js b/repo/js/AAA-Artifacts-Bulk-Supply/main.js index 98b45796e..ce48b4f56 100644 --- a/repo/js/AAA-Artifacts-Bulk-Supply/main.js +++ b/repo/js/AAA-Artifacts-Bulk-Supply/main.js @@ -330,17 +330,21 @@ async function processArtifacts(times = 1) { } await sleep(1000); - //识别已储存经验(1570-880-1650-930) - let regionToCheck1 = { x: 1570, y: 880, width: 80, height: 50 }; - let initialNum = await recognizeTextInRegion(regionToCheck1); - let initialValue = 0; + // 识别已储存经验(1570-880-1650-930) + const regionToCheck1 = { x: 1570, y: 880, width: 80, height: 50 }; + const raw = await recognizeTextInRegion(regionToCheck1); - if (initialNum && !isNaN(parseInt(initialNum, 10))) { - initialValue = parseInt(initialNum, 10); + // 把识别到的文字里所有非数字字符去掉,只保留数字 + const digits = (raw || '').replace(/\D/g, ''); + + let initialValue = 0; + if (digits) { + initialValue = parseInt(digits, 10); log.info(`已储存经验识别成功: ${initialValue}`); } else { log.warn(`在指定区域未识别到有效数字: ${initialValue}`); } + let regionToCheck3 = { x: 100, y: 885, width: 170, height: 50 }; let decomposedNum = 0; let firstNumber = 0; @@ -418,12 +422,16 @@ async function processArtifacts(times = 1) { if (settings.notify) { notification.Send(`当前经验如图`); } - let regionToCheck2 = { x: 1470, y: 880, width: 205, height: 70 }; - let newNum = await recognizeTextInRegion(regionToCheck2); - let newValue = 0; + // 当前总经验(1470-880-205-70) + const regionToCheck2 = { x: 1470, y: 880, width: 205, height: 70 }; + const raw2 = await recognizeTextInRegion(regionToCheck2); - if (newNum && !isNaN(parseInt(newNum, 10))) { - newValue = parseInt(newNum, 10); + // 只保留数字 + const digits2 = (raw2 || '').replace(/\D/g, ''); + + let newValue = 0; + if (digits2) { + newValue = parseInt(digits2, 10); log.info(`当前总经验识别成功: ${newValue}`); } else { log.warn(`在指定区域未识别到有效数字: ${newValue}`); diff --git a/repo/js/AAA-Artifacts-Bulk-Supply/manifest.json b/repo/js/AAA-Artifacts-Bulk-Supply/manifest.json index b6966c747..144a89ab3 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.1.3", + "version": "1.1.4", "tags": [ "狗粮" ], diff --git a/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/2P.png b/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/2P.png index 3e936ddc6..4f8edeef3 100644 Binary files a/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/2P.png and b/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/2P.png differ diff --git a/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/3P.png b/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/3P.png index d4bf8d5b6..04cf2d4bc 100644 Binary files a/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/3P.png and b/repo/js/AAA-Artifacts-Group-Purchasing/assets/RecognitionObject/3P.png differ diff --git a/repo/js/AAA-Artifacts-Group-Purchasing/main.js b/repo/js/AAA-Artifacts-Group-Purchasing/main.js index e40f4a9ad..7c9159edc 100644 --- a/repo/js/AAA-Artifacts-Group-Purchasing/main.js +++ b/repo/js/AAA-Artifacts-Group-Purchasing/main.js @@ -9,6 +9,8 @@ let p3EndingRoute = settings.p3EndingRoute || "智障厅"; let p4EndingRoute = settings.p4EndingRoute || "清籁丸"; let accountName = settings.accountName || "默认账户"; let runExtra = settings.runExtra || false; +let forceGroupNumber = settings.forceGroupNumber || 0; + //文件路径 //摧毁狗粮 @@ -43,13 +45,18 @@ let _infoPoints = null; // 缓存 assets/info.json 解析后的数组 (async function () { setGameMetrics(1920, 1080, 1); - const groupNumBer = await getPlayerSign(); + let groupNumBer = await getPlayerSign(); if (groupNumBer != 0) { log.info(`在队伍中编号为${groupNumBer}`); } else { log.info(`不处于联机模式或识别异常`); } + if (forceGroupNumber != 0) { + groupNumBer = forceGroupNumber; + log.info(`将自己在队伍中的编号强制指定为${groupNumBer}`); + } + if (groupNumBer === 1) { // 启用自动拾取的实时任务 dispatcher.addTimer(new RealtimeTimer("AutoPick")); @@ -106,7 +113,7 @@ let _infoPoints = null; // 缓存 assets/info.json 解析后的数组 //自己是队员,前往对应的占位点 await goToTarget(groupNumBer); //等待到房主解散队伍并返回主界面? - if (await waitForMainUI(false, 60 * 60 * 1000)) { + if (await waitForMainUI(false, 2 * 60 * 60 * 1000)) { await waitForMainUI(true); await genshin.returnMainUi(); } else { @@ -186,7 +193,7 @@ async function isMainUI() { while (attempts < maxAttempts) { try { - gameRegion = captureGameRegion(); + let gameRegion = captureGameRegion(); let result = gameRegion.find(recognitionObject); gameRegion.dispose(); if (result.isExist()) { @@ -226,6 +233,7 @@ async function getPlayerSign() { let p2 = gameRegion.Find(p2Ro); let p3 = gameRegion.Find(p3Ro); let p4 = gameRegion.Find(p4Ro); + gameRegion.dispose(); if (p1.isExist()) return 1; if (p2.isExist()) return 2; if (p3.isExist()) return 3; @@ -267,6 +275,8 @@ async function findTotalNumber() { count++; } + gameRegion.dispose(); + log.info(`当前联机世界玩家总数(含自己):${count}`); return count; } @@ -505,7 +515,7 @@ async function runExtraPath() { await pathingScript.runFile(fullPath); } - log.info(`${folderName} 的全部路线已跑完`); + log.info(`额外 的全部路线已跑完`); } /** diff --git a/repo/js/AAA-Artifacts-Group-Purchasing/manifest.json b/repo/js/AAA-Artifacts-Group-Purchasing/manifest.json index bb374686e..f3e170edd 100644 --- a/repo/js/AAA-Artifacts-Group-Purchasing/manifest.json +++ b/repo/js/AAA-Artifacts-Group-Purchasing/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "AAA狗粮联机团购", - "version": "1.0.1", + "version": "1.0.2", "tags": [ "狗粮" ], diff --git a/repo/js/AAA-Artifacts-Group-Purchasing/settings.json b/repo/js/AAA-Artifacts-Group-Purchasing/settings.json index 93e6161cd..ce3dec888 100644 --- a/repo/js/AAA-Artifacts-Group-Purchasing/settings.json +++ b/repo/js/AAA-Artifacts-Group-Purchasing/settings.json @@ -83,5 +83,11 @@ "type": "input-text", "label": "账户名称\n用于多账户运行时区分不同账户\n单账户无需修改", "default": "默认账户" + }, + { + "name": "forceGroupNumber", + "type": "input-text", + "label": "强制指定自己在队伍中的编号,在识别异常时使用,填0不指定", + "default": "0" } ] \ No newline at end of file