diff --git a/assets/share/base/popup/MONTHLY_CARD_GET_ITEM.BUTTON.png b/assets/share/base/popup/MONTHLY_CARD_GET_ITEM.BUTTON.png new file mode 100644 index 000000000..d50e38b37 Binary files /dev/null and b/assets/share/base/popup/MONTHLY_CARD_GET_ITEM.BUTTON.png differ diff --git a/assets/share/base/popup/MONTHLY_CARD_GET_ITEM.png b/assets/share/base/popup/MONTHLY_CARD_GET_ITEM.png new file mode 100644 index 000000000..a68f3c998 Binary files /dev/null and b/assets/share/base/popup/MONTHLY_CARD_GET_ITEM.png differ diff --git a/assets/share/base/popup/MONTHLY_CARD_REWARD.BUTTON.png b/assets/share/base/popup/MONTHLY_CARD_REWARD.BUTTON.png new file mode 100644 index 000000000..d50e38b37 Binary files /dev/null and b/assets/share/base/popup/MONTHLY_CARD_REWARD.BUTTON.png differ diff --git a/assets/share/base/popup/MONTHLY_CARD_REWARD.png b/assets/share/base/popup/MONTHLY_CARD_REWARD.png new file mode 100644 index 000000000..abcdf5b2d Binary files /dev/null and b/assets/share/base/popup/MONTHLY_CARD_REWARD.png differ diff --git a/tasks/base/assets/assets_base_popup.py b/tasks/base/assets/assets_base_popup.py index bca5fabf1..08d91063d 100644 --- a/tasks/base/assets/assets_base_popup.py +++ b/tasks/base/assets/assets_base_popup.py @@ -23,3 +23,23 @@ GET_REWARD = ButtonWrapper( button=(741, 495, 1071, 644), ), ) +MONTHLY_CARD_GET_ITEM = ButtonWrapper( + name='MONTHLY_CARD_GET_ITEM', + share=Button( + file='./assets/share/base/popup/MONTHLY_CARD_GET_ITEM.png', + area=(612, 328, 652, 368), + search=(592, 308, 672, 388), + color=(209, 187, 179), + button=(741, 495, 1071, 644), + ), +) +MONTHLY_CARD_REWARD = ButtonWrapper( + name='MONTHLY_CARD_REWARD', + share=Button( + file='./assets/share/base/popup/MONTHLY_CARD_REWARD.png', + area=(696, 407, 736, 447), + search=(676, 387, 756, 467), + color=(137, 107, 91), + button=(741, 495, 1071, 644), + ), +) diff --git a/tasks/base/popup.py b/tasks/base/popup.py index 0f701c380..4dd8323a0 100644 --- a/tasks/base/popup.py +++ b/tasks/base/popup.py @@ -30,3 +30,20 @@ class PopupHandler(ModuleBase): return True return False + + def handle_monthly_card_reward(self, interval=5) -> bool: + """ + Popup at 04:00 server time if you have purchased the monthly card. + + Args: + interval: + + Returns: + If handled. + """ + if self.appear_then_click(MONTHLY_CARD_REWARD, interval=interval): + return True + if self.appear_then_click(MONTHLY_CARD_GET_ITEM, interval=interval): + return True + + return False diff --git a/tasks/base/ui.py b/tasks/base/ui.py index 777785d28..89152bbb4 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -164,6 +164,10 @@ class UI(PopupHandler): return True if self.handle_battle_pass_notification(): return True + if self.handle_monthly_card_reward(): + return True + + return False def ui_button_interval_reset(self, button): """