From 04c16acf5690e6ee816764279ada05d79916b237 Mon Sep 17 00:00:00 2001 From: 24qiaoyue <1415660439@qq.com> Date: Thu, 5 Jun 2025 21:20:48 +0800 Subject: [PATCH] =?UTF-8?q?js:(AutoArtifactsSalvage)=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=86=E8=A7=A31-4=E6=98=9F=E5=9C=A3=E9=81=97=E7=89=A9?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E5=85=B7=20(#987)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add files via upload * Delete repo/js/AutoArtifactsDestroy(1-4star) directory * Add files via upload --- .../AutoArtifactsSalvage(1-4star)/main.js | 50 +++++++++++++++++++ .../manifest.json | 15 ++++++ .../settings.json | 47 +++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 repo/js/AutoArtifactsSalvage(1-4star)/main.js create mode 100644 repo/js/AutoArtifactsSalvage(1-4star)/manifest.json create mode 100644 repo/js/AutoArtifactsSalvage(1-4star)/settings.json diff --git a/repo/js/AutoArtifactsSalvage(1-4star)/main.js b/repo/js/AutoArtifactsSalvage(1-4star)/main.js new file mode 100644 index 00000000..70610d9e --- /dev/null +++ b/repo/js/AutoArtifactsSalvage(1-4star)/main.js @@ -0,0 +1,50 @@ +(async function () { + // 读取用户设置 + let autoSalvage = settings.autoSalvage != undefined && settings.autoSalvage != '是' ? false : true; + let autoSalvage1 = settings.autoSalvage1 != undefined && settings.autoSalvage1 != '是' ? true : false; + let autoSalvage2 = settings.autoSalvage2 != undefined && settings.autoSalvage2 != '是' ? true : false; + let autoSalvage3 = settings.autoSalvage3 != undefined && settings.autoSalvage3 != '是' ? true : false; + let autoSalvage4 = settings.autoSalvage4 != undefined && settings.autoSalvage4 != '否' ? true : false; + + log.debug(`autoSalvage: ${autoSalvage}; autoSalvage4: ${autoSalvage4};`); + + // 分解圣遗物 + async function salvage() { + if (!autoSalvage) return; + + await genshin.returnMainUi(); + + keyPress("B"); await sleep(2000); + click(670, 40); await sleep(1000); // 圣遗物 + click(660, 1010); await sleep(1000); // 分解 + click(300, 1020); await sleep(1000); // 快速选择 + + if (autoSalvage1) { + click(200,150); await sleep(500); // 不包括1星 + } + + if (autoSalvage2) { + click(200,220); await sleep(500); // 不包括2星 + } + + if (autoSalvage3) { + click(200,300); await sleep(500); // 不包括3星 + } + + if (!autoSalvage4) { + click(200, 380); await sleep(500); // 不包括4星 + } + + click(340, 1000); await sleep(1000); // 确认选择 + click(1720, 1015); await sleep(1500); // 分解 + click(1180, 750); await sleep(1000); // 进行分解 + + click(1840, 45); await sleep(1500); // 取消 + click(1840, 45); await sleep(1000); // 取消 + click(1840, 45); await sleep(1000); // 取消 + } + + // 执行分解 + await salvage(); + log.info("分解完成。"); +})(); \ No newline at end of file diff --git a/repo/js/AutoArtifactsSalvage(1-4star)/manifest.json b/repo/js/AutoArtifactsSalvage(1-4star)/manifest.json new file mode 100644 index 00000000..680ec8ec --- /dev/null +++ b/repo/js/AutoArtifactsSalvage(1-4star)/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 1, + "name": "自动分解1-4星圣遗物的工具", + "version": "1.0.1", + "bgi_version": "0.45.1", + "description": "自动分解1-4星圣遗物的工具,可选择是否分解1-4星圣遗物。本脚本根据AutoArtifacts_A_B_Extra修改而来,作者还不会修bug,如有问题请先自行解决。", + "authors": [ + { + "name": "24qiaoyue", + "link": "https://github.com/Yang-z" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +} \ No newline at end of file diff --git a/repo/js/AutoArtifactsSalvage(1-4star)/settings.json b/repo/js/AutoArtifactsSalvage(1-4star)/settings.json new file mode 100644 index 00000000..3905bebe --- /dev/null +++ b/repo/js/AutoArtifactsSalvage(1-4star)/settings.json @@ -0,0 +1,47 @@ +[ + { + "name": "autoSalvage", + "type": "select", + "label": "自动分解(默认:是)", + "options": [ + "是", + "否" + ] + }, + { + "name": "autoSalvage1", + "type": "select", + "label": "自动分解包括1星圣遗物(默认:是)", + "options": [ + "是", + "否" + ] + }, + { + "name": "autoSalvage2", + "type": "select", + "label": "自动分解包括2星圣遗物(默认:是)", + "options": [ + "是", + "否" + ] + }, + { + "name": "autoSalvage3", + "type": "select", + "label": "自动分解包括3星圣遗物(默认:是)", + "options": [ + "是", + "否" + ] + }, + { + "name": "autoSalvage4", + "type": "select", + "label": "自动分解包括4星圣遗物(默认:否)", + "options": [ + "是", + "否" + ] + } +] \ No newline at end of file