From 4c5c211a089f34b820126fb1f4a61338bf3aff35 Mon Sep 17 00:00:00 2001 From: this-Fish Date: Tue, 9 Dec 2025 18:00:05 +0800 Subject: [PATCH] =?UTF-8?q?JS=EF=BC=9A=E8=87=AA=E5=8A=A8=E4=BC=90=E6=9C=A8?= =?UTF-8?q?-=E5=9C=B0=E5=9B=BE=E8=BF=BD=E8=B8=AA=E7=89=883.0.6=20(#2467)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修正木JS背包检测后的计算逻辑 * Update version to 3.0.6 in manifest.json * Refactor wood inventory settings labels Updated labels for wood inventory settings in JSON. --- repo/js/AutoWoodcutting-Pathing/main.js | 7 ++++--- repo/js/AutoWoodcutting-Pathing/manifest.json | 4 ++-- repo/js/AutoWoodcutting-Pathing/settings.json | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/repo/js/AutoWoodcutting-Pathing/main.js b/repo/js/AutoWoodcutting-Pathing/main.js index 88c7e0b95..fdc7667b0 100644 --- a/repo/js/AutoWoodcutting-Pathing/main.js +++ b/repo/js/AutoWoodcutting-Pathing/main.js @@ -272,8 +272,8 @@ } // 执行计算逻辑 - const diff = 9999 - numValue; - const result = diff > woodInventoryNumber ? woodInventoryNumber : diff; + const diff = Math.min(woodInventoryNumber, 9999) - numValue; // 限制不超过背包上限 + const result = diff > 0 ? diff : 0; keys.push(key); values.push(result); @@ -464,4 +464,5 @@ } else { log.error("未装备有王树瑞佑,伐木结束") } -})(); \ No newline at end of file + +})(); diff --git a/repo/js/AutoWoodcutting-Pathing/manifest.json b/repo/js/AutoWoodcutting-Pathing/manifest.json index 93126887c..371502d98 100644 --- a/repo/js/AutoWoodcutting-Pathing/manifest.json +++ b/repo/js/AutoWoodcutting-Pathing/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "自动伐木-地图追踪版", - "version": "3.0.5", + "version": "3.0.6", "description": "基于地图追踪的自动伐木,已支持6.0版本及之前的全部木材\n默认砍伐全部支持木材至2000上限\n自定义设置:\n-可更改砍伐木材种类和数量\n-可以单独设置每个木材数量\n-可设置队伍中是否包含一斗,按保底20%,计算砍伐数量时会除以1.2", "bgi_version": "0.53.0", "tags": [ @@ -21,4 +21,4 @@ ], "settings_ui": "settings.json", "main": "main.js" -} \ No newline at end of file +} diff --git a/repo/js/AutoWoodcutting-Pathing/settings.json b/repo/js/AutoWoodcutting-Pathing/settings.json index d17a5ffcb..76f31527a 100644 --- a/repo/js/AutoWoodcutting-Pathing/settings.json +++ b/repo/js/AutoWoodcutting-Pathing/settings.json @@ -8,7 +8,7 @@ { "name": "woodInventoryNumber", "type": "input-text", - "label": "砍伐数目:默认2000(背包木材检测专用)", + "label": "砍伐目标数目:默认2000(背包木材检测专用)", "default": "2000" }, { @@ -153,4 +153,5 @@ // "type": "checkbox", // "label": "燃爆木" // } -] \ No newline at end of file + +]