auto artifacts: fix two stuck points (#435)
This commit is contained in:
@@ -48,7 +48,19 @@
|
|||||||
"move_mode": "walk",
|
"move_mode": "walk",
|
||||||
"#": "3"
|
"#": "3"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"x": 9688.345703125,
|
||||||
|
"y": 230.91455078125,
|
||||||
|
"type": "target",
|
||||||
|
"move_mode": "walk",
|
||||||
|
"#": "3"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"x": 9694.974609375,
|
||||||
|
"y": 220.93896484375,
|
||||||
|
"type": "orientation"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"x": 9694.974609375,
|
"x": 9694.974609375,
|
||||||
"y": 220.93896484375,
|
"y": 220.93896484375,
|
||||||
|
|||||||
@@ -33,6 +33,14 @@
|
|||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"action_params": "wait(0.8)",
|
"action_params": "wait(0.8)",
|
||||||
"#" : "2"
|
"#" : "2"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"x": 3890.994140625,
|
||||||
|
"y": 2429.1708984375,
|
||||||
|
"type": "path",
|
||||||
|
"move_mode": "dash",
|
||||||
|
"//": "跑远,防止'揭示之书'和地图缩放按钮重叠导致地图识别失败"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
const pathingB = [
|
const pathingB = [
|
||||||
"狗粮-枫丹-枫丹庭区-3个.json",
|
"狗粮-枫丹-枫丹庭区-3个.json",
|
||||||
"狗粮-枫丹-白露区-秋分山东侧-2个-f.json",
|
"狗粮-枫丹-白露区-秋分山东侧-2个-f~m.json",
|
||||||
"狗粮-枫丹-伊黎耶林区-欧庇克莱歌剧院东南-2个-f.json",
|
"狗粮-枫丹-伊黎耶林区-欧庇克莱歌剧院东南-2个-f.json",
|
||||||
"(恢复)狗粮-枫丹-研究院区.json",
|
"(恢复)狗粮-枫丹-研究院区.json",
|
||||||
"狗粮-枫丹-研究院区-学术会堂-1个/2个-f.json",
|
"狗粮-枫丹-研究院区-学术会堂-1个/2个-f.json",
|
||||||
@@ -122,16 +122,39 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 调整地图
|
// 调整地图
|
||||||
async function resizeMap() {
|
async function resizeMap(level = 1) {
|
||||||
// zoom map to 75%
|
|
||||||
keyPress("M"); await sleep(1000);
|
keyPress("M"); await sleep(1000);
|
||||||
for (let i = 0; i < 5; i++) {
|
for (let i = 5; i > 0; --i) {
|
||||||
click(42, 420); await sleep(500); // zoom in
|
click(46, 436); await sleep(500); // zoom in
|
||||||
|
}
|
||||||
|
for (let i = 0; i < level; ++i) {
|
||||||
|
click(46, 630); await sleep(500); // zoom out
|
||||||
}
|
}
|
||||||
click(42, 645); await sleep(1000); // zoom out
|
|
||||||
keyPress("M"); await sleep(1000);
|
keyPress("M"); await sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 拖拽地图
|
||||||
|
async function dragMap(byX, byY) {
|
||||||
|
let byL = Math.sqrt(byX * byX + byY * byY);
|
||||||
|
let d = 5;
|
||||||
|
|
||||||
|
let dx = Math.round(d * byX / byL);
|
||||||
|
let dy = Math.round(d * byY / byL);
|
||||||
|
|
||||||
|
let times = Math.round(byX / dx) * 2; // ???
|
||||||
|
|
||||||
|
log.debug(`byL: ${byL}; dx: ${dx}; dy: ${dy}; times: ${times};`);
|
||||||
|
|
||||||
|
keyPress("M"); await sleep(1000);
|
||||||
|
moveMouseBy(-byX, -byY); await sleep(300);
|
||||||
|
|
||||||
|
leftButtonDown(); await sleep(300);
|
||||||
|
for (let i = 0; i < times; ++i) {
|
||||||
|
moveMouseBy(dx, dy); await sleep(30);
|
||||||
|
}
|
||||||
|
leftButtonUp(); await sleep(300);
|
||||||
|
}
|
||||||
|
|
||||||
// 分解圣遗物
|
// 分解圣遗物
|
||||||
async function salvage() {
|
async function salvage() {
|
||||||
if (!autoSalvage) return;
|
if (!autoSalvage) return;
|
||||||
@@ -183,6 +206,14 @@
|
|||||||
//执行路径追踪脚本
|
//执行路径追踪脚本
|
||||||
log.info(filePath);
|
log.info(filePath);
|
||||||
await pathingScript.runFile(filePath);
|
await pathingScript.runFile(filePath);
|
||||||
|
|
||||||
|
// 地图缩放按键同某些地图标识重叠,导致识别失败(bgi[v0.43.0]后引入)
|
||||||
|
// 完成路径后,拖拽地图,并就近传送。仍有问题,到下个路径时会关闭地图再打开。
|
||||||
|
// let shouldDragMap_after = filePath.search("~m") != -1;
|
||||||
|
// if (shouldDragMap_after) await dragMap(-50, 50);
|
||||||
|
// 完成路径后,放大地图。仍可能被缩小回去。
|
||||||
|
// let shouldDragMap_after = filePath.search("~m") != -1;
|
||||||
|
// if (shouldDragMap_after) await resizeMap(0);
|
||||||
}
|
}
|
||||||
catch (error) { // bgi已捕获可预期异常,此处仅做兜底
|
catch (error) { // bgi已捕获可预期异常,此处仅做兜底
|
||||||
log.error(error.toString());
|
log.error(error.toString());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 1,
|
"manifest_version": 1,
|
||||||
"name": "狗粮ABE路线,自动拾取分解",
|
"name": "狗粮ABE路线,自动拾取分解",
|
||||||
"version": "2.3.4",
|
"version": "2.3.5",
|
||||||
"bgi_version": "0.42.0",
|
"bgi_version": "0.42.0",
|
||||||
"description": "圣遗物狗粮AB及额外路线,自动轮换,自动分解,就近恢复。",
|
"description": "圣遗物狗粮AB及额外路线,自动轮换,自动分解,就近恢复。",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|||||||
@@ -48,7 +48,19 @@
|
|||||||
"move_mode": "walk",
|
"move_mode": "walk",
|
||||||
"#": "3"
|
"#": "3"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"x": 9688.345703125,
|
||||||
|
"y": 230.91455078125,
|
||||||
|
"type": "target",
|
||||||
|
"move_mode": "walk",
|
||||||
|
"#": "3"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"x": 9694.974609375,
|
||||||
|
"y": 220.93896484375,
|
||||||
|
"type": "orientation"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"x": 9694.974609375,
|
"x": 9694.974609375,
|
||||||
"y": 220.93896484375,
|
"y": 220.93896484375,
|
||||||
|
|||||||
@@ -33,6 +33,14 @@
|
|||||||
"action": "combat_script",
|
"action": "combat_script",
|
||||||
"action_params": "wait(0.8)",
|
"action_params": "wait(0.8)",
|
||||||
"#" : "2"
|
"#" : "2"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"x": 3890.994140625,
|
||||||
|
"y": 2429.1708984375,
|
||||||
|
"type": "path",
|
||||||
|
"move_mode": "dash",
|
||||||
|
"//": "跑远,防止'揭示之书'和地图缩放按钮重叠导致地图识别失败"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user