feat: 添加自动前往铁匠铺领取魔矿,重新使用水晶锻造魔矿 (#462)
* feat: 添加自动前往铁匠铺领取魔矿,重新使用水晶锻造魔矿 1. 自动前往铁匠铺领取魔矿,重新使用水晶锻造魔矿。 2. 默认情况选择枫丹铁匠铺。 3. 由于地图追踪功能不支持室内,故不支持纳塔铁匠铺锻造魔矿。 * Fixs: 自动锻造执行时忘记去掉备注 1.自动锻造执行时忘记去掉备注
This commit is contained in:
57
repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json
Normal file
57
repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "枫丹铁匠铺",
|
||||
"type": "collect",
|
||||
"author": "寒露",
|
||||
"version": "1.0",
|
||||
"description": "自动寻找枫丹铁匠铺",
|
||||
"bgiVersion": "0.42.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4509.96044921875,
|
||||
"y": 3630.826904296875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4519.625237285377,
|
||||
"y": 3604.75,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4542.001993197164,
|
||||
"y": 3597,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4561.749952542925,
|
||||
"y": 3596.25,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4580.500332199527,
|
||||
"y": 3603.75,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
65
repo/js/AutoSmithyOre/assets/璃月铁匠铺.json
Normal file
65
repo/js/AutoSmithyOre/assets/璃月铁匠铺.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "璃月铁匠铺",
|
||||
"type": "collect",
|
||||
"author": "寒露",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.42.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 267.89999999999964,
|
||||
"y": -665.1000000000004,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 245.8753796566034,
|
||||
"y": -663.625,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 228.6251898283008,
|
||||
"y": -662.125,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 211.0001423712256,
|
||||
"y": -663,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 196.3759965985828,
|
||||
"y": -677.75,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 187.12528474245119,
|
||||
"y": -668.125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
66
repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json
Normal file
66
repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "稻妻铁匠铺",
|
||||
"type": "collect",
|
||||
"author": "寒露",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.42.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -4400,
|
||||
"y": -3051,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -4397.72,
|
||||
"y": -3048.94,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"action": "stop_flying",
|
||||
"move_mode": "fly",
|
||||
"type": "path",
|
||||
"x": -4373.5,
|
||||
"y": -3013.25,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": -4366.88,
|
||||
"y": -3006.5,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "target",
|
||||
"x": -4353.875,
|
||||
"y": -3010.72,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path",
|
||||
"x": -4356,
|
||||
"y": -3017.375,
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
53
repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json
Normal file
53
repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "蒙德凯瑟琳",
|
||||
"type": "collect",
|
||||
"author": "寒露",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.42.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -867.6884765625,
|
||||
"y": 2281.365966796875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -883.1246203433966,
|
||||
"y": 2261.875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -893.874762714624,
|
||||
"y": 2250.125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": -924.0010915127332,
|
||||
"y": 2232.875,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": -922.9964881764263,
|
||||
"y": 2215.0625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
75
repo/js/AutoSmithyOre/assets/须弥铁匠铺.json
Normal file
75
repo/js/AutoSmithyOre/assets/须弥铁匠铺.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "须弥铁匠铺",
|
||||
"type": "collect",
|
||||
"author": "寒露",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.42.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 2792.8877184961875,
|
||||
"y": -490.5,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2788.874810171699,
|
||||
"y": -487.875,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 2772.374667800472,
|
||||
"y": -479.75,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 2770.000332199528,
|
||||
"y": -465.875,
|
||||
"action": "",
|
||||
"move_mode": "run",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 2764.5009491415058,
|
||||
"y": -458.65625,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"x": 2763.6251423712256,
|
||||
"y": -444.75,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"x": 2775.218904235495,
|
||||
"y": -442.03125,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"action_params": "",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
48
repo/js/AutoSmithyOre/main.js
Normal file
48
repo/js/AutoSmithyOre/main.js
Normal file
@@ -0,0 +1,48 @@
|
||||
(async function () {
|
||||
///
|
||||
// 读取用户配置
|
||||
///
|
||||
let smithyName = settings.smithyName != undefined ? settings.smithyName : "枫丹铁匠铺";
|
||||
|
||||
///
|
||||
// 定义函数
|
||||
///
|
||||
// 自动前往铁匠铺
|
||||
async function autoSmithy(smithyName) {
|
||||
log.info(`自动前往${smithyName}`);
|
||||
try {
|
||||
let filePath = `assets/${smithyName}.json`;
|
||||
await pathingScript.runFile(filePath);
|
||||
} catch (error) {
|
||||
log.error(`执行 ${smithyName} 路径时发生错误`);
|
||||
log.error(error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
const forgeOre = async function (smithyName) {
|
||||
await sleep(1000);
|
||||
keyPress("F"); await sleep(1000); // 开始交互
|
||||
await click(960, 600); await sleep(1000); // 跳过第一个对话
|
||||
await click(960, 600); await sleep(1000); // 跳过第一个对话
|
||||
await click(1375, 500); await sleep(1000);
|
||||
await click(960, 600); await sleep(1000); // 跳过第二个对话
|
||||
await click(960, 600); await sleep(1000); // 跳过第二个对话
|
||||
await click(520, 140); await sleep(1000); // 选择锻造队列
|
||||
await click(170, 1010); await sleep(1000); // 领取全部
|
||||
await click(960, 900); await sleep(1000); // 确认
|
||||
await click(220, 140); await sleep(1000); // 选择配方
|
||||
await click(540, 270); await sleep(1000); // 选择魔矿
|
||||
await click(1750, 1020); await sleep(1000); // 3次锻造魔矿
|
||||
await click(1750, 1020); await sleep(1000);
|
||||
await click(1750, 1020); await sleep(2000);
|
||||
await click(960, 600); await sleep(2000);
|
||||
await click(1840, 45); await sleep(1000); // 退出锻造界面
|
||||
}
|
||||
|
||||
///
|
||||
// main
|
||||
///
|
||||
setGameMetrics(1920, 1080, 1);
|
||||
await autoSmithy(smithyName);
|
||||
await forgeOre(smithyName);
|
||||
})();
|
||||
14
repo/js/AutoSmithyOre/manifest.json
Normal file
14
repo/js/AutoSmithyOre/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "自动锻造魔矿",
|
||||
"version": "1.0",
|
||||
"description": "自动选择铁匠铺去锻造魔矿,默认选择枫丹铁匠铺;可选择其他地区铁匠铺。由于地图追踪功能不支持室内定位,所以不支持纳塔铁匠铺。",
|
||||
"authors": [
|
||||
{
|
||||
"name": "寒露",
|
||||
"link": "https://github.com/lwwens"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
14
repo/js/AutoSmithyOre/settings.json
Normal file
14
repo/js/AutoSmithyOre/settings.json
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"name": "smithyName", // 变量名,在js内使用 settings.变量名 获取对应的配置值
|
||||
"type": "select", // 类型
|
||||
"label": "选择铁匠铺(默认:枫丹铁匠铺)",
|
||||
"options": [
|
||||
"蒙德铁匠铺",
|
||||
"璃月铁匠铺",
|
||||
"稻妻铁匠铺",
|
||||
"须弥铁匠铺",
|
||||
"枫丹铁匠铺"
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user