js:锄地一条龙 (#1405)

### 1.2.2(2025.07.25)
1.调整部分小怪路线的战斗点位
### 1.2.1(2025.07.24)
1. 调整了路线筛选的逻辑
This commit is contained in:
mno
2025-07-25 20:03:27 +08:00
committed by GitHub
parent d9b92d1f0d
commit 7facb28fee
12 changed files with 70 additions and 68 deletions

View File

@@ -73,6 +73,10 @@
--- ---
### 更新日志 ### 更新日志
### 1.2.22025.07.25
1.调整部分小怪路线的战斗点位
### 1.2.12025.07.24
1. 调整了路线筛选的逻辑
### 1.1.82025.07.13 ### 1.1.82025.07.13
1. 新增实验功能:泥头车模式 1. 新增实验功能:泥头车模式
2. 新增部分路线 2. 新增部分路线

View File

@@ -1,4 +1,4 @@
{ {
"info": { "info": {
"name": "419须弥沙漠巨人峡谷西北600_1", "name": "419须弥沙漠巨人峡谷西北600_1",
"type": "collect", "type": "collect",

View File

@@ -1,4 +1,4 @@
{ {
"info": { "info": {
"name": "422须弥沙漠赤王陵西北岩窟中层600_1200_1", "name": "422须弥沙漠赤王陵西北岩窟中层600_1200_1",
"type": "collect", "type": "collect",

View File

@@ -1,4 +1,4 @@
{ {
"info": { "info": {
"name": "429须弥沙漠赤王陵200_2", "name": "429须弥沙漠赤王陵200_2",
"type": "collect", "type": "collect",

View File

@@ -1,4 +1,4 @@
{ {
"info": { "info": {
"name": "519魔像禁卫-佩特莉可镇200_1", "name": "519魔像禁卫-佩特莉可镇200_1",
"type": "collect", "type": "collect",

View File

@@ -1,4 +1,4 @@
{ {
"info": { "info": {
"name": "520魔像禁卫-佩特莉可镇200_1", "name": "520魔像禁卫-佩特莉可镇200_1",
"type": "collect", "type": "collect",

View File

@@ -1,4 +1,4 @@
{ {
"info": { "info": {
"name": "521佩特莉可镇200_5", "name": "521佩特莉可镇200_5",
"type": "collect", "type": "collect",

View File

@@ -272,7 +272,7 @@ async function markPathings(pathings, group1Tags, group2Tags, group3Tags, group4
async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum) { async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum) {
// 初始化变量 // 初始化变量
let currentTargetEliteNum = targetEliteNum; // 当前目标精英怪数量 let nextTargetEliteNum = targetEliteNum; // 当前目标精英怪数量
let iterationCount = 0; // 循环次数 let iterationCount = 0; // 循环次数
// 初始化统计变量 // 初始化统计变量
@@ -280,10 +280,14 @@ async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum
let totalSelectedMonsters = 0; // 总普通怪数量 let totalSelectedMonsters = 0; // 总普通怪数量
let totalGainCombined = 0; // 总收益 let totalGainCombined = 0; // 总收益
let totalTimeCombined = 0; // 总耗时 let totalTimeCombined = 0; // 总耗时
let monsterRouteElite = 0;
let maxE1 = 0; let maxE1 = 0;
let maxE2 = 0; let maxE2 = 0;
const ratio = targetEliteNum / targetMonsterNum;
const f = (Number((1 - Math.exp(-ratio * ratio)).toFixed(3)) + 1) / 2;
// 遍历 pathings计算并添加 G1、G2、E1 和 E2 属性 // 遍历 pathings计算并添加 G1、G2、E1 和 E2 属性
pathings.forEach(pathing => { pathings.forEach(pathing => {
pathing.selected = false; // 初始化 selected 属性为 false pathing.selected = false; // 初始化 selected 属性为 false
@@ -291,7 +295,7 @@ async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum
pathing.G1 = G1; pathing.G1 = G1;
const G2 = pathing.mora_m; // 进入二组的收益 const G2 = pathing.mora_m; // 进入二组的收益
pathing.G2 = G2; pathing.G2 = G2;
pathing.E1 = pathing.e === 0 ? 0 : ((G1 - G2 * (targetEliteNum / (targetEliteNum + targetMonsterNum))) / pathing.e) ** k * (G1 / pathing.t); // 进入一组的效率 pathing.E1 = pathing.e === 0 ? 0 : ((G1 - G2 * f) / pathing.e) ** k * (G1 / pathing.t); // 进入一组的效率
pathing.E2 = pathing.m === 0 ? 0 : (G2 / pathing.m) ** k * (G2 / pathing.t); // 进入二组的效率 pathing.E2 = pathing.m === 0 ? 0 : (G2 / pathing.m) ** k * (G2 / pathing.t); // 进入二组的效率
if (maxE1 < pathing.E1) { if (maxE1 < pathing.E1) {
@@ -320,12 +324,13 @@ async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum
totalGainCombined = 0; // 重置总收益 totalGainCombined = 0; // 重置总收益
totalTimeCombined = 0; // 重置总耗时 totalTimeCombined = 0; // 重置总耗时
// 按 E1 从高到低排序 // 按 E1 从高到低排序
pathings.sort((a, b) => b.E1 - a.E1); pathings.sort((a, b) => b.E1 - a.E1);
// 第一轮选择:根据当前目标精英怪数量选择路径 // 第一轮选择:根据当前目标精英怪数量选择路径
for (const pathing of pathings) { for (const pathing of pathings) {
if (pathing.E1 > 0 && pathing.available && totalSelectedElites < targetEliteNum) { if (pathing.E1 > 0 && pathing.available && ((totalSelectedElites + pathing.e) <= targetEliteNum - monsterRouteElite + 2)) {
pathing.selected = true; pathing.selected = true;
totalSelectedElites += pathing.e; totalSelectedElites += pathing.e;
totalSelectedMonsters += pathing.m; totalSelectedMonsters += pathing.m;
@@ -337,14 +342,16 @@ async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum
// 封装第二轮选择逻辑 // 封装第二轮选择逻辑
function selectRoutesByMonsterTarget(targetMonsterNum) { function selectRoutesByMonsterTarget(targetMonsterNum) {
monsterRouteElite = 0;
// 按 E2 从高到低排序 // 按 E2 从高到低排序
pathings.sort((a, b) => b.E2 - a.E2); pathings.sort((a, b) => b.E2 - a.E2);
// 第二轮选择:根据剩余的普通怪数量目标选择路径 // 第二轮选择:根据剩余的普通怪数量目标选择路径
for (const pathing of pathings) { for (const pathing of pathings) {
if (pathing.E2 > 0 && pathing.available && !pathing.selected && totalSelectedMonsters < targetMonsterNum) { if (pathing.E2 > 0 && pathing.available && !pathing.selected && (totalSelectedMonsters + pathing.m) < targetMonsterNum + 5) {
pathing.selected = true; pathing.selected = true;
totalSelectedElites += pathing.e; // 第二轮选择中也可能包含精英怪 totalSelectedElites += pathing.e; // 第二轮选择中也可能包含精英怪
monsterRouteElite += pathing.e;
totalSelectedMonsters += pathing.m; totalSelectedMonsters += pathing.m;
totalGainCombined += pathing.G2; totalGainCombined += pathing.G2;
totalTimeCombined += pathing.t; totalTimeCombined += pathing.t;
@@ -353,26 +360,21 @@ async function findBestRouteGroups(pathings, k, targetEliteNum, targetMonsterNum
} }
// 循环调整目标精英怪数量 // 循环调整目标精英怪数量
while (iterationCount < 10) { while (iterationCount < 100) {
// 第一轮选择 // 第一轮选择
selectRoutesByEliteTarget(currentTargetEliteNum); selectRoutesByEliteTarget(nextTargetEliteNum);
// 第二轮选择:直接传入剩余的小怪数量目标 // 第二轮选择:直接传入剩余的小怪数量目标
selectRoutesByMonsterTarget(targetMonsterNum); selectRoutesByMonsterTarget(targetMonsterNum);
// 检查精英怪总数是否满足条件 // 检查精英怪总数是否满足条件
const diff = totalSelectedElites - targetEliteNum; const diff = totalSelectedElites - targetEliteNum;
currentTargetEliteNum -= Math.round(0.5 * diff); // 调整目标精英怪数量,乘以系数并取整 if ((totalSelectedElites >= targetEliteNum - 3) && (totalSelectedElites <= targetEliteNum)) {
break;
if (totalSelectedElites === targetEliteNum) {
break; // 如果满足目标,直接终止循环
} }
nextTargetEliteNum -= Math.round(0.1 * diff); // 调整目标精英怪数量,乘以系数并取整
if ((totalSelectedElites > targetEliteNum) && iterationCount >= 5) { //log.info(`该轮循环目标${nextTargetEliteNum},实际选出${totalSelectedElites}`);
break; // 如果满足目标,直接终止循环 iterationCount++; // 增加循环序号
}
iterationCount++; // 增加循环次数
} }
// 为最终选中且精英怪数量为0的路线添加小怪标签 // 为最终选中且精英怪数量为0的路线添加小怪标签

View File

@@ -1,7 +1,7 @@
{ {
"manifest_version": 1, "manifest_version": 1,
"name": "锄地一条龙", "name": "锄地一条龙",
"version": "1.2.0", "version": "1.2.2",
"description": "一站式解决自动化锄地支持只拾取狗粮请阅读README.md后使用", "description": "一站式解决自动化锄地支持只拾取狗粮请阅读README.md后使用",
"authors": [ "authors": [
{ {

View File

@@ -1,12 +1,7 @@
{ {
"info": { "info": {
"name": "6611--纳塔_涌流地_中央神像_(9-8)", "name": "6611--纳塔_涌流地_中央神像_(9-8)",
"type": "collect", "type": "collect",
"author": "Demo&汐&mno",
"version": "1.1",
"description": " 路线信息该路线预计用时181.76秒包含13只小怪预计收入769.5摩拉包含以下怪物1只流刃勇士·游击人、2只流刃勇士·锯脂者、2只流刃勇士·掷叉猎手、1只鳍游龙武士·裂礁之涛、2只幼鳍游龙、5只鳍游龙。",
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"authors": [ "authors": [
{ {
"name": "Demo" "name": "Demo"
@@ -19,7 +14,14 @@
"name": "mno", "name": "mno",
"links": "https://github.com/Bedrockx" "links": "https://github.com/Bedrockx"
} }
] ],
"version": "1.1",
"description": " 路线信息该路线预计用时181.76秒包含13只小怪预计收入769.5摩拉包含以下怪物1只流刃勇士·游击人、2只流刃勇士·锯脂者、2只流刃勇士·掷叉猎手、1只鳍游龙武士·裂礁之涛、2只幼鳍游龙、5只鳍游龙。",
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"tags": [],
"last_modified_time": 1753404413684,
"enable_monster_loot_split": false
}, },
"positions": [ "positions": [
{ {
@@ -74,8 +76,7 @@
"action": "fight", "action": "fight",
"move_mode": "dash", "move_mode": "dash",
"action_params": "", "action_params": "",
"type": "path", "type": "path"
"locked": false
}, },
{ {
"id": 7, "id": 7,
@@ -153,25 +154,15 @@
"id": 15, "id": 15,
"x": 8431.56, "x": 8431.56,
"y": -2791, "y": -2791,
"action": "combat_script", "action": "fight",
"move_mode": "dash", "move_mode": "dash",
"action_params": "attack(0.5)", "action_params": "",
"type": "path" "type": "path"
}, },
{ {
"id": 16, "id": 16,
"x": 8439.32, "x": 8439.32,
"y": -2772.84, "y": -2772.84,
"action": "fight",
"move_mode": "dash",
"action_params": "",
"type": "path",
"locked": false
},
{
"id": 17,
"x": 8439.32,
"y": -2772.84,
"action": "combat_script", "action": "combat_script",
"move_mode": "dash", "move_mode": "dash",
"action_params": "wait(1)", "action_params": "wait(1)",

View File

@@ -1,18 +1,20 @@
{ {
"info": { "info": {
"name": "2101璃月无妄坡西南", "name": "2101璃月无妄坡西南",
"type": "collect", "type": "collect",
"author": "mno",
"version": "1.1",
"description": " 路线信息该路线预计用时292.2秒包含2只精英与34只小怪预计收入2101摩拉包含以下怪物4只冰史莱姆、9只丘丘人、4只打手丘丘人、3只冲锋丘丘人、2只木盾丘丘人、2只射手丘丘人、2只火箭丘丘人、4只冰箭丘丘人、1只木盾丘丘暴徒、1只火斧丘丘暴徒、4只水萤。",
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"authors": [ "authors": [
{ {
"name": "mno", "name": "mno",
"links": "https://github.com/Bedrockx" "links": "https://github.com/Bedrockx"
} }
] ],
"version": "1.1",
"description": " 路线信息该路线预计用时292.2秒包含2只精英与34只小怪预计收入2101摩拉包含以下怪物4只冰史莱姆、9只丘丘人、4只打手丘丘人、3只冲锋丘丘人、2只木盾丘丘人、2只射手丘丘人、2只火箭丘丘人、4只冰箭丘丘人、1只木盾丘丘暴徒、1只火斧丘丘暴徒、4只水萤。",
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"tags": [],
"last_modified_time": 1753404181347,
"enable_monster_loot_split": false
}, },
"positions": [ "positions": [
{ {
@@ -300,25 +302,25 @@
"y": 1360.12, "y": 1360.12,
"action": "combat_script", "action": "combat_script",
"move_mode": "dash", "move_mode": "dash",
"action_params": "wait(2)", "action_params": "芙宁娜 e",
"type": "path", "type": "path",
"locked": false "locked": false
}, },
{ {
"id": 33, "id": 33,
"x": 606.52, "x": 616.52,
"y": 1360.12, "y": 1365.12,
"action": "fight", "action": "combat_script",
"move_mode": "dash", "move_mode": "dash",
"action_params": "", "action_params": "wait(1.5)",
"type": "orientation", "type": "path",
"locked": false "locked": false
}, },
{ {
"id": 34, "id": 34,
"x": 606.52, "x": 616.52,
"y": 1360.12, "y": 1365.12,
"action": "", "action": "fight",
"move_mode": "dash", "move_mode": "dash",
"action_params": "", "action_params": "",
"type": "path" "type": "path"

View File

@@ -1,17 +1,20 @@
{ {
"info": { "info": {
"name": "2202璃月瑶光滩西北", "name": "2202璃月瑶光滩西北",
"type": "collect", "type": "collect",
"author": "mno",
"version": "1.0",
"description": " 路线信息该路线预计用时286.29秒包含3只精英与19只小怪预计收入1693.5摩拉包含以下怪物2只丘丘人、2只打手丘丘人、3只冲锋丘丘人、3只木盾丘丘人、1只雷箭丘丘人、3只冰箭丘丘人、1只木盾丘丘暴徒、1只草丘丘萨满、1只水深渊法师、1只遗迹猎者、1只水萤、3只雷萤。",
"bgi_version": "0.42.0",
"authors": [ "authors": [
{ {
"name": "mno", "name": "mno",
"links": "https://github.com/Bedrockx" "links": "https://github.com/Bedrockx"
} }
] ],
"version": "1.0",
"description": " 路线信息该路线预计用时286.29秒包含3只精英与19只小怪预计收入1693.5摩拉包含以下怪物2只丘丘人、2只打手丘丘人、3只冲锋丘丘人、3只木盾丘丘人、1只雷箭丘丘人、3只冰箭丘丘人、1只木盾丘丘暴徒、1只草丘丘萨满、1只水深渊法师、1只遗迹猎者、1只水萤、3只雷萤。",
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"tags": [],
"last_modified_time": 1753403836745,
"enable_monster_loot_split": false
}, },
"positions": [ "positions": [
{ {
@@ -261,8 +264,8 @@
"id": 28, "id": 28,
"x": -148.97, "x": -148.97,
"y": 438.69, "y": 438.69,
"action": "", "action": "fight",
"move_mode": "dash", "move_mode": "walk",
"action_params": "", "action_params": "",
"type": "path" "type": "path"
}, },