From e9b9d31c5671c1aeb06c0438d418a40dbdf145f5 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: Thu, 5 Mar 2026 15:58:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=20=E4=BF=AE=E5=A4=8D=E5=8E=9F?= =?UTF-8?q?=E7=B2=B9=E6=A0=91=E8=84=82=E8=AF=86=E5=88=AB=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E5=92=8C=E6=B8=85=E7=90=86=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=20(#2960)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新add_button坐标从(1242,21)调整为(1375,27),尺寸从(54,51)调整为(49,40) - 移除未使用的add_obj坐标定位代码 - 删除废弃的200数值匹配相关注释代码 - 优化物理资源识别模块的坐标精确定位 - 更新版本号从4.5.2到4.5.3 --- .../assets/icon/add_button.jpg | Bin 835 -> 811 bytes repo/js/AutoLeyLineOutcrop/manifest.json | 2 +- repo/js/AutoLeyLineOutcrop/utils/physical.js | 37 +++--------------- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/repo/js/AutoLeyLineOutcrop/assets/icon/add_button.jpg b/repo/js/AutoLeyLineOutcrop/assets/icon/add_button.jpg index cf344bf81292360eee1ce31a1d7ddbd9b686c6d2..ac131accd592fe492bf7e72973c8346f528cb41d 100644 GIT binary patch delta 193 zcmV;y06zc22CD{;xd9fjy1oH_^%}&`-YDGrY zA}zD4z%`L)8Laqk#dn&u#l?=fElgX}m vG~R}ZG_^G9N-;b+;d_4#{ip2n$uHUp=Xe|i&N_WfT&Cnojg6w%s2Ts+bv$Xr delta 217 zcmV;~04D#d2EzuBxd9Tfy1oH_>Gj_jXfLH|Hc5Y*hJsj?L{H1@BN@gz)W#CJV{%q8 zJPYD&BSz6Cw$v{?nOfzYSIc(!N~q5O_Xe({8+sEKl05>}>I>Ug?yaN}Ln`h@0E~~u zuxi>G9M-$w{RK3wM)fQ)aIi}%u$B0Iq~{sOTGBI>(j~=M#PBbMbd6_BM4IPNv-71} zmPKzd*X0VQ91+}_x|3<>Oj2m{3tLz$tz)&ej7JPhwGS#(pAc8UvP-qy~ T;*J#A6l)s#D8QgYs007m7cpmA diff --git a/repo/js/AutoLeyLineOutcrop/manifest.json b/repo/js/AutoLeyLineOutcrop/manifest.json index a3f097f7d..26b0605ca 100644 --- a/repo/js/AutoLeyLineOutcrop/manifest.json +++ b/repo/js/AutoLeyLineOutcrop/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "全自动地脉花", - "version": "4.5.2", + "version": "4.5.3", "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/physical.js b/repo/js/AutoLeyLineOutcrop/utils/physical.js index 82b6343e7..8e6ff21e4 100644 --- a/repo/js/AutoLeyLineOutcrop/utils/physical.js +++ b/repo/js/AutoLeyLineOutcrop/utils/physical.js @@ -1,3 +1,4 @@ + const commonPath = 'assets/icon/' const commonMap = new Map([ ['main_ui', { @@ -53,7 +54,6 @@ async function saveOnlyNumber(str) { // parseInt 将连接后的字符串转换为整数 return parseInt(str.match(/\d+/g).join('')); } - /** * 识别原粹树脂(体力)的函数 * @param {boolean} [opToMainUi=false] - 是否操作到主界面 @@ -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: 1242, - y: 21, - width: 54, - height: 51, + x: 1375, + y: 27, + width: 49, + height: 40, } let templateMatchAddButtonRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync(`${add_objJson.path}`), add_objJson.x, add_objJson.y, add_objJson.width, add_objJson.height); let regionA = captureGameRegion() @@ -108,12 +108,6 @@ async function ocrPhysical(opToMainUi = false,openMap=false) { }finally { regionA.Dispose() } - - // let add_obj = { - // x: 1264, - // y: 39, - // } - // await click(add_obj.x, add_obj.y) await sleep(ms) log.debug(`===[定位原粹树脂]===`) @@ -139,27 +133,6 @@ async function ocrPhysical(opToMainUi = false,openMap=false) { region.Dispose() } -/* log.debug(`===[定位/200]===`) - //定位200 - let jsonPath2 = getJsonPath('200'); - let tmJson2 = { - path: `${jsonPath2.path}${jsonPath2.name}${jsonPath2.type}`, - x: TemplateOrcJson.x, - y: TemplateOrcJson.y, - width: TemplateOrcJson.width, - height: TemplateOrcJson.height, - } - let templateMatchButtonRo2 = RecognitionObject.TemplateMatch(file.ReadImageMatSync(`${tmJson2.path}`), tmJson2.x, tmJson2.y, tmJson2.width, tmJson2.height); - let region2 = captureGameRegion() - let button2 = region2.find(templateMatchButtonRo2); - region2.Dispose() - - await sleep(ms) - if (!button2.isExist()) { - log.error(`${tmJson2.path} 匹配异常`) - throwError(`${tmJson2.path} 匹配异常`) - }*/ - log.debug(`===[识别原粹树脂]===`) //识别体力 x=1625,y=31,width=79,height=30 / x=1689,y=35,width=15,height=26 let ocr_obj = {