Fix: Consider multiple rogue runs as separated tasks

This commit is contained in:
LmeSzinc 2024-05-08 18:42:21 +08:00
parent 09e675758c
commit 80d1fbf9e5

View File

@ -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__':