Skip to content

Commit

Permalink
fixing card mastery flow
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmiglio committed Dec 24, 2023
1 parent 4495f86 commit 3938959
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/pyclashbot/bot/card_mastery_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ def collect_card_mastery_rewards(vm_index, logger: Logger) -> bool:
return False
time.sleep(3)

# while card mastery icon exists:
while card_mastery_rewards_exist(vm_index):
logger.change_status("Detected card mastery rewards")
# click card mastery icon
collect_first_mastery_reward(vm_index, logger)
logger.change_status("Collected a card mastery reward!")
logger.add_card_mastery_reward_collection()
time.sleep(3)
if not card_mastery_rewards_exist(vm_index):
logger.change_status("No card mastery rewards to collect.")

else:
# while card mastery icon exists:
while card_mastery_rewards_exist(vm_index):
logger.change_status("Detected card mastery rewards")
# click card mastery icon
collect_first_mastery_reward(vm_index, logger)
logger.change_status("Collected a card mastery reward!")
logger.add_card_mastery_reward_collection()
time.sleep(3)

# get to clash main
click(vm_index, 243, 600)
Expand Down

0 comments on commit 3938959

Please sign in to comment.