全自动地脉花2.0 (#550)

* 全自动地脉花2.0
- 枫丹补全路线
- 修复无限重试
- 修复有浓缩树脂的情况下误认为树脂已用完
This commit is contained in:
ddaodan
2025-04-10 04:52:50 +08:00
committed by GitHub
parent 240a664e69
commit dce96cc900
11 changed files with 843 additions and 59 deletions

View File

@@ -0,0 +1,98 @@
{
"info": {
"name": "枫丹3-新枫丹科学院-1",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 4498.1845703125,
"y": 4710.78857421875,
"action_params": ""
},
{
"id": 2,
"x": 4496.67333984375,
"y": 4741.02978515625,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 4539.94189453125,
"y": 4771.01220703125,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 4556.0986328125,
"y": 4762.41748046875,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 5,
"x": 4556.0986328125,
"y": 4762.41748046875,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 6,
"x": 4556.0986328125,
"y": 4762.41748046875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 7,
"x": 4556.0986328125,
"y": 4762.41748046875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 8,
"x": 4556.0986328125,
"y": 4762.41748046875,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
},
{
"id": 9,
"x": 4556.0986328125,
"y": 4762.41748046875,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,98 @@
{
"info": {
"name": "枫丹3-新枫丹科学院-2",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 4498.14990234375,
"y": 4710.7763671875,
"action_params": ""
},
{
"id": 2,
"x": 4494.0791015625,
"y": 4762.04150390625,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 4499.02392578125,
"y": 4825.24072265625,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 4517.81201171875,
"y": 4866.47802734375,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 5,
"x": 4517.81201171875,
"y": 4866.47802734375,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 6,
"x": 4517.81201171875,
"y": 4866.47802734375,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 7,
"x": 4517.81201171875,
"y": 4866.47802734375,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 8,
"x": 4517.2,
"y": 4866.4,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
},
{
"id": 9,
"x": 4517.2,
"y": 4866.4,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,75 @@
{
"info": {
"name": "枫丹3-新枫丹科学院-3",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"x": 4624.357421875,
"y": 4951.77880859375,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "teleport"
},
{
"id": 2,
"x": 4607.47216796875,
"y": 4925.97412109375,
"action": "",
"move_mode": "dash",
"action_params": "",
"type": "path"
},
{
"id": 3,
"x": 4578.63134765625,
"y": 4913.2822265625,
"action": "combat_script",
"move_mode": "walk",
"action_params": "keypress(F)",
"type": "target"
},
{
"id": 4,
"x": 4578.63134765625,
"y": 4913.2822265625,
"action": "combat_script",
"move_mode": "walk",
"action_params": "keypress(F)",
"type": "target"
},
{
"id": 5,
"x": 4578.63134765625,
"y": 4913.2822265625,
"action": "fight",
"move_mode": "walk",
"action_params": "",
"type": "path"
},
{
"id": 6,
"x": 4578.63134765625,
"y": 4913.2822265625,
"action": "fight",
"move_mode": "walk",
"action_params": "",
"type": "path"
},
{
"id": 7,
"x": 4577.7,
"y": 4912.1,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "target"
}
]
}

View File

@@ -0,0 +1,98 @@
{
"info": {
"name": "枫丹3-新枫丹科学院-4",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 4624.37255859375,
"y": 4951.841796875,
"action_params": ""
},
{
"id": 2,
"x": 4635.6494140625,
"y": 4951.49755859375,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 4665.64501953125,
"y": 4970.13671875,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 4679.46875,
"y": 4977.8310546875,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 5,
"x": 4679.46875,
"y": 4977.8310546875,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 6,
"x": 4679.46875,
"y": 4977.8310546875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 7,
"x": 4679.46875,
"y": 4977.8310546875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 8,
"x": 4679.5,
"y": 4977.6,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
},
{
"id": 9,
"x": 4679.5,
"y": 4977.6,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,107 @@
{
"info": {
"name": "枫丹4-柔灯港-1",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"x": 2873.544921875,
"y": 3512.03515625,
"type": "teleport",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 2,
"x": 2890.5087890625,
"y": 3532.46435546875,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 2904.51171875,
"y": 3545.618896484375,
"type": "path",
"move_mode": "climb",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 2929.8173828125,
"y": 3563.57470703125,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 2932.47265625,
"y": 3583.896728515625,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 6,
"x": 2932.47265625,
"y": 3583.896728515625,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 7,
"x": 2932.47265625,
"y": 3583.896728515625,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 8,
"x": 2932.47265625,
"y": 3583.896728515625,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 9,
"x": 2932.30078125,
"y": 3583.9755859375,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
},
{
"id": 10,
"x": 2932.30078125,
"y": 3583.9755859375,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,103 @@
{
"info": {
"name": "枫丹4-柔灯港-2",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"x": 3032.662109375,
"y": 3732.420166015625,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "teleport"
},
{
"id": 2,
"x": 3019.8095703125,
"y": 3712.950927734375,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "target"
},
{
"id": 3,
"x": 3015.82421875,
"y": 3665.193115234375,
"action": "",
"move_mode": "dash",
"action_params": "",
"type": "target"
},
{
"id": 4,
"x": 3010.951171875,
"y": 3624.05029296875,
"action": "",
"move_mode": "dash",
"action_params": "",
"type": "path"
},
{
"id": 5,
"x": 3008.40234375,
"y": 3602.593017578125,
"action": "combat_script",
"move_mode": "walk",
"action_params": "keypress(F)",
"type": "target"
},
{
"id": 6,
"x": 3008.40234375,
"y": 3602.593017578125,
"action": "combat_script",
"move_mode": "walk",
"action_params": "keypress(F)",
"type": "target"
},
{
"id": 7,
"x": 3008.40234375,
"y": 3602.593017578125,
"action": "fight",
"move_mode": "walk",
"action_params": "",
"type": "path"
},
{
"id": 8,
"x": 3008.40234375,
"y": 3602.593017578125,
"action": "fight",
"move_mode": "walk",
"action_params": "",
"type": "path"
},
{
"id": 9,
"x": 3008.4,
"y": 3602.2,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "target",
"locked": false
},
{
"id": 10,
"x": 3008.4,
"y": 3602.2,
"action": "",
"move_mode": "walk",
"action_params": "",
"type": "target"
}
]
}

View File

@@ -0,0 +1,107 @@
{
"info": {
"name": "枫丹4-柔灯港-3",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 3032.6708984375,
"y": 3732.432861328125,
"action_params": ""
},
{
"id": 2,
"x": 3045.591796875,
"y": 3710.537841796875,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 3039.93359375,
"y": 3671.215576171875,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 3055.349609375,
"y": 3641.24462890625,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 3077.185546875,
"y": 3602.835693359375,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 6,
"x": 3077.185546875,
"y": 3602.835693359375,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 7,
"x": 3077.185546875,
"y": 3602.835693359375,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 8,
"x": 3077.185546875,
"y": 3602.835693359375,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 9,
"x": 3077,
"y": 3602.2,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
},
{
"id": 10,
"x": 3077,
"y": 3602.2,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,108 @@
{
"info": {
"name": "枫丹4-柔灯港-4",
"type": "collect",
"author": "平面镜",
"version": "1.0",
"description": "",
"bgiVersion": "0.35.1"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 3032.677734375,
"y": 3732.448486328125,
"action_params": ""
},
{
"id": 2,
"x": 3038.5537109375,
"y": 3718.4228515625,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 3067.19921875,
"y": 3698.43212890625,
"type": "target",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 3079.7314453125,
"y": 3675.759765625,
"type": "path",
"move_mode": "dash",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 3091.7978515625,
"y": 3654.750732421875,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 6,
"x": 3091.7978515625,
"y": 3654.750732421875,
"type": "target",
"move_mode": "walk",
"action": "combat_script",
"action_params": "keypress(F)",
"locked": false
},
{
"id": 7,
"x": 3091.7978515625,
"y": 3654.750732421875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 8,
"x": 3091.7978515625,
"y": 3654.750732421875,
"type": "path",
"move_mode": "walk",
"action": "fight",
"action_params": "",
"locked": false
},
{
"id": 9,
"x": 3092.3,
"y": 3654.3,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
},
{
"id": 10,
"x": 3092.3,
"y": 3654.3,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": "",
"locked": false
}
]
}

View File

@@ -11,19 +11,13 @@
黄花=藏金之花,产出摩拉
脚本函数:
attemptReward(forcerun) 领取奖励
attemptReward(forcerun, retryCount) 领取奖励
closeCustomMarks() 关闭自定义标记
findLeyLineOutcrop() 寻找地脉花位置
openCustomMarks() 打开自定义标记
zoomMap() 缩放地图
*/
(async function () {
try {
/* 调试用
retryCount = 0;
await attemptReward(forcerun);
*/
await genshin.returnMainUi();
setGameMetrics(1920, 1080, 1)
@@ -57,7 +51,7 @@
}
log.info(`国家:${country}`);
// 关闭自动拾取
dispatcher.addTimer(new RealtimeTimer("AutoPick", { forceInteraction: false }));
//dispatcher.addTimer(new RealtimeTimer("AutoPick", { forceInteraction: false }));
// 切换队伍
if (team) {
console.log(`切换至队伍 ${team}`);
@@ -99,7 +93,7 @@
const pathType = type == "蓝花(经验书)" ? "BoR" : "BoW";
for (let i = 1; i <= 6; i++) {
await pathingScript.runFile(`assets/pathing/${pathType}/${forcerunpath}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} catch (error) {
log.info(error.message);
@@ -117,102 +111,116 @@
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "蒙德" && lanhua && lanhua.x > 810 && lanhua.x < 830 && lanhua.y > 880 && lanhua.y < 910 || country == "蒙德" && huanghua && huanghua.x > 810 && huanghua.x < 830 && huanghua.y > 880 && huanghua.y < 910) {
task = "蒙德2-清泉镇";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "蒙德" && lanhua && lanhua.x > 480 && lanhua.x < 490 && lanhua.y > 490 && lanhua.y < 500) {
task = "蒙德3-奔狼领";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "蒙德" && lanhua && lanhua.x > 550 && lanhua.x < 600 && lanhua.y > 150 && lanhua.y < 250 || country == "蒙德" && huanghua && huanghua.x > 550 && huanghua.x < 600 && huanghua.y > 150 && huanghua.y < 250) {
task = "蒙德4-风龙废墟";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "蒙德" && lanhua && lanhua.x > 1380 && lanhua.x < 1390 && lanhua.y > 515 && lanhua.y < 525 || country == "蒙德" && huanghua && huanghua.x > 1380 && huanghua.x < 1390 && huanghua.y > 515 && huanghua.y < 525) {
task = "蒙德5-千风神殿";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "蒙德" && lanhua && lanhua.x > 1280 && lanhua.x < 1290 && lanhua.y > 170 && lanhua.y < 180 || country == "蒙德" && huanghua && huanghua.x > 1280 && huanghua.x < 1290 && huanghua.y > 170 && huanghua.y < 180) {
task = "蒙德6-望风山地";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 5; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "蒙德" && lanhua && lanhua.x > 1100 && lanhua.x < 1300 && lanhua.y > 700 && lanhua.y < 900 || country == "蒙德" && huanghua && huanghua.x > 1100 && huanghua.x < 1300 && huanghua.y > 700 && huanghua.y < 900) {
task = "蒙德7-达达乌帕谷";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 5; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (lanhua && lanhua.x > 1100 && lanhua.x < 1150 && lanhua.y > 300 && lanhua.y < 350) {
task = "璃月1-石门";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
//} else if (lanhua.x > 1350 && lanhua.x < 1400 && lanhua.y > 400 && lanhua.y < 450 && center.x - lanhua.x >= 1050 && center.x - lanhua.x <= 1060 && center.y - lanhua.y >= 90 && center.y - lanhua.y <= 100) {
} else if (lanhua && lanhua.x > 1200 && lanhua.x < 1250 && lanhua.y > 450 && lanhua.y < 500) { // 如果改用碧水原七天神像的中心点的话这个也要改
task = "璃月3-瑶光滩";
log.info(`执行策略:${task}`);
await pathingScript.runFile(`assets/pathing/BoR/${task}-1.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
} else if (lanhua && lanhua.x > 220 && lanhua.x < 270 && lanhua.y > 900 && lanhua.y < 950) {
task = "稻妻3-八酝岛";
log.info(`执行策略:${task}`);
await pathingScript.runFile(`assets/pathing/BoR/${task}-1.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
} else if (country == "枫丹" && huanghua && huanghua.x > 700 && huanghua.x < 900 && huanghua.y > 900 && huanghua.y < 1100) {
task = "枫丹1-秋分山西侧";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 5; i++) {
await pathingScript.runFile(`assets/pathing/BoW/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "枫丹" && lanhua && lanhua.x > 300 && lanhua.x < 500 && lanhua.y > 700 && lanhua.y < 900) {
task = "枫丹2-芒索斯山东麓";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "枫丹" && lanhua && lanhua.x > 700 && lanhua.x < 800 && lanhua.y > 400 && lanhua.y < 650) {
task = "枫丹3-新枫丹科学院";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun, retryCount);
}
} else if (country == "枫丹" && lanhua && lanhua.x > 1800 && lanhua.x < 1900 && lanhua.y > 100 && lanhua.y < 200) {
task = "枫丹4-柔灯港";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun, retryCount);
}
} else if (country == "枫丹" && lanhua && lanhua.x > 800 && lanhua.x < 1000 && lanhua.y > 800 && lanhua.y < 1000 || country == "枫丹" && huanghua && huanghua.x > 800 && huanghua.x < 1000 && huanghua.y > 800 && huanghua.y < 1000) {
task = "枫丹5-秋分山东侧";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (country == "枫丹" && lanhua && lanhua.x > 300 && lanhua.x < 500 && lanhua.y > 900 && lanhua.y < 1000) {
task = "枫丹6-厄里那斯";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 6; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else if (lanhua && lanhua.x > 1100 && lanhua.x < 1200 && lanhua.y > 750 && lanhua.y < 850) {
task = "纳塔5-圣火竞技场";
log.info(`执行策略:${task}`);
for (let i = 1; i <= 4; i++) {
await pathingScript.runFile(`assets/pathing/BoR/${task}-${i}.json`);
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
} else {
@@ -228,7 +236,7 @@
}
})();
async function attemptReward(forcerun) {
async function attemptReward(forcerun, retryCount) {
// 超时处理
if (retryCount >= 5 && forcerun == false) {
retryCount = 0;
@@ -248,43 +256,45 @@ async function attemptReward(forcerun) {
let isValid = false;
let condensedResin = null;
let originalResin = null;
let isResinEmpty = false;
if (resList && resList.count > 0) {
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
if (res.text.includes("使用浓缩树脂")) {
isValid = true;
condensedResin = res;
} else if (res.text.includes("使用原粹树脂")) {
isValid = true;
originalResin = res;
} else if (res.text.includes("补充原粹树脂")) {
// 树脂用完了,结束脚本
isValid = true;
log.error("识别到补充原粹树脂,看来树脂用完了呢");
await keyPress("VK_ESCAPE");
throw new Error("树脂已用完");
isResinEmpty = true;
}
}
if (condensedResin) {
isValid = true;
log.info("选择使用浓缩树脂");
click(Math.round(condensedResin.x + condensedResin.width / 2), Math.round(condensedResin.y + condensedResin.height / 2));
return;
} else if (originalResin) {
isValid = true;
log.info("选择使用原粹树脂");
click(Math.round(originalResin.x + originalResin.width / 2), Math.round(originalResin.y + originalResin.height / 2));
return;
} else if (isResinEmpty) {
log.error("识别到补充原粹树脂,看来树脂用完了呢");
await keyPress("VK_ESCAPE");
throw new Error("树脂已用完");
}
}
// 重试
if (!isValid) {
log.info("当前界面不是地脉之花界面,重新执行代码");
log.info("当前界面不是地脉之花界面,重");
await genshin.returnMainUi();
await sleep(1000);
retryCount++;
await attemptReward(forcerun);
await attemptReward(forcerun, retryCount);
}
}
async function closeCustomMarks() {
@@ -491,25 +501,4 @@ async function openCustomMarks() {
log.error("未找到开关按钮");
}
await genshin.returnMainUi();
}
// 纯点击的缩放地图,已弃用
async function zoomMap() {
// 缩小地图
await sleep(1000);
await click(50, 640);
await sleep(500);
await click(50, 640);
await sleep(500);
await click(50, 640);
await sleep(500);
await click(50, 640);
await sleep(500);
await click(50, 640);
await sleep(500);
// 放大
await click(50, 450);
await sleep(500);
await click(50, 450);
await sleep(500);
}

View File

@@ -1,16 +1,17 @@
{
"manifest_version": 1,
"name": "全自动地脉花",
"version": "1.0",
"version": "2.0",
"bgi_version": "0.44.3",
"description": "基于OCR图像识别的全自动刷取地脉花。\n感谢 平面镜 制作的枫丹地脉花脚本,本脚本在该脚本的基础上修改而来。\n\n💡更多信息请查看在线手册https://hcnsvf0s8d0s.feishu.cn/wiki/Tb1twpThLi7UlykqcYOcuccTnjJ \n\n----------注意事项----------\n●仅支持BetterGI 0.44.3 及以上版本!\n●脚本仍未完成没有出现的路线还未制作请耐心等待。目前只有蒙德是全部路线其他国家请使用强制运行模式。\n●目前脚本能力有限暂时不支持识别地脉花是否已经开启请确保队伍的练度足够中途出现角色血量过低或倒下会无法继续届时需要在重新运行时手动关闭领取地脉花奖励的界面。\n●脚本还提供了强行运行的功能当无法识别地脉花位置时可以指定线路脚本将不再对地脉花进行识别即使没有领取到奖励也会继续运行适用于路线重跑以及开发调试。\n●运行时会传送到七天神像设置中设置的七天神像可能需要关闭七天神像设置中的“是否就近七天神像恢复血量”并指定七天神像。\n●战斗策略注意调度器设置中地图追踪行走配置里的“允许在JsSpript中使用”和“覆盖JS中的自动战斗配置”只有在都打开的情况下脚本才会使用下面的战斗配置否则会使用独立任务中的战斗策略。",
"description": "基于OCR图像识别的全自动刷取地脉花。\n💡更多信息请查看在线手册https://hcnsvf0s8d0s.feishu.cn/wiki/Tb1twpThLi7UlykqcYOcuccTnjJ \n\n----------注意事项----------\n●仅支持BetterGI 0.44.3 及以上版本!\n●脚本仍未完成没有出现的路线还未制作请耐心等待。目前只有蒙德是全部路线其他国家请使用强制运行模式。\n●目前脚本能力有限暂时不支持识别地脉花是否已经开启请确保队伍的练度足够中途出现角色血量过低或倒下会无法继续届时需要在重新运行时手动关闭领取地脉花奖励的界面。\n●脚本还提供了强行运行的功能当无法识别地脉花位置时可以指定线路脚本将不再对地脉花进行识别即使没有领取到奖励也会继续运行适用于路线重跑以及开发调试。\n●运行时会传送到七天神像设置中设置的七天神像可能需要关闭七天神像设置中的“是否就近七天神像恢复血量”并指定七天神像。\n●战斗策略注意调度器设置中地图追踪行走配置里的“允许在JsSpript中使用”和“覆盖JS中的自动战斗配置”只有在都打开的情况下脚本才会使用下面的战斗配置否则会使用独立任务中的战斗策略。",
"authors": [
{
"name": "ddaodan",
"link": "https://github.com/ddaodan"
},
{
"name": "平面镜"
"name": "平面镜",
"link": "https://github.com/Flatmirrr"
}
],
"settings_ui": "settings.json",

View File

@@ -59,8 +59,8 @@
//"(WIP)须弥",
"枫丹1-秋分山西侧",
"枫丹2-芒索斯山东麓",
//"枫丹3-新枫丹科学院",
//"枫丹4-柔灯港",
"枫丹3-新枫丹科学院",
"枫丹4-柔灯港",
"枫丹5-秋分山东侧",
"枫丹6-厄里那斯",
"纳塔5-圣火竞技场"