From c051fa645853f720ec9568b2368f31b8d0a01b2e 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: Wed, 9 Apr 2025 22:21:57 +0800 Subject: [PATCH] =?UTF-8?q?JS=E8=84=9A=E6=9C=AC=EF=BC=9A=E5=85=BD=E8=82=89?= =?UTF-8?q?=E5=A5=BD=E6=84=9Ffix:forceInteraction=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=8D=A1=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=97=AE=E9=A2=98=20(#547)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main.js | 16 ++++++++++------ .../manifest.json | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/main.js b/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/main.js index 646ee4b8..614fb2a3 100644 --- a/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/main.js +++ b/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/main.js @@ -70,7 +70,7 @@ } // 好感核心函数 - async function AutoFriendship(runTimes, statueTimes, GetMeatMode,startTime) { + async function AutoFriendship(runTimes, statueTimes, GetMeatMode, startTime) { for (let i = 0; i < runTimes; i++) { if ((i + 1) % statueTimes === 0) { // 判断当前循环次数否达到去神像设置值 await genshin.tpToStatueOfTheSeven(); @@ -79,13 +79,18 @@ log.info(`导航至好感-张牙舞爪的恶党-触发位置(二净甸)`); await AutoPath(`好感-张牙舞爪的恶党-触发位置(二净甸)`); } - log.info(`当前次数:${i + 1}/${runTimes}`); - await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`); + if (await comparePosition()){ + log.info(`当前次数:${i + 1}/${runTimes}`); + dispatcher.addTimer(new RealtimeTimer("AutoPick", { "forceInteraction": true })); + await AutoPath(`好感-张牙舞爪的恶党-循环${GetMeatMode ? '(二净甸刷肉版)' : '(二净甸)'}`); + dispatcher.addTimer(new RealtimeTimer("AutoPick", { "forceInteraction": false })); + log.info(`已完成次数:${i + 1}/${runTimes}`); + } else { + i = i - 1; // 退回这次次数 + } const estimatedCompletion = calculateEstimatedCompletion(startTime, i + 1, runTimes); - log.info(`已完成次数:${i + 1}/${runTimes}`); logTimeTaken(startTime); log.info(`预计完成时间:${estimatedCompletion}`); - await sleep(10000); } log.info('兽肉好感已完成'); } @@ -125,7 +130,6 @@ } // Main - dispatcher.addTimer(new RealtimeTimer("AutoPick", { "forceInteraction": true })); let messages = [ '请确保队伍满员,并为队伍配置相应的战斗策略', `使用的七天神像周期为: ${statueTimes}`, diff --git a/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/manifest.json b/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/manifest.json index b3d23705..74c12a34 100644 --- a/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/manifest.json +++ b/repo/js/AutoFriendshipEvilBaresItsFangsGetRawMeat/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 1, "name": "兽肉好感:自动好感度&刷两只鳄鱼兽肉&卡时间", - "version": "1.3.0", + "version": "1.3.1", "description": "通过突发事件:张牙舞爪的恶党刷兽肉,并顺带获取好感度(超过10次后不再获取),请使用满员好感度队伍,并为全体队伍角色配置相应的战斗策略", "authors": [ {