mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-16 03:33:25 +08:00
JS: 允许开启木材检测后指定砍伐数目 (#2333)
* JS: 允许开启木材检测后指定砍伐数目 * Update main.js * Update repo/js/AutoWoodcutting-Pathing/main.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: 躁动的氨气 <131591012+zaodonganqi@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -245,8 +245,8 @@
|
||||
}
|
||||
|
||||
// 调用BGI任务读取背包中的木材数量并返回
|
||||
async function woodInventory(woodsArray, numbersArray) {
|
||||
log.info("先别急,先别动键盘鼠标,要去一个神秘的地方")
|
||||
async function woodInventory(woodsArray, numbersArray, woodInventoryNumber) {
|
||||
log.info("先别急,先别动键盘鼠标,要去一个神秘的地方");
|
||||
await genshin.Tp(1581.11, -112.45, "Enkanomiya", true);
|
||||
await moveMouseBy(0, -114514);
|
||||
await moveMouseBy(0, -1919810);
|
||||
@@ -273,7 +273,7 @@
|
||||
|
||||
// 执行计算逻辑
|
||||
const diff = 9999 - numValue;
|
||||
const result = diff > 2000 ? 2000 : diff;
|
||||
const result = diff > woodInventoryNumber ? woodInventoryNumber : diff;
|
||||
|
||||
keys.push(key);
|
||||
values.push(result);
|
||||
@@ -449,12 +449,13 @@
|
||||
// 分别将填入的木材名称和数量转成数组
|
||||
let woodsArray = settings.woods ? settings.woods.split(/\s+/) : [];
|
||||
let numbersArray = settings.numbers ? settings.numbers.split(/\s+/).map(Number).map(num => isNaN(num) ? 0 : num) : [];
|
||||
let woodInventoryNumber = settings.woodInventoryNumber ? (isNaN(settings.woodInventoryNumber) ? 2000 : settings.woodInventoryNumber) : 2000;
|
||||
let hasItto = settings.hasItto ? settings.hasItto : false;
|
||||
let theBoonOfTheElderTreeStatus = settings.theBoonOfTheElderTree ? await theElderTree() : true;
|
||||
// 判断是否装备王树瑞佑,如果未装备则跳过伐木
|
||||
if (theBoonOfTheElderTreeStatus) {
|
||||
// 判断是否开启背包检测,如果未开启或识别失败,则使用设置填入的数据或默认数据
|
||||
let [woodsInventory, woodCountInventory] = settings.woodInventory ? await woodInventory(woodsArray, numbersArray) : [woodsArray, numbersArray];
|
||||
let [woodsInventory, woodCountInventory] = settings.woodInventory ? await woodInventory(woodsArray, numbersArray, woodInventoryNumber) : [woodsArray, numbersArray];
|
||||
|
||||
// 将识别到的木材种类和所需数量转换为映射表,并计算需要砍伐的次数
|
||||
mapWoodsToNumbers(woodsInventory, woodCountInventory, hasItto);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "自动伐木-地图追踪版",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.4",
|
||||
"description": "基于地图追踪的自动伐木,已支持6.0版本及之前的全部木材\n默认砍伐全部支持木材至2000上限\n自定义设置:\n-可更改砍伐木材种类和数量\n-可以单独设置每个木材数量\n-可设置队伍中是否包含一斗,按保底20%,计算砍伐数量时会除以1.2",
|
||||
"bgi_version": "0.52.0",
|
||||
"tags": [
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
"label": "开启背包木材检测,开启后砍伐识别到的木材",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "woodInventoryNumber",
|
||||
"type": "input-text",
|
||||
"label": "砍伐数目:默认2000(背包木材检测专用)",
|
||||
"default": "2000"
|
||||
},
|
||||
{
|
||||
"name": "woods",
|
||||
"type": "input-text",
|
||||
|
||||
Reference in New Issue
Block a user