From 4484a080aec691bdee893c4ab862e9eaeb15a85a Mon Sep 17 00:00:00 2001 From: Patrick-Ze <19711799+Patrick-Ze@users.noreply.github.com> Date: Thu, 1 May 2025 06:29:24 +0800 Subject: [PATCH] =?UTF-8?q?js:=20QuickSwapGadgets:=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=E5=BF=AB=E6=8D=B7=E6=9B=B4=E6=8D=A2=E6=A0=8F=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E7=BC=96=E5=8F=B7=E7=9A=84=E5=B0=8F=E9=81=93=E5=85=B7?= =?UTF-8?q?=20(#677)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repo/js/QuickSwapGadgets/main.js | 13 +++++++++++++ repo/js/QuickSwapGadgets/manifest.json | 13 +++++++++++++ repo/js/QuickSwapGadgets/settings.json | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 repo/js/QuickSwapGadgets/main.js create mode 100644 repo/js/QuickSwapGadgets/manifest.json create mode 100644 repo/js/QuickSwapGadgets/settings.json diff --git a/repo/js/QuickSwapGadgets/main.js b/repo/js/QuickSwapGadgets/main.js new file mode 100644 index 00000000..8a9fdadd --- /dev/null +++ b/repo/js/QuickSwapGadgets/main.js @@ -0,0 +1,13 @@ +(async function () { + if (settings.NumberOfGadget === undefined) { + log.error("请在'JS脚本自定义配置'中设置要切换的小道具编号"); + return; + } + await genshin.returnMainUi(); + log.debug("切换到{key}", settings.NumberOfGadget); + keyDown("z"); + await sleep(1200); + keyUp("z"); + let key = "VK_" + settings.NumberOfGadget[0]; + keyPress(key); +})(); diff --git a/repo/js/QuickSwapGadgets/manifest.json b/repo/js/QuickSwapGadgets/manifest.json new file mode 100644 index 00000000..84a28697 --- /dev/null +++ b/repo/js/QuickSwapGadgets/manifest.json @@ -0,0 +1,13 @@ +{ + "manifest_version": 1, + "name": "切换小道具", + "version": "1.0.0", + "description": "切换小道具 ", + "authors": [ + { + "name": "Patrick-Ze (AyakaMain)" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +} diff --git a/repo/js/QuickSwapGadgets/settings.json b/repo/js/QuickSwapGadgets/settings.json new file mode 100644 index 00000000..a2d1a563 --- /dev/null +++ b/repo/js/QuickSwapGadgets/settings.json @@ -0,0 +1,13 @@ +[ + { + "name": "NumberOfGadget", + "type": "select", + "label": "选项框", + "options": [ + "1号小道具", + "2号小道具", + "3号小道具", + "4号小道具" + ] + } +]