From 3aedbaac5677d7af86ec689ad94d53b14c4d638f Mon Sep 17 00:00:00 2001 From: this-Fish Date: Fri, 21 Mar 2025 00:33:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E8=87=AA=E5=8B=95=E5=8C=96?= =?UTF-8?q?=E5=90=88=E7=A4=A6=E5=8F=96=E7=A4=A6=20(#452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 拆分自動化合礦取礦 拆分自動化合礦取礦、讓使用者更簡單明了的使用 * Delete repo/js/到枫丹打鐵合礦領礦 directory --- .../assets/AutoPath/到枫丹打鐵.json | 46 +++++---- repo/js/到枫丹打鐵合礦/main.js | 79 ++++++++++++++++ repo/js/到枫丹打鐵合礦/manifest.json | 13 +++ repo/js/到枫丹打鐵合礦/settings.json | 12 +++ repo/js/到枫丹打鐵合礦領礦/main.js | 94 ------------------- repo/js/到枫丹打鐵合礦領礦/manifest.json | 13 --- repo/js/到枫丹打鐵合礦領礦/settings.json | 20 ---- .../assets/AutoPath/到枫丹打鐵.json | 67 +++++++++++++ repo/js/到枫丹打鐵領礦/main.js | 47 ++++++++++ repo/js/到枫丹打鐵領礦/manifest.json | 12 +++ 10 files changed, 258 insertions(+), 145 deletions(-) rename repo/js/{到枫丹打鐵合礦領礦 => 到枫丹打鐵合礦}/assets/AutoPath/到枫丹打鐵.json (63%) create mode 100644 repo/js/到枫丹打鐵合礦/main.js create mode 100644 repo/js/到枫丹打鐵合礦/manifest.json create mode 100644 repo/js/到枫丹打鐵合礦/settings.json delete mode 100644 repo/js/到枫丹打鐵合礦領礦/main.js delete mode 100644 repo/js/到枫丹打鐵合礦領礦/manifest.json delete mode 100644 repo/js/到枫丹打鐵合礦領礦/settings.json create mode 100644 repo/js/到枫丹打鐵領礦/assets/AutoPath/到枫丹打鐵.json create mode 100644 repo/js/到枫丹打鐵領礦/main.js create mode 100644 repo/js/到枫丹打鐵領礦/manifest.json diff --git a/repo/js/到枫丹打鐵合礦領礦/assets/AutoPath/到枫丹打鐵.json b/repo/js/到枫丹打鐵合礦/assets/AutoPath/到枫丹打鐵.json similarity index 63% rename from repo/js/到枫丹打鐵合礦領礦/assets/AutoPath/到枫丹打鐵.json rename to repo/js/到枫丹打鐵合礦/assets/AutoPath/到枫丹打鐵.json index 8c813f78..045521ab 100644 --- a/repo/js/到枫丹打鐵合礦領礦/assets/AutoPath/到枫丹打鐵.json +++ b/repo/js/到枫丹打鐵合礦/assets/AutoPath/到枫丹打鐵.json @@ -5,53 +5,63 @@ "author": "密柑魚", "version": "1.0", "description": "", - "bgiVersion": "0.35.1" + "bgiVersion": "0.42.3" }, "positions": [ { "id": 1, - "action": "", - "move_mode": "walk", - "type": "teleport", "x": 4514.18, "y": 3630.3999999999996, - "action_params": "" + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "teleport" }, { "id": 2, "x": 4520.380859375, "y": 3606.239501953125, - "type": "path", - "move_mode": "run", "action": "", - "action_params": "" + "move_mode": "run", + "action_params": "", + "type": "path" }, { "id": 3, "x": 4560.19189453125, "y": 3598.05615234375, - "type": "path", - "move_mode": "run", "action": "", - "action_params": "" + "move_mode": "run", + "action_params": "", + "type": "path" }, { "id": 4, "x": 4581.005859375, "y": 3599.1630859375, - "type": "path", - "move_mode": "run", "action": "", - "action_params": "" + "move_mode": "run", + "action_params": "", + "type": "path" }, { "id": 5, - "x": 4579.80, + "x": 4579.8, "y": 3605.452, - "type": "path", - "move_mode": "walk", "action": "", - "action_params": "" + "move_mode": "walk", + "action_params": "", + "type": "path", + "locked": false + }, + { + "id": 6, + "x": 4579.85, + "y": 3605.45, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" } ] } \ No newline at end of file diff --git a/repo/js/到枫丹打鐵合礦/main.js b/repo/js/到枫丹打鐵合礦/main.js new file mode 100644 index 00000000..b4a59b3b --- /dev/null +++ b/repo/js/到枫丹打鐵合礦/main.js @@ -0,0 +1,79 @@ +(async function () { + + async function AutoPath(locationName) { + try { + let filePath = `assets/AutoPath/${locationName}.json`; + await pathingScript.runFile(filePath); + } catch (error) { + log.error(`执行 ${locationName} 路径时发生错误`); + log.error(error.message); + } + await sleep(2000); + } + + // 確認使用礦石 + function determineOre() { + if (ore == '水晶块') { + log.info("將使用 水晶块 鍛造礦石"); + } else if (ore == '紫晶块') { + log.info("將使用 紫晶块 鍛造礦石"); + } else if (ore == '萃凝晶') { + log.info("將使用 萃凝晶 鍛造礦石"); + } else { + log.info("無指定礦石﹐將使用 水晶块 鍛造礦石"); + } + } + // 读取用户设置 + let ore = settings.ore != undefined ? settings.ore : ''; + + setGameMetrics(1920, 1080, 2);// 设置游戏窗口大小和DPI + determineOre(); + + + log.info("前往枫丹鐵匠位置"); + await AutoPath(`到枫丹打鐵`); + log.info("到逹枫丹鐵匠位置"); + await sleep(2000); + log.info("對話進入任鍛造頁面"); + await sleep(2000); + keyPress("F"); + await sleep(2000); + keyPress("F"); + await sleep(2000); + click(1300, 505); + await sleep(2000); + keyPress("F"); + await sleep(2000); + + + 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); + +})(); \ No newline at end of file diff --git a/repo/js/到枫丹打鐵合礦/manifest.json b/repo/js/到枫丹打鐵合礦/manifest.json new file mode 100644 index 00000000..4dedf973 --- /dev/null +++ b/repo/js/到枫丹打鐵合礦/manifest.json @@ -0,0 +1,13 @@ +{ + "manifest_version": 1, + "name": "传送到枫丹鐵匠合礦", + "version": "1.0", + "description": "到枫丹鐵匠店合成武器升級材料,配合'传送到枫丹鐵匠領礦'能自動化合礦領礦。註1:可選使用水晶礦(默認)、紫晶礦、萃凝晶。註2:需要每種礦至少能合成一次。註3:使用時請先禁用任何生存位使用技能。", + "authors": [ + { + "name": "蜜柑魚" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +} \ No newline at end of file diff --git a/repo/js/到枫丹打鐵合礦/settings.json b/repo/js/到枫丹打鐵合礦/settings.json new file mode 100644 index 00000000..4f120c32 --- /dev/null +++ b/repo/js/到枫丹打鐵合礦/settings.json @@ -0,0 +1,12 @@ +[ + { + "name": "ore", + "type": "select", + "label": "合成礦石(默认:水晶礦)", + "options": [ + "水晶礦", + "紫晶块", + "萃凝晶" + ] + } +] \ No newline at end of file diff --git a/repo/js/到枫丹打鐵合礦領礦/main.js b/repo/js/到枫丹打鐵合礦領礦/main.js deleted file mode 100644 index 86e800b4..00000000 --- a/repo/js/到枫丹打鐵合礦領礦/main.js +++ /dev/null @@ -1,94 +0,0 @@ -(async function () { - - async function AutoPath(locationName) { - try { - let filePath = `assets/AutoPath/${locationName}.json`; - await pathingScript.runFile(filePath); - } catch (error) { - log.error(`执行 ${locationName} 路径时发生错误`); - log.error(error.message); - } - await sleep(2000); - } - - // 確認使用礦石 - function determineOre() { - if (ore_action == "合成礦石") { - if (ore == '水晶块') { - log.info("將使用 水晶块 鍛造礦石"); - } else if (ore == '紫晶块') { - log.info("將使用 紫晶块 鍛造礦石"); - } else if (ore == '萃凝晶') { - log.info("將使用 萃凝晶 鍛造礦石"); - } else { - log.info("無指定礦石﹐將使用 水晶块 鍛造礦石"); - } - } - } - // 读取用户设置 - let ore = settings.ore != undefined ? settings.ore : ''; - let ore_action = settings.ore_action != undefined ? settings.ore_action : ''; - log.info(ore + ":" + ore_action); - - setGameMetrics(1920, 1080, 2);// 设置游戏窗口大小和DPI - determineOre(); - - - log.info("前往枫丹鐵匠位置"); - await AutoPath(`到枫丹打鐵`); - log.info("到逹枫丹鐵匠位置"); - await sleep(2000); - log.info("對話進入任鍛造頁面"); - await sleep(2000); - keyPress("F"); - await sleep(1000); - keyPress("F"); - await sleep(1000); - click(1300, 505); - await sleep(1000); - keyPress("F"); - await sleep(1000); - - if (ore_action == "合成礦石") { - - 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); - } else { - // 點擊 "鍛造隊列" - click(600, 150); - await sleep(1000); - // 點擊 "全部領取" - click(160, 1010); - await sleep(1000); - // 點擊 "確認" - click(970, 910); - await sleep(1000); - } - - log.info("鍛造結束,退出畫面"); - // 退出鍛造頁面 - click(1845, 45); - await sleep(1000); - -})(); \ No newline at end of file diff --git a/repo/js/到枫丹打鐵合礦領礦/manifest.json b/repo/js/到枫丹打鐵合礦領礦/manifest.json deleted file mode 100644 index 5c2877af..00000000 --- a/repo/js/到枫丹打鐵合礦領礦/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "manifest_version": 1, - "name": "传送到枫丹鐵匠合礦領礦", - "version": "1.0", - "description": "传送到枫丹鐵匠合礦領礦,自動化合成武器升級材料。透過修改js腳本自定義配置設定合礦 還是 領礦。(需要每種礦至少能合成一次,使用時請先禁用任何生存位使用技能。)", - "authors": [ - { - "name": "蜜柑魚" - } - ], - "settings_ui": "settings.json", - "main": "main.js" -} \ No newline at end of file diff --git a/repo/js/到枫丹打鐵合礦領礦/settings.json b/repo/js/到枫丹打鐵合礦領礦/settings.json deleted file mode 100644 index 847d4aef..00000000 --- a/repo/js/到枫丹打鐵合礦領礦/settings.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "name": "ore", - "type": "select", - "label": "合成礦石(默认:水晶礦)", - "options": [ - "水晶礦", - "紫晶块", - "萃凝晶" - ] - },{ - "name": "ore_action", - "type": "select", - "label": "前往 合成礦石 / 領取礦石(默认:領取礦石)", - "options": [ - "合成礦石", - "領取礦石" - ] - } -] \ No newline at end of file diff --git a/repo/js/到枫丹打鐵領礦/assets/AutoPath/到枫丹打鐵.json b/repo/js/到枫丹打鐵領礦/assets/AutoPath/到枫丹打鐵.json new file mode 100644 index 00000000..045521ab --- /dev/null +++ b/repo/js/到枫丹打鐵領礦/assets/AutoPath/到枫丹打鐵.json @@ -0,0 +1,67 @@ +{ + "info": { + "name": "到枫丹打鐵", + "type": "collect", + "author": "密柑魚", + "version": "1.0", + "description": "", + "bgiVersion": "0.42.3" + }, + "positions": [ + { + "id": 1, + "x": 4514.18, + "y": 3630.3999999999996, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "teleport" + }, + { + "id": 2, + "x": 4520.380859375, + "y": 3606.239501953125, + "action": "", + "move_mode": "run", + "action_params": "", + "type": "path" + }, + { + "id": 3, + "x": 4560.19189453125, + "y": 3598.05615234375, + "action": "", + "move_mode": "run", + "action_params": "", + "type": "path" + }, + { + "id": 4, + "x": 4581.005859375, + "y": 3599.1630859375, + "action": "", + "move_mode": "run", + "action_params": "", + "type": "path" + }, + { + "id": 5, + "x": 4579.8, + "y": 3605.452, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path", + "locked": false + }, + { + "id": 6, + "x": 4579.85, + "y": 3605.45, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" + } + ] +} \ No newline at end of file diff --git a/repo/js/到枫丹打鐵領礦/main.js b/repo/js/到枫丹打鐵領礦/main.js new file mode 100644 index 00000000..7c4a4a93 --- /dev/null +++ b/repo/js/到枫丹打鐵領礦/main.js @@ -0,0 +1,47 @@ +(async function () { + + async function AutoPath(locationName) { + try { + let filePath = `assets/AutoPath/${locationName}.json`; + await pathingScript.runFile(filePath); + } catch (error) { + log.error(`执行 ${locationName} 路径时发生错误`); + log.error(error.message); + } + await sleep(2000); + } + + + setGameMetrics(1920, 1080, 2);// 设置游戏窗口大小和DPI + + log.info("前往枫丹鐵匠位置"); + await AutoPath(`到枫丹打鐵`); + log.info("到逹枫丹鐵匠位置"); + await sleep(2000); + log.info("對話進入任鍛造頁面"); + await sleep(2000); + keyPress("F"); + await sleep(2000); + keyPress("F"); + await sleep(2000); + click(1300, 505); + await sleep(2000); + keyPress("F"); + await sleep(2000); + + // 點擊 "鍛造隊列" + click(600, 150); + await sleep(1000); + // 點擊 "全部領取" + click(160, 1010); + await sleep(1000); + // 點擊 "確認" + click(970, 910); + await sleep(1000); + + log.info("領取結束,退出畫面"); + // 退出鍛造頁面 + click(1845, 45); + await sleep(1000); + +})(); \ No newline at end of file diff --git a/repo/js/到枫丹打鐵領礦/manifest.json b/repo/js/到枫丹打鐵領礦/manifest.json new file mode 100644 index 00000000..9e3bf6bc --- /dev/null +++ b/repo/js/到枫丹打鐵領礦/manifest.json @@ -0,0 +1,12 @@ +{ + "manifest_version": 1, + "name": "传送到枫丹鐵匠領礦", + "version": "1.0", + "description": "到枫丹鐵匠店領取合成武器升級材料,配合'传送到枫丹鐵匠合礦'能自動化合礦領礦。註1:使用時請先禁用任何生存位使用技能。", + "authors": [ + { + "name": "蜜柑魚" + } + ], + "main": "main.js" +} \ No newline at end of file