From 14559d9894c208b750a8d15cc1e206853c6e1dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E4=BA=91?= Date: Fri, 29 Aug 2025 00:41:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9D=83=E9=99=90?= 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