From 913b430b44150270079494129410798e6654e932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B7=E4=B8=AA=E5=90=8D=E5=AD=97=E5=A5=BD=E9=9A=BE?= =?UTF-8?q?=E7=9A=84=E5=96=B5?= <25520958+MisakaAldrich@users.noreply.github.com> Date: Tue, 26 Aug 2025 22:48:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=96=B5=E5=8A=B3=E6=96=AF=E5=BC=BA=E8=BF=AB?= =?UTF-8?q?=E7=97=87=E7=8A=AF=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/AutoPermission/main.js | 29 ++++++++++++++++++++++++++++ repo/js/AutoPermission/manifest.json | 17 ++++++++++++++++ repo/js/AutoPermission/settings.json | 12 ++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 repo/js/AutoPermission/main.js create mode 100644 repo/js/AutoPermission/manifest.json create mode 100644 repo/js/AutoPermission/settings.json diff --git a/repo/js/AutoPermission/main.js b/repo/js/AutoPermission/main.js new file mode 100644 index 000000000..75b106542 --- /dev/null +++ b/repo/js/AutoPermission/main.js @@ -0,0 +1,29 @@ +(async function () { + log.info("请确保执行脚本前能够通过ESC回到主界面"); + await genshin.returnMainUi(); + keyPress("VK_F2") + await sleep(1000); + click(330,1010) //点击世界权限 + await sleep(1000); + let domainName = settings.domainName; + + switch (domainName) { + case "直接加入": + click(330, 910); + log.info("权限设置为【直接加入】"); + break; + case "不允许加入": + click(330, 850); // 不允许 + log.info("权限设置为【不允许加入】"); + break; + case "确认后可加入": + click(330, 960); // 确认后 + log.info("权限设置为【确认后可加入】"); + break; + default: + click(330, 850); // 不允许 + log.info("锁门"); + break; + } + await genshin.returnMainUi(); // 结束后回到主界面 +})(); diff --git a/repo/js/AutoPermission/manifest.json b/repo/js/AutoPermission/manifest.json new file mode 100644 index 000000000..851723823 --- /dev/null +++ b/repo/js/AutoPermission/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 1, + "name": "自动设置权限", + "version": "1.1", + "description": "设置进入世界的权限,默认锁门", + "authors": [ + { + "name": "½", + "links": "https://github.com/Traveler07" + } + ], + "tags": [ + "世界权限" + ], + "settings_ui": "settings.json", + "main": "main.js" +} \ No newline at end of file diff --git a/repo/js/AutoPermission/settings.json b/repo/js/AutoPermission/settings.json new file mode 100644 index 000000000..2f0317519 --- /dev/null +++ b/repo/js/AutoPermission/settings.json @@ -0,0 +1,12 @@ +[ + { + "name": "domainName", + "type": "select", + "label": "设置权限", + "options": [ + "直接加入", + "确认后可加入", + "不允许加入" + ] + } + ] \ No newline at end of file