From ed6d17f274194bfe8f3fc9029f2f9efc2365f401 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?= <25520958+MisakaAldrich@users.noreply.github.com> Date: Wed, 12 Mar 2025 02:11:39 +0800 Subject: [PATCH] =?UTF-8?q?JS=E8=84=9A=E6=9C=AC=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A5=BD=E6=84=9F&=E5=88=B7=E8=82=89?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E5=BE=84=E5=B9=B6=E5=86=85=E7=BD=AE=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E9=98=9F=E4=BC=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoPath/好感-张牙舞爪的恶党-循环(二净甸).json | 48 ++++++++ .../好感-张牙舞爪的恶党-循环(二净甸刷肉版).json | 102 ++++++++++++++++ .../assets/AutoPath/好感-张牙舞爪的恶党-循环.json | 113 ------------------ .../assets/AutoPath/好感-张牙舞爪的恶党-神像.json | 66 ---------- .../好感-张牙舞爪的恶党-触发位置(二净甸).json | 30 +++++ .../AutoPath/好感-张牙舞爪的恶党-触发位置.json | 67 ----------- repo/js/Auto好感&刷兽肉/main.js | 58 +++++---- repo/js/Auto好感&刷兽肉/manifest.json | 2 +- repo/js/Auto好感&刷兽肉/settings.json | 13 +- 9 files changed, 226 insertions(+), 273 deletions(-) create mode 100644 repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸).json create mode 100644 repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸刷肉版).json delete mode 100644 repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环.json delete mode 100644 repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-神像.json create mode 100644 repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置(二净甸).json delete mode 100644 repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置.json diff --git a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸).json b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸).json new file mode 100644 index 00000000..bbb26ef4 --- /dev/null +++ b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸).json @@ -0,0 +1,48 @@ +{ + "info": { + "name": "好感-张牙舞爪的恶党-循环(二净甸)", + "type": "collect", + "author": "起个名字好难的喵", + "version": "1.0", + "description": "", + "bgiVersion": "0.42.3" + }, + "positions": [ + { + "id": 1, + "action": "", + "move_mode": "dash", + "type": "path", + "x": 3614.6240234375, + "y": -521.58154296875, + "action_params": "" + }, + { + "id": 2, + "x": 3574.46875, + "y": -501.7119140625, + "type": "path", + "move_mode": "dash", + "action": "fight", + "action_params": "" + }, + { + "id": 3, + "x": 3605.1826171875, + "y": -513.31982421875, + "type": "path", + "move_mode": "dash", + "action": "", + "action_params": "" + }, + { + "id": 4, + "x": 3614.505859375, + "y": -521.4970703125, + "type": "path", + "move_mode": "dash", + "action": "", + "action_params": "" + } + ] +} \ No newline at end of file diff --git a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸刷肉版).json b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸刷肉版).json new file mode 100644 index 00000000..09a14700 --- /dev/null +++ b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环(二净甸刷肉版).json @@ -0,0 +1,102 @@ +{ + "info": { + "name": "好感-张牙舞爪的恶党-循环(二净甸刷肉版)", + "type": "collect", + "author": "起个名字好难的喵", + "version": "1.0", + "description": "", + "bgiVersion": "0.42.3" + }, + "positions": [ + { + "id": 1, + "x": 3614.62, + "y": -521.58, + "action": "", + "move_mode": "dash", + "action_params": "", + "type": "path" + }, + { + "id": 2, + "x": 3578.08, + "y": -500.75, + "action": "fight", + "move_mode": "dash", + "action_params": "", + "type": "path" + }, + { + "id": 3, + "x": 3570.703125, + "y": -502.7314453125, + "type": "path", + "move_mode": "walk", + "action": "", + "action_params": "" + }, + { + "id": 4, + "x": 3572.1875, + "y": -503.25, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" + }, + { + "id": 5, + "x": 3577.8125, + "y": -493.71875, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" + }, + { + "id": 6, + "x": 3578.78125, + "y": -503.40625, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" + }, + { + "id": 7, + "x": 3572.1748046875, + "y": -494.65478515625, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" + }, + { + "id": 8, + "x": 3576.03125, + "y": -503.0625, + "action": "", + "move_mode": "walk", + "action_params": "", + "type": "path" + }, + { + "id": 9, + "x": 3605.18, + "y": -513.31, + "action": "", + "move_mode": "dash", + "action_params": "", + "type": "path" + }, + { + "id": 10, + "x": 3614.62, + "y": -521.58, + "action": "", + "move_mode": "dash", + "action_params": "", + "type": "path" + } + ] +} \ No newline at end of file diff --git a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环.json b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环.json deleted file mode 100644 index 0df1f89d..00000000 --- a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-循环.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "info": { - "name": "好感-张牙舞爪的恶党-循环", - "type": "collect", - "author": "起个名字好难的喵", - "version": "1.0", - "description": "", - "bgiVersion": "0.35.1" - }, - "positions": [ - { - "id": 1, - "action": "", - "move_mode": "walk", - "type": "path", - "x": 2705.7783203125, - "y": -1623.0771484375, - "action_params": "", - "locked": false - }, - { - "id": 2, - "x": 2731.5625, - "y": -1576.40966796875, - "type": "path", - "move_mode": "walk", - "action": "fight", - "action_params": "", - "locked": false - }, - { - "id": 1, - "action": "", - "move_mode": "walk", - "type": "path", - "x": 2739.7841796875, - "y": -1571.65234375, - "action_params": "" - }, - { - "id": 2, - "x": 2731.3232421875, - "y": -1568.01171875, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 3, - "x": 2733.05078125, - "y": -1577.15283203125, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 4, - "x": 2727.404296875, - "y": -1575.0263671875, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 5, - "x": 2737.90625, - "y": -1571.599609375, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 6, - "x": 2733.5732421875, - "y": -1577.5380859375, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 7, - "x": 2731, - "y": -1575.51220703125, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 8, - "x": 2734.5048828125, - "y": -1570.70458984375, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 5, - "action": "", - "move_mode": "walk", - "type": "path", - "x": 2705.7783203125, - "y": -1623.0771484375, - "action_params": "" - } - ] -} \ No newline at end of file diff --git a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-神像.json b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-神像.json deleted file mode 100644 index e567177f..00000000 --- a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-神像.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "info": { - "name": "好感-张牙舞爪的恶党-神像", - "type": "collect", - "author": "起个名字好难的喵", - "version": "1.0", - "description": "", - "bgiVersion": "0.35.1" - }, - "positions": [ - { - "id": 1, - "action": "", - "move_mode": "walk", - "type": "teleport", - "x": 2567.5400390625, - "y": -1424.11767578125, - "action_params": "" - }, - { - "id": 2, - "x": 2565.2373046875, - "y": -1418.88720703125, - "type": "path", - "move_mode": "walk", - "action": "combat_script", - "action_params": "wait(5)" - }, - { - "id": 3, - "x": 2613.8125, - "y": -1503.6513671875, - "type": "path", - "move_mode": "fly", - "action": "", - "action_params": "" - }, - { - "id": 4, - "x": 2653.1630859375, - "y": -1552.5888671875, - "type": "path", - "move_mode": "fly", - "action": "", - "action_params": "" - }, - { - "id": 5, - "x": 2699.2822265625, - "y": -1616.28515625, - "type": "path", - "move_mode": "fly", - "action": "stop_flying", - "action_params": "" - }, - { - "id": 6, - "x": 2705.837890625, - "y": -1622.46826171875, - "type": "path", - "move_mode": "walk", - "action": "fight", - "action_params": "" - } - ] -} \ No newline at end of file diff --git a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置(二净甸).json b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置(二净甸).json new file mode 100644 index 00000000..8e866956 --- /dev/null +++ b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置(二净甸).json @@ -0,0 +1,30 @@ +{ + "info": { + "name": "好感-张牙舞爪的恶党-触发位置(二净甸)", + "type": "collect", + "author": "起个名字好难的喵", + "version": "1.0", + "description": "", + "bgiVersion": "0.42.3" + }, + "positions": [ + { + "id": 1, + "action": "", + "move_mode": "walk", + "type": "teleport", + "x": 3705.5322265625, + "y": -497.45068359375, + "action_params": "" + }, + { + "id": 2, + "x": 3615.4814453125, + "y": -521.2724609375, + "type": "path", + "move_mode": "fly", + "action": "combat_script", + "action_params": "wait(0.5),keypress(VK_SPACE),wait(2.5),click" + } + ] +} \ No newline at end of file diff --git a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置.json b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置.json deleted file mode 100644 index 31904536..00000000 --- a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "info": { - "name": "好感-张牙舞爪的恶党-1", - "type": "collect", - "author": "起个名字好难的喵", - "version": "1.0", - "description": "", - "bgiVersion": "0.35.1" - }, - "positions": [ - { - "id": 1, - "action": "", - "move_mode": "walk", - "type": "teleport", - "x": 2806.4853515625, - "y": -1790.42626953125, - "action_params": "" - }, - { - "id": 2, - "x": 2812.5595703125, - "y": -1740.89013671875, - "type": "path", - "move_mode": "run", - "action": "", - "action_params": "" - }, - { - "id": 3, - "x": 2794.3583984375, - "y": -1707.4033203125, - "type": "path", - "move_mode": "walk", - "action": "", - "action_params": "" - }, - { - "id": 4, - "x": 2746.61328125, - "y": -1601.3955078125, - "type": "path", - "move_mode": "fly", - "action": "stop_flying", - "action_params": "", - "locked": false - }, - { - "id": 5, - "x": 2746.61328125, - "y": -1601.3955078125, - "type": "path", - "move_mode": "walk", - "action": "fight", - "action_params": "" - }, - { - "id": 6, - "x": 2705.7783203125, - "y": -1623.0771484375, - "type": "path", - "move_mode": "walk", - "action": "fight", - "action_params": "" - } - ] -} \ No newline at end of file diff --git a/repo/js/Auto好感&刷兽肉/main.js b/repo/js/Auto好感&刷兽肉/main.js index fb9846bd..0cef68b8 100644 --- a/repo/js/Auto好感&刷兽肉/main.js +++ b/repo/js/Auto好感&刷兽肉/main.js @@ -1,15 +1,15 @@ (async function () { const defaultExitDelay = 12; - const defaultLoadingDelay = 15; + const defaultLoadingDelay = 10; function validateAndSetDefaults(exitDelay, loadingDelay) { if (isNaN(exitDelay) || exitDelay <= 0) { log.warn("你没有设置退出延迟,将使用默认值:12秒"); exitDelay = defaultExitDelay; } - if (isNaN(loadingDelay) || loadingDelay <= 0) { - log.warn("你没有设置加载延迟,将使用默认值:15秒"); + if (isNaN(loadingDelay) || loadingDelay < 0) { + log.warn("你没有设置加载延迟,将使用默认值:10秒"); loadingDelay = defaultLoadingDelay; } return { exitDelay, loadingDelay }; @@ -72,26 +72,25 @@ await sleep(2000); } - async function AutoFriendship(times,statue_times) { - - log.info(`导航至好感-张牙舞爪的恶党-触发位置`); - await AutoPath('好感-张牙舞爪的恶党-触发位置'); - + async function AutoFriendship(times, statue_times, GetMeatMode) { + log.info(`导航至好感-张牙舞爪的恶党-触发位置(二净甸)`); + await AutoPath(`好感-张牙舞爪的恶党-触发位置(二净甸)`); + log.info(`自动好感开始...`); - + for (let i = 0; i < times; i++) { - // 每运行 5 次 '好感-张牙舞爪的恶党-循环' 后运行 '好感-张牙舞爪的恶党-神像' if ((i + 1) % statue_times === 0) { - await AutoPath('好感-张牙舞爪的恶党-神像'); + await genshin.tp(2297.60, -824.45); + await AutoPath(`好感-张牙舞爪的恶党-触发位置(二净甸)`); await ReopenTheGate(); log.info(`当前次数:${i + 1}/${times}`); logTimeTaken(startTime); - await AutoPath('好感-张牙舞爪的恶党-循环'); + await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`); } else { await ReopenTheGate(); log.info(`当前次数:${i + 1}/${times}`); logTimeTaken(startTime); - await AutoPath('好感-张牙舞爪的恶党-循环'); + await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`); } log.info(`已完成次数:${i + 1}/${times}`); logTimeTaken(startTime); @@ -108,21 +107,22 @@ log.info(`当前运行总时长:${formattedTime}`); } - // 启用自动拾取的实时任务 - const startTime = Date.now(); - dispatcher.addTimer(new RealtimeTimer("AutoPick")); - - setGameMetrics(1920, 1080, 1); // 设置游戏窗口大小和DPI let exitdelay = Number(settings.exitdelay); let loadingdelay = Number(settings.loadingdelay); - let UL = settings.UL ? settings.UL : false; - let inputValue = settings.inputValue ? settings.inputValue : 9999; - let times = UL ? (isNaN(inputValue) ? 1667 : Math.ceil(inputValue / 6)) : 10; + // 肉相关 + let GetMeatMode = settings.GetMeatMode ? settings.GetMeatMode : false; + let inputValue = settings.inputValue ? settings.inputValue : 300; + let times = GetMeatMode ? (isNaN(inputValue) ? 50 : Math.ceil(inputValue / 6)) : 10; + // 神像相关 let gostatue = settings.gostatue ? settings.gostatue : false; let statue = settings.statue ? settings.statue : 5; let statue_times = gostatue ? (isNaN(statue) ? 5 : statue) : 0; + // 启用自动拾取的实时任务,并配置成启用急速拾取模式 + dispatcher.addTimer(new RealtimeTimer("AutoPick", { "forceInteraction": true })); + const startTime = Date.now(); + setGameMetrics(1920, 1080, 1); // 设置游戏窗口大小和DPI const { exitDelay: validatedExitDelay, loadingDelay: validatedLoadingDelay } = validateAndSetDefaults(exitdelay, loadingdelay); const messages = [ '请确保队伍满员,并为队伍配置相应的战斗策略', @@ -136,8 +136,22 @@ } log.info('自动好感开始...'); + if (!!settings.partyName) { + try { + await genshin.tp(2297.60, -824.45); + await sleep(3000); + log.info("正在尝试切换至" + settings.partyName); + await genshin.switchParty(settings.partyName); + } catch { + log.warn("队伍切换失败,可能处于联机模式或其他不可切换状态"); + await genshin.returnMainUi(); + } + } else { + await genshin.returnMainUi(); + } + //默认10次自动好感 - await AutoFriendship(times,statue_times); + await AutoFriendship(times,statue_times,GetMeatMode); // 计算并输出总时长 const endTime = Date.now(); diff --git a/repo/js/Auto好感&刷兽肉/manifest.json b/repo/js/Auto好感&刷兽肉/manifest.json index 4aeb2132..056431df 100644 --- a/repo/js/Auto好感&刷兽肉/manifest.json +++ b/repo/js/Auto好感&刷兽肉/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "好感-张牙舞爪的恶党(可用于刷兽肉)", - "version": "1.0", + "version": "1.1", "description": "通过突发事件:张牙舞爪的恶党刷好兽肉,并顺带获取好感度(超过10次后不再获取),请使用满员好感度队伍,并为全体队伍角色配置相应的战斗策略", "authors": [ { diff --git a/repo/js/Auto好感&刷兽肉/settings.json b/repo/js/Auto好感&刷兽肉/settings.json index 3a372e08..e1312a91 100644 --- a/repo/js/Auto好感&刷兽肉/settings.json +++ b/repo/js/Auto好感&刷兽肉/settings.json @@ -10,14 +10,19 @@ "label": "加载延迟(秒)(选填)" }, { - "name": "UL", + "name": "partyName", + "type": "input-text", + "label": "(选填)需要切换的队伍名称" + }, + { + "name": "GetMeatMode", "type": "checkbox", - "label": "开启刷兽肉模式" + "label": "开启刷兽肉模式(勾选才拾取散落的兽肉)" }, { "name": "inputValue", "type": "input-text", - "label": "刷取个数(选填,默认为9999)" + "label": "刷取个数(选填,默认为300)" }, { "name": "gostatue", @@ -27,6 +32,6 @@ { "name": "statue", "type": "input-text", - "label": "返回神像周期(选填,默认为5)" + "label": "返回神像周期(选填,默认为5次/周期)" } ] \ No newline at end of file