自动锻造魔矿 (#533)

* Create 铁匠铺

自动选择铁匠铺和使用矿物锻造魔矿。
注1:默认选择枫丹铁匠铺,可选择其他地区铁匠铺。由于地图追踪功能不支持室内定位,所以不支持纳塔铁匠铺;
注2:可选使用水晶矿(默认)、紫晶矿、萃凝晶。
注3:需要每种矿至少能合成一次。
鸣谢:寒露,蜜柑魚

* Delete repo/js/铁匠铺

* Create 草稿

* Add files via upload

* Add files via upload

* Delete repo/js/铁匠铺/assets/草稿
This commit is contained in:
呱呱z
2025-04-07 21:38:59 +08:00
committed by GitHub
parent 6dbbf276ba
commit cf53a439a8
8 changed files with 415 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
{
"info": {
"name": "枫丹铁匠铺",
"type": "collect",
"author": "寒露",
"version": "1.0",
"description": "",
"bgiVersion": "0.42.3"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "run",
"type": "teleport",
"x": 4514.0908203125,
"y": 3630.588623046875,
"action_params": ""
},
{
"id": 2,
"x": 4518.59765625,
"y": 3601.3916015625,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 4563.74755859375,
"y": 3593.390869140625,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 4580.56640625,
"y": 3603.6337890625,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,75 @@
{
"info": {
"name": "璃月铁匠铺",
"type": "collect",
"author": "寒露",
"version": "1.0",
"description": "",
"bgiVersion": "0.42.3"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 269.6123046875,
"y": -666.208984375,
"action_params": ""
},
{
"id": 2,
"x": 253.6806640625,
"y": -661.6376953125,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 230.4423828125,
"y": -664.1513671875,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 208.1728515625,
"y": -665.02685546875,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 196.900390625,
"y": -677.50244140625,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 6,
"x": 190.3271484375,
"y": -671.70361328125,
"type": "path",
"move_mode": "climb",
"action": "",
"action_params": ""
},
{
"id": 7,
"x": 186.5703125,
"y": -669.265625,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View 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.716796875,
"y": -3050.6962890625,
"action_params": ""
},
{
"id": 2,
"x": -4401.98046875,
"y": -3049.376953125,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": -4367.287109375,
"y": -3005.3388671875,
"type": "path",
"move_mode": "fly",
"action": "stop_flying",
"action_params": ""
},
{
"id": 4,
"x": -4352.150390625,
"y": -3010.88671875,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": -4358.37890625,
"y": -3019.78125,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 6,
"x": -4355.751953125,
"y": -3017.388671875,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,48 @@
{
"info": {
"name": "蒙德铁匠铺",
"type": "collect",
"author": "寒露",
"version": "1.0",
"description": "",
"bgiVersion": "0.42.3"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": -875.2568359375,
"y": 2277.54150390625,
"action_params": ""
},
{
"id": 2,
"x": -891.330078125,
"y": 2257.5595703125,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": -921.8359375,
"y": 2232.016845703125,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": -922.5673828125,
"y": 2215.397216796875,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,57 @@
{
"info": {
"name": "须弥铁匠铺",
"type": "collect",
"author": "寒露",
"version": "1.0",
"description": "",
"bgiVersion": "0.42.3"
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "run",
"type": "teleport",
"x": 2790.654296875,
"y": -480.79833984375,
"action_params": ""
},
{
"id": 2,
"x": 2788.931640625,
"y": -488.74267578125,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 2769.771484375,
"y": -474.86669921875,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
},
{
"id": 4,
"x": 2760.16796875,
"y": -437.6982421875,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 2774.830078125,
"y": -441.640625,
"type": "target",
"move_mode": "walk",
"action": "",
"action_params": ""
}
]
}

84
repo/js/铁匠铺/main.js Normal file
View File

@@ -0,0 +1,84 @@
(async function () {
///
// 读取用户配置
///
let smithyName = settings.smithyName != undefined ? settings.smithyName : "须弥铁匠铺";
let ore = settings.ore != undefined ? settings.ore : '';
///
// 定义函数
///
// 自动前往铁匠铺
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());
}
}
//确认使用矿石
function determineOre() {
if (ore == '水晶块')
{log.info("将使用 水晶块 锻造矿石");}
else if (ore == '紫晶块')
{log.info("将使用 紫晶块 锻造矿石");}
else if (ore == '萃凝晶')
{log.info("将使用 萃凝晶 锻造矿石");}
else
{log.info("无指定矿石,将使用 水晶块 锻造矿石");}
}
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); // 领取全部
log.info("已进入锻造界面,开始锻造");
// 点击"配方"
click(220, 150);
await sleep(1000);
// 根据用户选择的矿石进行锻造
if (ore == '水晶块')
{click(545, 290);}
else if (ore == '紫晶块')
{click(685, 290);}
else if (ore == '萃凝晶')
{click(120, 455);}
else {
// 无指定矿石,将使用 水晶块 锻造矿石
click(545, 290);
}
await sleep(1000);
// 按合成按钮3次
click(1645, 1015);
await sleep(4000);
click(1645, 1015);
await sleep(4000);
click(1645, 1015);
await sleep(4000);
log.info("锻造结束,退出画面");
// 退出锻造界面
click(1845, 45);
await sleep(1000);
}
///
// main
///
setGameMetrics(1920, 1080, 1);
await autoSmithy(smithyName);// 设置游戏窗口大小和DPI
await forgeOre(smithyName);
determineOre();
})();

View File

@@ -0,0 +1,13 @@
{
"manifest_version": 1,
"name": "自动锻造魔矿",
"version": "1.0",
"description": "自动选择铁匠铺和使用矿物去锻造魔矿。\n注1:默认选择枫丹铁匠铺,可选择其他地区铁匠铺。由于地图追踪功能不支持室内定位,所以不支持纳塔铁匠铺;\n注2:可选使用水晶矿(默认)、紫晶矿、萃凝晶。\n注3:需要每种矿至少能合成一次。\n鸣谢:寒露,蜜柑魚",
"authors": [
{
"name": "呱呱z",
}
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -0,0 +1,24 @@
[
{
"name": "smithyName", // 变量名在js内使用 settings.变量名 获取对应的配置值
"type": "select", // 类型
"label": "选择铁匠铺(默认:枫丹铁匠铺)",
"options": [
"蒙德铁匠铺",
"璃月铁匠铺",
"稻妻铁匠铺",
"须弥铁匠铺",
"枫丹铁匠铺"
]
},
{
"name": "ore",
"type": "select",
"label": "锻造用矿(默认:水晶矿)",
"options": [
"水晶矿",
"紫晶块",
"萃凝晶"
]
}
]