diff --git a/assets/share/freebies/support_reward/CAN_GET_REWARD.png b/assets/share/freebies/support_reward/CAN_GET_REWARD.png index afaf00938..a7c64e380 100644 Binary files a/assets/share/freebies/support_reward/CAN_GET_REWARD.png and b/assets/share/freebies/support_reward/CAN_GET_REWARD.png differ diff --git a/assets/share/freebies/support_reward/IN_PROFILE.png b/assets/share/freebies/support_reward/IN_PROFILE.png index b6392d7fd..a6f257eea 100644 Binary files a/assets/share/freebies/support_reward/IN_PROFILE.png and b/assets/share/freebies/support_reward/IN_PROFILE.png differ diff --git a/assets/share/freebies/support_reward/REWARD_POPUP.png b/assets/share/freebies/support_reward/REWARD_POPUP.png new file mode 100644 index 000000000..a4a0edcc9 Binary files /dev/null and b/assets/share/freebies/support_reward/REWARD_POPUP.png differ diff --git a/tasks/freebies/assets/assets_freebies_support_reward.py b/tasks/freebies/assets/assets_freebies_support_reward.py index 56d950635..64acd0200 100644 --- a/tasks/freebies/assets/assets_freebies_support_reward.py +++ b/tasks/freebies/assets/assets_freebies_support_reward.py @@ -7,20 +7,20 @@ CAN_GET_REWARD = ButtonWrapper( name='CAN_GET_REWARD', share=Button( file='./assets/share/freebies/support_reward/CAN_GET_REWARD.png', - area=(1066, 121, 1097, 144), - search=(1046, 101, 1117, 164), - color=(245, 225, 170), - button=(1066, 121, 1097, 144), + area=(1092, 181, 1123, 204), + search=(1072, 161, 1143, 224), + color=(246, 227, 173), + button=(1092, 181, 1123, 204), ), ) IN_PROFILE = ButtonWrapper( name='IN_PROFILE', share=Button( file='./assets/share/freebies/support_reward/IN_PROFILE.png', - area=(647, 128, 673, 146), - search=(627, 108, 693, 166), + area=(640, 155, 666, 173), + search=(620, 135, 686, 193), color=(109, 97, 83), - button=(647, 128, 673, 146), + button=(640, 155, 666, 173), ), ) MENU_TO_PROFILE = ButtonWrapper( @@ -50,3 +50,13 @@ PROFILE = ButtonWrapper( button=(907, 102, 1092, 132), ), ) +REWARD_POPUP = ButtonWrapper( + name='REWARD_POPUP', + share=Button( + file='./assets/share/freebies/support_reward/REWARD_POPUP.png', + area=(883, 552, 914, 580), + search=(863, 532, 934, 600), + color=(88, 89, 114), + button=(883, 552, 914, 580), + ), +) diff --git a/tasks/freebies/support_reward.py b/tasks/freebies/support_reward.py index c3313b7e8..c6fe72148 100644 --- a/tasks/freebies/support_reward.py +++ b/tasks/freebies/support_reward.py @@ -1,13 +1,14 @@ from module.base.timer import Timer from module.logger import logger -from tasks.base.assets.assets_base_page import MENU_CHECK +from tasks.base.assets.assets_base_page import CLOSE, MENU_CHECK from tasks.base.page import page_menu from tasks.base.ui import UI from tasks.freebies.assets.assets_freebies_support_reward import ( CAN_GET_REWARD, IN_PROFILE, MENU_TO_PROFILE, - PROFILE + PROFILE, + REWARD_POPUP, ) @@ -70,6 +71,9 @@ class SupportReward(UI): if self.reward_appear(): logger.info('Got reward') break + if self.appear(REWARD_POPUP): + logger.info('Got reward popup') + break if timeout.reached(): logger.warning('Get support reward timeout') break @@ -96,10 +100,14 @@ class SupportReward(UI): if self.appear(MENU_CHECK): return True + if self.appear_then_click(REWARD_POPUP, interval=2): + logger.info(f'{REWARD_POPUP} - {CLOSE}') + self.device.click(CLOSE) + continue if self.handle_ui_close(IN_PROFILE, interval=2): continue if self.handle_reward(click_button=CAN_GET_REWARD): - # # Avoid clicking on some other buttons + # Avoid clicking on some other buttons continue