From b0899d980cbd29fa1b32d568bc4a91517a2987d3 Mon Sep 17 00:00:00 2001 From: Patrick-Ze <19711799+Patrick-Ze@users.noreply.github.com> Date: Mon, 17 Nov 2025 09:27:16 +0800 Subject: [PATCH] =?UTF-8?q?js:=20=E4=B8=83=E5=9C=A3=E5=8F=AC=E5=94=A4?= =?UTF-8?q?=E4=B8=83=E6=97=A5=E5=8E=86=E7=BB=83:=20OCR=E5=BD=A2=E8=BF=91?= =?UTF-8?q?=E5=AD=97=E6=9B=BF=E6=8D=A2=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E7=A0=81=20(#2362)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/七圣召唤七日历练全自动/main.js | 13 +++++++++++-- repo/js/七圣召唤七日历练全自动/manifest.json | 2 +- .../牌组策略/5.迪希雅白术皇女.txt | 2 +- .../牌组策略/各策略胜败记录.json | 18 +++++++++++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/repo/js/七圣召唤七日历练全自动/main.js b/repo/js/七圣召唤七日历练全自动/main.js index 282ba0420..15499a3b5 100644 --- a/repo/js/七圣召唤七日历练全自动/main.js +++ b/repo/js/七圣召唤七日历练全自动/main.js @@ -1,3 +1,8 @@ +const defaultReplacementMap = { + 监: "盐", + 卵: "卯", +}; + // 存储挑战玩家信息 let textArray = []; let skipNum = 0; @@ -480,9 +485,13 @@ async function captureAndStoreTexts() { if (!result.isEmpty() && result.text) { // 存储识别结果和对应位置 if (res2.isExist()) { - log.info(`识别到文本: ${result.text} 位置: (${pos.x}, ${pos.y})`); + let correctedText = result.text.trim(); + for (let [wrongChar, correctChar] of Object.entries(defaultReplacementMap)) { + correctedText = correctedText.replace(new RegExp(wrongChar, "g"), correctChar); + } + log.info(`识别到文本: ${correctedText} 位置: (${pos.x}, ${pos.y})`); textArray.push({ - text: result.text.trim(), + text: correctedText.trim(), x: pos.x + width / 2, // 点击中心位置 y: pos.y + height / 2, }); diff --git a/repo/js/七圣召唤七日历练全自动/manifest.json b/repo/js/七圣召唤七日历练全自动/manifest.json index 162a7f851..902261add 100644 --- a/repo/js/七圣召唤七日历练全自动/manifest.json +++ b/repo/js/七圣召唤七日历练全自动/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "打牌一条龙", - "version": "2.13", + "version": "2.14", "description": "完成每周的七圣召唤七日历练(来客挑战)。详见README.md", "tags": [ "七圣召唤" diff --git a/repo/js/七圣召唤七日历练全自动/牌组策略/5.迪希雅白术皇女.txt b/repo/js/七圣召唤七日历练全自动/牌组策略/5.迪希雅白术皇女.txt index d7e753d04..5cb050a76 100644 --- a/repo/js/七圣召唤七日历练全自动/牌组策略/5.迪希雅白术皇女.txt +++ b/repo/js/七圣召唤七日历练全自动/牌组策略/5.迪希雅白术皇女.txt @@ -1,4 +1,4 @@ -// shareCode=AnGSuXAMAoGh83oQCCGR9HsQCDGh9bQQDEEx9rUQDFFB97YQDGFR+LcQDHFh+bgQDIEB +// shareCode=AnGRuTQMAoGh83oQCCGR9HsQCDGh9bQQDEEx9rUQDFFB97YQDGFR+LcQDHFh+bgQDIEB 角色定义: 角色1=迪希雅|火{技能3消耗=1火骰子+2任意,技能2消耗=3火骰子,技能1消耗=4火骰子} diff --git a/repo/js/七圣召唤七日历练全自动/牌组策略/各策略胜败记录.json b/repo/js/七圣召唤七日历练全自动/牌组策略/各策略胜败记录.json index b52259fae..b7b055a7e 100644 --- a/repo/js/七圣召唤七日历练全自动/牌组策略/各策略胜败记录.json +++ b/repo/js/七圣召唤七日历练全自动/牌组策略/各策略胜败记录.json @@ -31,7 +31,7 @@ }, "蒂玛乌斯": { "雷神柯莱刻晴": { - "win": 1, + "win": 2, "fail": 0 } }, @@ -49,13 +49,13 @@ }, "瓦格纳": { "雷神柯莱刻晴": { - "win": 1, + "win": 3, "fail": 0 } }, "托马": { "雷神柯莱刻晴": { - "win": 1, + "win": 2, "fail": 0 } }, @@ -88,5 +88,17 @@ "win": 1, "fail": 0 } + }, + "卯师傅": { + "雷神柯莱刻晴": { + "win": 1, + "fail": 0 + } + }, + "欧仁妮": { + "雷神柯莱刻晴": { + "win": 1, + "fail": 0 + } } } \ No newline at end of file