From 2677cf1c593445d774461af8bea54be96a01894a Mon Sep 17 00:00:00 2001 From: mno <718135749@qq.com> Date: Thu, 17 Jul 2025 11:17:16 +0800 Subject: [PATCH] =?UTF-8?q?js=EF=BC=9A=E7=8B=97=E7=B2=AE1.6.1=20(#1360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/AutoArtifactsPro/main.js | 11 +++-------- repo/js/AutoArtifactsPro/manifest.json | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/repo/js/AutoArtifactsPro/main.js b/repo/js/AutoArtifactsPro/main.js index 4b8756a5..cc36f967 100644 --- a/repo/js/AutoArtifactsPro/main.js +++ b/repo/js/AutoArtifactsPro/main.js @@ -379,6 +379,7 @@ let enemyType = "无"; } else { artifactExperienceDiff -= await processArtifacts(21); } + moraDiff -= await mora(); artifacts: { if (runnedToday && finished) { @@ -1003,11 +1004,7 @@ async function recognizeTextInRegion(ocrRegion, timeout = 5000) { // 在指定区域进行 OCR 识别 let ocrResult = captureGameRegion().find(RecognitionObject.ocr(ocrRegion.x, ocrRegion.y, ocrRegion.width, ocrRegion.height)); if (ocrResult) { - // 后处理:根据替换映射表检查和替换错误识别的字符 let correctedText = ocrResult.text; - for (let [wrongChar, correctChar] of Object.entries(replacementMap)) { - correctedText = correctedText.replace(new RegExp(wrongChar, 'g'), correctChar); - } return correctedText; // 返回识别到的内容 } else { log.warn(`OCR 识别区域未找到内容`); @@ -1220,15 +1217,13 @@ async function processArtifacts(times = 1) { async function mora() { let result = 0; let tryTimes = 0; - while (result = 0 && tryTimes < 3) { + while (result === 0 && tryTimes < 3) { await genshin.returnMainUi(); - + log.info("开始尝试识别摩拉"); // 按下 C 键 keyPress("C"); await sleep(1500); - let recognized = false; - // 识别“角色菜单”图标或“天赋”文字 let startTime = Date.now(); while (Date.now() - startTime < 5000) { diff --git a/repo/js/AutoArtifactsPro/manifest.json b/repo/js/AutoArtifactsPro/manifest.json index 745e0670..0495749d 100644 --- a/repo/js/AutoArtifactsPro/manifest.json +++ b/repo/js/AutoArtifactsPro/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "自动狗粮重制版", - "version": "1.6.0", + "version": "1.6.1", "tags": [ "好感", "狗粮"