From e6b8f0c0432cd55e614f4cd06a80af2bf5b199ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BA=81=E5=8A=A8=E7=9A=84=E6=B0=A8=E6=B0=94?= <131591012+zaodonganqi@users.noreply.github.com> Date: Tue, 4 Nov 2025 22:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E7=89=8C=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E9=BE=99=E6=8F=90=E5=89=8D=E9=87=8A=E6=94=BE=20(#2310?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/七圣召唤七日历练全自动/main.js | 10 ++++++---- repo/js/七圣召唤七日历练全自动/manifest.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/repo/js/七圣召唤七日历练全自动/main.js b/repo/js/七圣召唤七日历练全自动/main.js index 475ed5945..f82f80463 100644 --- a/repo/js/七圣召唤七日历练全自动/main.js +++ b/repo/js/七圣召唤七日历练全自动/main.js @@ -421,8 +421,6 @@ const detectCardPlayer = async () => { // 在裁剪区域中查找卡片 const result = cropRegion.Find(cardPlayerRo); - captureRegion.dispose(); - cropRegion.dispose(); // 如果找到卡片 if (!result.IsEmpty()) { @@ -433,11 +431,14 @@ const detectCardPlayer = async () => { keyPress("ESCAPE"); await sleep(1500); await point.action(); // 调用该点位对应的函数 + captureRegion.dispose(); + cropRegion.dispose(); return true; // 返回true表示已找到并处理 } } + cropRegion.dispose(); } - + captureRegion.dispose(); // 所有点位都未找到 log.info("未在任何检测点找到玩家"); textArray.length = 0; @@ -475,7 +476,7 @@ async function captureAndStoreTexts() { // 在指定区域进行OCR识别 const result = captureRegion.find(ocrRo); let res2 = captureRegion.find(ocrRo2); - captureRegion.dispose(); + if (!result.isEmpty() && result.text) { // 存储识别结果和对应位置 if (res2.isExist()) { @@ -491,6 +492,7 @@ async function captureAndStoreTexts() { } } + captureRegion.dispose(); log.info(`剩余挑战人数:${textArray.length}`); keyPress("ESCAPE"); await sleep(1000); diff --git a/repo/js/七圣召唤七日历练全自动/manifest.json b/repo/js/七圣召唤七日历练全自动/manifest.json index 641015e67..888bef09e 100644 --- a/repo/js/七圣召唤七日历练全自动/manifest.json +++ b/repo/js/七圣召唤七日历练全自动/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "打牌一条龙", - "version": "2.11", + "version": "2.12", "description": "完成每周的七圣召唤七日历练(来客挑战)。详见README.md", "tags": [ "七圣召唤"