From 8f4d872c2801481700a6dea6bf6e6133499b16a6 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: Sun, 26 Jan 2025 00:28:41 +0800 Subject: [PATCH] =?UTF-8?q?JS=E8=84=9A=E6=9C=AC=EF=BC=9A=E5=88=B7=E8=82=89?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9A=E6=9C=9F=E5=89=8D=E5=BE=80=E7=A5=9E?= =?UTF-8?q?=E5=83=8F=E9=80=89=E9=A1=B9=E5=8F=8A=E8=AE=BE=E7=BD=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/AutoPath/好感-张牙舞爪的恶党-神像.json | 66 +++++++++++++++++++ .../AutoPath/好感-张牙舞爪的恶党-触发位置.json | 2 +- repo/js/Auto好感&刷兽肉/main.js | 35 +++++++--- repo/js/Auto好感&刷兽肉/settings.json | 14 +++- 4 files changed, 104 insertions(+), 13 deletions(-) create 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..e567177f --- /dev/null +++ b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-神像.json @@ -0,0 +1,66 @@ +{ + "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 index dc72dac1..31904536 100644 --- a/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置.json +++ b/repo/js/Auto好感&刷兽肉/assets/AutoPath/好感-张牙舞爪的恶党-触发位置.json @@ -31,7 +31,7 @@ "x": 2794.3583984375, "y": -1707.4033203125, "type": "path", - "move_mode": "run", + "move_mode": "walk", "action": "", "action_params": "" }, diff --git a/repo/js/Auto好感&刷兽肉/main.js b/repo/js/Auto好感&刷兽肉/main.js index 410ffa7d..fb9846bd 100644 --- a/repo/js/Auto好感&刷兽肉/main.js +++ b/repo/js/Auto好感&刷兽肉/main.js @@ -72,18 +72,28 @@ await sleep(2000); } - async function AutoFriendship(times) { + async function AutoFriendship(times,statue_times) { log.info(`导航至好感-张牙舞爪的恶党-触发位置`); await AutoPath('好感-张牙舞爪的恶党-触发位置'); log.info(`自动好感开始...`); - await ReopenTheGate(); for (let i = 0; i < times; i++) { - log.info(`自动好感当前次数:${i + 1}/${times}`); - await AutoPath('好感-张牙舞爪的恶党-循环'); - await ReopenTheGate(); + // 每运行 5 次 '好感-张牙舞爪的恶党-循环' 后运行 '好感-张牙舞爪的恶党-神像' + if ((i + 1) % statue_times === 0) { + await AutoPath('好感-张牙舞爪的恶党-神像'); + await ReopenTheGate(); + log.info(`当前次数:${i + 1}/${times}`); + logTimeTaken(startTime); + await AutoPath('好感-张牙舞爪的恶党-循环'); + } else { + await ReopenTheGate(); + log.info(`当前次数:${i + 1}/${times}`); + logTimeTaken(startTime); + await AutoPath('好感-张牙舞爪的恶党-循环'); + } + log.info(`已完成次数:${i + 1}/${times}`); logTimeTaken(startTime); } log.info('自动好感已完成'); @@ -105,24 +115,29 @@ 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 UL = settings.UL ? settings.UL : false; + let inputValue = settings.inputValue ? settings.inputValue : 9999; let times = UL ? (isNaN(inputValue) ? 1667 : Math.ceil(inputValue / 6)) : 10; - log.info(`计算后的运行次数为: ${times}`); + let gostatue = settings.gostatue ? settings.gostatue : false; + let statue = settings.statue ? settings.statue : 5; + let statue_times = gostatue ? (isNaN(statue) ? 5 : statue) : 0; + const { exitDelay: validatedExitDelay, loadingDelay: validatedLoadingDelay } = validateAndSetDefaults(exitdelay, loadingdelay); const messages = [ '请确保队伍满员,并为队伍配置相应的战斗策略', + `退出延迟: ${validatedExitDelay}秒, 加载延迟: ${validatedLoadingDelay}秒`, + `设置的七天神像周期为: ${statue_times}`, + `计算后的运行次数为: ${times}`, ]; for (let message of messages) { log.info(message); await sleep(1000); } log.info('自动好感开始...'); - log.info(`退出延迟: ${validatedExitDelay}秒, 加载延迟: ${validatedLoadingDelay}秒`); //默认10次自动好感 - await AutoFriendship(times); + await AutoFriendship(times,statue_times); // 计算并输出总时长 const endTime = Date.now(); diff --git a/repo/js/Auto好感&刷兽肉/settings.json b/repo/js/Auto好感&刷兽肉/settings.json index ad67ee15..3a372e08 100644 --- a/repo/js/Auto好感&刷兽肉/settings.json +++ b/repo/js/Auto好感&刷兽肉/settings.json @@ -12,11 +12,21 @@ { "name": "UL", "type": "checkbox", - "label": "是否开启刷兽肉模式" + "label": "开启刷兽肉模式" }, { "name": "inputValue", "type": "input-text", - "label": "刷取个数(默认刷9999个)" + "label": "刷取个数(选填,默认为9999)" + }, + { + "name": "gostatue", + "type": "checkbox", + "label": "开启定期前往七天神像" + }, + { + "name": "statue", + "type": "input-text", + "label": "返回神像周期(选填,默认为5)" } ] \ No newline at end of file