From 697b0446001672933a9511f88989cd21d09af98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E7=AB=AF=E5=AE=A2?= <107686912+Kirito520Asuna@users.noreply.github.com> Date: Sat, 17 Jan 2026 21:00:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(AutoLeyLineOutcrop):=20=E4=BF=AE=E5=A4=8DOC?= =?UTF-8?q?R=E7=89=A9=E7=90=86=E8=AF=86=E5=88=AB=E5=92=8C=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=20(#2708)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加调试日志输出ocrPhysical数据 - 移除ocrPhysical.ok验证条件以提高兼容性 - 使用可选链操作符安全访问remainder属性 - 更新版本号从4.5到4.5.1 - 调整添加按钮识别区域坐标和尺寸参数 --- repo/js/AutoLeyLineOutcrop/manifest.json | 2 +- repo/js/AutoLeyLineOutcrop/utils/calCountByResin.js | 5 +++-- repo/js/AutoLeyLineOutcrop/utils/physical.js | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/repo/js/AutoLeyLineOutcrop/manifest.json b/repo/js/AutoLeyLineOutcrop/manifest.json index 7381ade62..d4e853901 100644 --- a/repo/js/AutoLeyLineOutcrop/manifest.json +++ b/repo/js/AutoLeyLineOutcrop/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "全自动地脉花", - "version": "4.5", + "version": "4.5.1", "tags": ["地脉花"], "bgi_version": "0.52.0", "description": "基于OCR图像识别的全自动刷取地脉花。\n💡更多信息请查看README! \n\n----------注意事项----------\n●仅支持BetterGI 0.52.0 及以上版本!\n●部分地脉花因特殊原因不支持全自动,具体的点位请在手册中查看。\n●树脂使用的优先级:2倍原粹树脂 > 浓缩树脂 > 原粹树脂。\n●运行时会传送到七天神像设置中设置的七天神像,需要关闭七天神像设置中的“是否就近七天神像恢复血量”,并指定七天神像。\n●战斗策略注意调度器设置中地图追踪行走配置里的“允许在JsSpript中使用”和“覆盖JS中的自动战斗配置”,只有在都打开的情况下脚本才会使用下面的战斗配置,否则会使用独立任务中的战斗策略。战斗超时时间不能大于脚本自定义配置中的时间。\n\n如果遇到问题,请先参照README中的方法进行解决。", diff --git a/repo/js/AutoLeyLineOutcrop/utils/calCountByResin.js b/repo/js/AutoLeyLineOutcrop/utils/calCountByResin.js index 809a54427..c74228766 100644 --- a/repo/js/AutoLeyLineOutcrop/utils/calCountByResin.js +++ b/repo/js/AutoLeyLineOutcrop/utils/calCountByResin.js @@ -212,10 +212,11 @@ async function countOriginalResin(tryOriginalMode, opToMainUi, openMap) { } else { log.info('尝试使用优化模式'); let ocrPhysical = await physical.ocrPhysical(opToMainUi, openMap); + log.debug(`ocrPhysical: {0}`,JSON.stringify(ocrPhysical)) await sleep(600) // ocrPhysical = false//模拟异常 - if (ocrPhysical && ocrPhysical.ok) { - return ocrPhysical.remainder; + if (ocrPhysical/* && ocrPhysical.ok*/) { + return ocrPhysical?.remainder; } else { //异常 退出至地图 尝试使用原始模式 await keyPress("VK_ESCAPE") diff --git a/repo/js/AutoLeyLineOutcrop/utils/physical.js b/repo/js/AutoLeyLineOutcrop/utils/physical.js index bd321557e..82b6343e7 100644 --- a/repo/js/AutoLeyLineOutcrop/utils/physical.js +++ b/repo/js/AutoLeyLineOutcrop/utils/physical.js @@ -89,10 +89,10 @@ async function ocrPhysical(opToMainUi = false,openMap=false) { let add_buttonJSON = getJsonPath('add_button'); let add_objJson = { path: `${add_buttonJSON.path}${add_buttonJSON.name}${add_buttonJSON.type}`, - x: 1264, - y: 39, - width: genshinJson.width - 1264, - height: 60, + x: 1242, + y: 21, + width: 54, + height: 51, } let templateMatchAddButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync(`${add_objJson.path}`), add_objJson.x, add_objJson.y, add_objJson.width, add_objJson.height); let regionA = captureGameRegion()