From e28b0002678811297b7ffc2fd46ce4e2cbf6535a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E4=B8=8A=E7=9A=84=E8=9D=8E=E5=AD=90?= Date: Mon, 24 Mar 2025 21:38:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=89=8D=E5=BE=80=E9=93=81=E5=8C=A0=E9=93=BA=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E9=AD=94=E7=9F=BF=EF=BC=8C=E9=87=8D=E6=96=B0=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=B0=B4=E6=99=B6=E9=94=BB=E9=80=A0=E9=AD=94=E7=9F=BF=20(#462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 添加自动前往铁匠铺领取魔矿,重新使用水晶锻造魔矿 1. 自动前往铁匠铺领取魔矿,重新使用水晶锻造魔矿。 2. 默认情况选择枫丹铁匠铺。 3. 由于地图追踪功能不支持室内,故不支持纳塔铁匠铺锻造魔矿。 * Fixs: 自动锻造执行时忘记去掉备注 1.自动锻造执行时忘记去掉备注 --- repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json | 57 +++++++++++++++ repo/js/AutoSmithyOre/assets/璃月铁匠铺.json | 65 +++++++++++++++++ repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json | 66 +++++++++++++++++ repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json | 53 ++++++++++++++ repo/js/AutoSmithyOre/assets/须弥铁匠铺.json | 75 ++++++++++++++++++++ repo/js/AutoSmithyOre/main.js | 48 +++++++++++++ repo/js/AutoSmithyOre/manifest.json | 14 ++++ repo/js/AutoSmithyOre/settings.json | 14 ++++ 8 files changed, 392 insertions(+) create mode 100644 repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json create mode 100644 repo/js/AutoSmithyOre/assets/璃月铁匠铺.json create mode 100644 repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json create mode 100644 repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json create mode 100644 repo/js/AutoSmithyOre/assets/须弥铁匠铺.json create mode 100644 repo/js/AutoSmithyOre/main.js create mode 100644 repo/js/AutoSmithyOre/manifest.json create mode 100644 repo/js/AutoSmithyOre/settings.json diff --git a/repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json b/repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json new file mode 100644 index 00000000..647c6417 --- /dev/null +++ b/repo/js/AutoSmithyOre/assets/枫丹铁匠铺.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/repo/js/AutoSmithyOre/assets/璃月铁匠铺.json b/repo/js/AutoSmithyOre/assets/璃月铁匠铺.json new file mode 100644 index 00000000..d5f95c5f --- /dev/null +++ b/repo/js/AutoSmithyOre/assets/璃月铁匠铺.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json b/repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json new file mode 100644 index 00000000..b62870df --- /dev/null +++ b/repo/js/AutoSmithyOre/assets/稻妻铁匠铺.json @@ -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": "" + } + ] +} \ No newline at end of file diff --git a/repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json b/repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json new file mode 100644 index 00000000..b4bf8246 --- /dev/null +++ b/repo/js/AutoSmithyOre/assets/蒙德铁匠铺.json @@ -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": "" + } + ] +} \ No newline at end of file diff --git a/repo/js/AutoSmithyOre/assets/须弥铁匠铺.json b/repo/js/AutoSmithyOre/assets/须弥铁匠铺.json new file mode 100644 index 00000000..727c778d --- /dev/null +++ b/repo/js/AutoSmithyOre/assets/须弥铁匠铺.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/repo/js/AutoSmithyOre/main.js b/repo/js/AutoSmithyOre/main.js new file mode 100644 index 00000000..047f8c3d --- /dev/null +++ b/repo/js/AutoSmithyOre/main.js @@ -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); +})(); diff --git a/repo/js/AutoSmithyOre/manifest.json b/repo/js/AutoSmithyOre/manifest.json new file mode 100644 index 00000000..d55d3707 --- /dev/null +++ b/repo/js/AutoSmithyOre/manifest.json @@ -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" +} \ No newline at end of file diff --git a/repo/js/AutoSmithyOre/settings.json b/repo/js/AutoSmithyOre/settings.json new file mode 100644 index 00000000..677ff117 --- /dev/null +++ b/repo/js/AutoSmithyOre/settings.json @@ -0,0 +1,14 @@ +[ + { + "name": "smithyName", // 变量名,在js内使用 settings.变量名 获取对应的配置值 + "type": "select", // 类型 + "label": "选择铁匠铺(默认:枫丹铁匠铺)", + "options": [ + "蒙德铁匠铺", + "璃月铁匠铺", + "稻妻铁匠铺", + "须弥铁匠铺", + "枫丹铁匠铺" + ] + } + ]