From 80d1fbf9e5f885cdf56637cc1ada909883aa2570 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 8 May 2024 18:42:21 +0800 Subject: [PATCH] Fix: Consider multiple rogue runs as separated tasks --- tasks/rogue/rogue.py | 50 ++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/tasks/rogue/rogue.py b/tasks/rogue/rogue.py index 7635b25b8..5e2f56750 100644 --- a/tasks/rogue/rogue.py +++ b/tasks/rogue/rogue.py @@ -37,31 +37,35 @@ class Rogue(RouteLoader, RogueEntry): self.config.task_call('Dungeon') self.config.task_stop() - while 1: - # Run - success = self.rogue_once() + # Run + success = self.rogue_once() - # Scheduler - with self.config.multi_set(): - # Task switched - if self.config.task_switched(): + # Scheduler + with self.config.multi_set(): + # Task switched + if self.config.task_switched(): + self.config.task_stop() + # Archived daily quest + if success: + quests = self.config.stored.DailyQuest.load_quests() + if KEYWORDS_DAILY_QUEST.Complete_Simulated_Universe_1_times in quests: + logger.info('Achieve daily quest Complete_Simulated_Universe_1_times') + self.config.task_call('DailyQuest') self.config.task_stop() - # Archived daily quest - if success: - quests = self.config.stored.DailyQuest.load_quests() - if KEYWORDS_DAILY_QUEST.Complete_Simulated_Universe_1_times in quests: - logger.info('Achieve daily quest Complete_Simulated_Universe_1_times') - self.config.task_call('DailyQuest') - self.config.task_stop() - quests = self.config.stored.BattlePassWeeklyQuest.load_quests() - if KEYWORDS_BATTLE_PASS_QUEST.Complete_Simulated_Universe_1_times in quests: - logger.info('Achieve battle pass quest Complete_Simulated_Universe_1_times') - self.config.task_call('BattlePass') - self.config.task_stop() - # End - if not success: - self.config.task_delay(server_update=True) - break + quests = self.config.stored.BattlePassWeeklyQuest.load_quests() + if KEYWORDS_BATTLE_PASS_QUEST.Complete_Simulated_Universe_1_times in quests: + logger.info('Achieve battle pass quest Complete_Simulated_Universe_1_times') + self.config.task_call('BattlePass') + self.config.task_stop() + # End + if success: + logger.info('Rogue run success') + # Call rogue itself, so multiple rogue runs are considered as separated tasks + # which won't trigger failure count >= 3 when clearing 100 elites + self.config.task_call('Rogue') + else: + logger.info('Rogue run failed') + self.config.task_delay(server_update=True) if __name__ == '__main__':