From 9869a2a51382eafce23085341282ed1b7ee5f7de Mon Sep 17 00:00:00 2001 From: yan Date: Sun, 15 Feb 2026 17:37:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(AutoPlanDomain):=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=8E=9F=E7=B2=B9=E6=A0=91=E8=84=82=E8=AF=86=E5=88=AB=E5=92=8C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在物理值OCR识别前添加1秒延迟以提高准确性 - 将操作延迟时间从2000毫秒调整为1000毫秒 - 修正增加按钮的坐标和尺寸参数以匹配当前界面布局 - 注释掉衍生裁剪区域的释放操作避免潜在错误 --- repo/js/AutoPlanDomain/main.js | 1 + repo/js/AutoPlanDomain/utils/physical.js | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/repo/js/AutoPlanDomain/main.js b/repo/js/AutoPlanDomain/main.js index 12a50906c..808ca876d 100644 --- a/repo/js/AutoPlanDomain/main.js +++ b/repo/js/AutoPlanDomain/main.js @@ -45,6 +45,7 @@ async function autoDomain(autoFight) { // transientResinUseCount: number; // /** 使用脆弱树脂次数 */ // fragileResinUseCount: number; + await sleep(1000) //流程->返回主页 打开地图 返回主页 const physicalOcr = await ocrPhysical(true, true) config.user.physical.current = physicalOcr.current diff --git a/repo/js/AutoPlanDomain/utils/physical.js b/repo/js/AutoPlanDomain/utils/physical.js index 2a8945ea1..27d1202c4 100644 --- a/repo/js/AutoPlanDomain/utils/physical.js +++ b/repo/js/AutoPlanDomain/utils/physical.js @@ -47,7 +47,7 @@ async function ocrPhysical(opToMainUi = false,openMap=false,minPhysical=20,isRes } } log.debug(`===开始识别原粹树脂===`) - let ms = 2000 // 定义操作延迟时间(毫秒) + let ms = 1000 // 定义操作延迟时间(毫秒) if (opToMainUi) { await toMainUi(); // 切换到主界面 } @@ -62,13 +62,14 @@ async function ocrPhysical(opToMainUi = false,openMap=false,minPhysical=20,isRes let add_buttonJSON = getJsonPath('add_button'); let add_objJson = { path: `${add_buttonJSON.path}${add_buttonJSON.name}${add_buttonJSON.type}`, - x: 1242, - y: 21, - width: 54, - height: 51, + x: 1373, + y: 22, + width: 52, + height: 49, } let templateMatchAddButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync(`${add_objJson.path}`), add_objJson.x, add_objJson.y, add_objJson.width, add_objJson.height); let regionA = captureGameRegion() + // let deriveCrop = regionA.DeriveCrop(add_objJson.x, add_objJson.y, add_objJson.width, add_objJson.height); try { let buttonA = regionA.find(templateMatchAddButtonRo); @@ -79,6 +80,7 @@ async function ocrPhysical(opToMainUi = false,openMap=false,minPhysical=20,isRes } await buttonA.click() }finally { + // deriveCrop.Dispose() regionA.Dispose() }