Fix: Dont call BattlePass if it's already leveled max

This commit is contained in:
LmeSzinc 2023-09-27 23:28:05 +08:00
parent 28081361d9
commit 3eec7ef0da
4 changed files with 24 additions and 6 deletions

View File

@ -505,9 +505,12 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher
TaskEnd: Call task `BattlePass` and stop current task
"""
if self.stored.BattlePassTodayQuest.is_expired():
logger.info('BattlePassTodayQuest expired, call task to update')
self.task_call('BattlePass')
self.task_stop()
if self.stored.BattlePassLevel.is_full():
logger.info('BattlePassLevel full, no updates')
else:
logger.info('BattlePassTodayQuest expired, call task to update')
self.task_call('BattlePass')
self.task_stop()
@property
def DEVICE_SCREENSHOT_METHOD(self):

View File

@ -69,7 +69,10 @@ class Assignment(AssignmentClaim, SynthesizeUI):
if KEYWORD_BATTLE_PASS_QUEST.Dispatch_1_assignments in quests:
logger.info(
'Achieved battle pass quest Dispatch_1_assignments')
self.config.task_call('BattlePass')
if self.config.stored.BattlePassLevel.is_full():
logger.info('BattlePassLevel full, no task call')
else:
self.config.task_call('BattlePass')
# Check daily
quests = self.config.stored.DailyQuest.load_quests()
if KEYWORDS_DAILY_QUEST.Go_on_assignment_1_time in quests:

View File

@ -323,7 +323,16 @@ class DailyQuestUI(DungeonUI, RouteLoader):
quests = self.config.stored.BattlePassTodayQuest.load_quests()
if KEYWORD_BATTLE_PASS_QUEST.Reach_500_on_Daily_Training_Activity in quests:
logger.info('Achieved battle pass quest Reach_500_on_Daily_Training_Activity')
self.config.task_call('BattlePass')
if self.config.stored.BattlePassLevel.is_full():
logger.info('BattlePassLevel full, no task call')
else:
self.config.task_call('BattlePass')
self.config.task_call('DataUpdate')
# Delay self
self.config.task_delay(server_update=True)
if __name__ == '__main__':
self = DailyQuestUI('src')
self.device.screenshot()
self.route_run(ROUTE_DAILY.HimekoTrial__route_enemy)

View File

@ -229,7 +229,10 @@ class Dungeon(DungeonUI, DungeonEvent, Combat):
quests = self.config.stored.BattlePassTodayQuest.load_quests()
if KEYWORD_BATTLE_PASS_QUEST.Consume_1_Trailblaze_Power in quests:
logger.info('Probably achieved battle pass quest Consume_1_Trailblaze_Power')
self.config.task_call('BattlePass')
if self.config.stored.BattlePassLevel.is_full():
logger.info('BattlePassLevel full, no task call')
else:
self.config.task_call('BattlePass')
# Check daily
if self.achieved_daily_quest:
self.config.task_call('DailyQuest')