From 1deee1084247a4c3760f4341bf119a89ecee1adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E4=BA=91?= Date: Thu, 29 May 2025 15:23:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E7=9A=84=E9=94=9A?= =?UTF-8?q?=E7=82=B9=E6=94=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/FeatherFalling/main.js | 19 ++++++++----------- repo/js/FeatherFalling/manifest.json | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/repo/js/FeatherFalling/main.js b/repo/js/FeatherFalling/main.js index 79be17dc..be9c374b 100644 --- a/repo/js/FeatherFalling/main.js +++ b/repo/js/FeatherFalling/main.js @@ -78,6 +78,7 @@ async function FeatherFailing() { log.info("传送点图标已识别,点击传送"); result.click(); await sleep(1000); + let totalHours = 999; if (settings.autoPortableWaypoint) { let result = captureGameRegion().find(ocrRo); log.info("识别到锚点文字: " + result.text); @@ -85,8 +86,6 @@ async function FeatherFailing() { // 使用正则表达式匹配不同的时间格式 const dayHourPattern = /(\d+)天(\d+)小时/; // X天X小时格式 const hourOnlyPattern = /(\d+)小时/; // X小时格式 - - let totalHours = 0; let dayMatch = result.text.match(dayHourPattern); let hourMatch = result.text.match(hourOnlyPattern); @@ -103,19 +102,19 @@ async function FeatherFailing() { } else { log.warn("无法解析锚点剩余时间格式,本次不放置锚点"); } - - // 判断是否需要放置锚点 - if (totalHours < settings.autoPortableWaypointHours) { - await PlacePortableWaypoint(); - } else { - log.info(`剩余时间${totalHours}小时,大于设定阈值${settings.autoPortableWaypointHours}小时,不放置锚点`); - } } result = captureGameRegion().find(goTeleportRo); result.click(); await sleep(1000); await genshin.returnMainUi(); await sleep(1000); + if (settings.autoPortableWaypoint) { + if (totalHours < settings.autoPortableWaypointHours) { + await PlacePortableWaypoint(); + } else { + log.info(`剩余时间${totalHours}小时,大于设定阈值${settings.autoPortableWaypointHours}小时,不放置锚点`); + } + } } else { log.warn("传送点图标未识别,没有放置传送点"); await genshin.tp(3347.59, 2756.12); @@ -136,10 +135,8 @@ async function FeatherFailing() { if (settings.autoPortableWaypoint) { await PlacePortableWaypoint(); } - } - for (let i = 0; i < 30; i++) { keyDown("W"); await sleep(50); diff --git a/repo/js/FeatherFalling/manifest.json b/repo/js/FeatherFalling/manifest.json index dbe9738c..5f79828f 100644 --- a/repo/js/FeatherFalling/manifest.json +++ b/repo/js/FeatherFalling/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "摔落保护:提瓦特反牛顿机制", - "version": "1.1.1", + "version": "1.1.2", "description": "利用游戏机制获取免疫摔落伤害的buff", "authors": [ {