From b354c06fc84ce51e90cf3ae8d84fc6116a7ccc13 Mon Sep 17 00:00:00 2001 From: 24qiaoyue <1415660439@qq.com> Date: Sun, 15 Jun 2025 00:45:43 +0800 Subject: [PATCH] =?UTF-8?q?js=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=9C=A3=E9=81=97?= =?UTF-8?q?=E7=89=A9=E5=88=86=E8=A7=A3=E5=8D=87=E7=BA=A7=E4=B8=BA=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=9C=A3=E9=81=97=E7=89=A9=E5=88=86=E8=A7=A3=E6=88=96?= =?UTF-8?q?=E6=91=A7=E6=AF=81=20(#1099)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete repo/js/AutoArtifactsSalvage(1-4star) directory * Add files via upload --- .../main.js | 72 +++++++++++++++++++ .../manifest.json | 15 ++++ .../settings.json | 36 ++++++++++ .../AutoArtifactsSalvage(1-4star)/main.js | 50 ------------- .../manifest.json | 15 ---- .../settings.json | 47 ------------ 6 files changed, 123 insertions(+), 112 deletions(-) create mode 100644 repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/main.js create mode 100644 repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/manifest.json create mode 100644 repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/settings.json delete mode 100644 repo/js/AutoArtifactsSalvage(1-4star)/main.js delete mode 100644 repo/js/AutoArtifactsSalvage(1-4star)/manifest.json delete mode 100644 repo/js/AutoArtifactsSalvage(1-4star)/settings.json diff --git a/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/main.js b/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/main.js new file mode 100644 index 00000000..362198d2 --- /dev/null +++ b/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/main.js @@ -0,0 +1,72 @@ +(async function () { + // 读取用户设置 + let operationType = settings.operationType || "分解"; // 默认为分解 + let times = settings.times || 1; // 默认为1 + let includeOneStar = settings.includeOneStar || false; + let includeTwoStar = settings.includeTwoStar || false; + let includeThreeStar = settings.includeThreeStar || false; + let includeFourStar = settings.includeFourStar || false; + + log.debug(`操作类型: ${operationType}`); + log.debug(`操作次数: ${times}`); + log.debug(`包含一星: ${includeOneStar}, 包含二星: ${includeTwoStar}, 包含三星: ${includeThreeStar}, 包含四星: ${includeFourStar}`); + + // 分解圣遗物 + async function salvage() { + 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 (!includeOneStar) click(200, 150); await sleep(500); // 不包含一星 + if (!includeTwoStar) click(200, 220); await sleep(500); // 不包含二星 + if (!includeThreeStar) click(200, 300); await sleep(500); // 不包含三星 + if (!includeFourStar) click(200, 380); await sleep(500); // 不包含四星 + + 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); // 取消 + } + + // 摧毁圣遗物 + async function destroy() { + await genshin.returnMainUi(); + keyPress("B"); await sleep(2000); // 打开背包 + click(670, 40); await sleep(1000); // 点击圣遗物 + + for (let i = 0; i < times; i++) { + click(75, 1015); await sleep(1000); // 点击摧毁 + click(165, 1020); await sleep(1000); // 点击快捷放入 + + // 根据星级选择 + if (includeOneStar) click(200, 150); await sleep(500); // 包含一星 + if (includeTwoStar) click(200, 220); await sleep(500); // 包含二星 + if (includeThreeStar) click(200, 300); await sleep(500); // 包含三星 + if (includeFourStar) click(200, 380); await sleep(500); // 包含四星 + + click(165, 1020); await sleep(1000); // 点击快捷放入 + click(1720, 1015); await sleep(1000); // 点击摧毁 + click(1200, 830); await sleep(1000); // 点击摧毁 + click(960, 1000); await sleep(1000); // 点击空白处 + } + + click(1840, 45); await sleep(1500); // 取消 + click(1840, 45); await sleep(1000); // 取消 + click(1840, 45); await sleep(1000); // 取消 + } + + // 执行操作 + if (operationType === "分解") { + await salvage(); + log.info("分解完成。"); + } else if (operationType === "摧毁") { + await destroy(); + log.info("摧毁完成。"); + } +})(); \ No newline at end of file diff --git a/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/manifest.json b/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/manifest.json new file mode 100644 index 00000000..7dc72183 --- /dev/null +++ b/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 1, + "name": "自动分解或摧毁1-4星圣遗物", + "version": "1.0.2", + "bgi_version": "0.45.1", + "description": "自动分解或摧毁1-4星圣遗物,可选择是否分解1-4星圣遗物。本脚本根据AutoArtifacts_A_B_Extra和DestroyArtifactsForMora修改而来,作者还不会修bug,如有问题请先自行解决。", + "authors": [ + { + "name": "24qiaoyue", + "link": "https://github.com/24qiaoyue" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +} \ No newline at end of file diff --git a/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/settings.json b/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/settings.json new file mode 100644 index 00000000..f70979ee --- /dev/null +++ b/repo/js/AutoArtifactsSalvageOrDestroy(1-4star)/settings.json @@ -0,0 +1,36 @@ +[ + { + "name": "operationType", + "type": "select", + "label": "操作类型(默认:分解)", + "options": [ + "分解", + "摧毁" + ] + }, + { + "name": "times", + "type": "input-text", + "label": "操作次数,默认为1,仅限摧毁,一次摧毁最大数量为100个圣遗物" + }, + { + "name": "includeOneStar", + "type": "checkbox", + "label": "包含一星圣遗物" + }, + { + "name": "includeTwoStar", + "type": "checkbox", + "label": "包含二星圣遗物" + }, + { + "name": "includeThreeStar", + "type": "checkbox", + "label": "包含三星圣遗物" + }, + { + "name": "includeFourStar", + "type": "checkbox", + "label": "包含四星圣遗物" + } +] \ No newline at end of file diff --git a/repo/js/AutoArtifactsSalvage(1-4star)/main.js b/repo/js/AutoArtifactsSalvage(1-4star)/main.js deleted file mode 100644 index 70610d9e..00000000 --- a/repo/js/AutoArtifactsSalvage(1-4star)/main.js +++ /dev/null @@ -1,50 +0,0 @@ -(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 deleted file mode 100644 index 680ec8ec..00000000 --- a/repo/js/AutoArtifactsSalvage(1-4star)/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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 deleted file mode 100644 index 3905bebe..00000000 --- a/repo/js/AutoArtifactsSalvage(1-4star)/settings.json +++ /dev/null @@ -1,47 +0,0 @@ -[ - { - "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