diff --git a/assets/cn/freebies/REWARD_RECEIVE_WHITE.png b/assets/cn/freebies/REWARD_RECEIVE_WHITE.png new file mode 100644 index 000000000..7d5411408 Binary files /dev/null and b/assets/cn/freebies/REWARD_RECEIVE_WHITE.png differ diff --git a/assets/cn/ui/BATTLE_PASS_CHECK.png b/assets/cn/ui/BATTLE_PASS_CHECK.png index f6e826c3a..4861b75ac 100644 Binary files a/assets/cn/ui/BATTLE_PASS_CHECK.png and b/assets/cn/ui/BATTLE_PASS_CHECK.png differ diff --git a/assets/en/freebies/REWARD_RECEIVE_WHITE.png b/assets/en/freebies/REWARD_RECEIVE_WHITE.png new file mode 100644 index 000000000..2c133acb3 Binary files /dev/null and b/assets/en/freebies/REWARD_RECEIVE_WHITE.png differ diff --git a/assets/en/ui/BATTLE_PASS_CHECK.png b/assets/en/ui/BATTLE_PASS_CHECK.png index bf9cd84c1..4861b75ac 100644 Binary files a/assets/en/ui/BATTLE_PASS_CHECK.png and b/assets/en/ui/BATTLE_PASS_CHECK.png differ diff --git a/assets/jp/freebies/REWARD_RECEIVE_WHITE.png b/assets/jp/freebies/REWARD_RECEIVE_WHITE.png new file mode 100644 index 000000000..87d36ea17 Binary files /dev/null and b/assets/jp/freebies/REWARD_RECEIVE_WHITE.png differ diff --git a/assets/jp/ui/BATTLE_PASS_CHECK.png b/assets/jp/ui/BATTLE_PASS_CHECK.png index 173081cc0..4861b75ac 100644 Binary files a/assets/jp/ui/BATTLE_PASS_CHECK.png and b/assets/jp/ui/BATTLE_PASS_CHECK.png differ diff --git a/module/campaign/campaign_event.py b/module/campaign/campaign_event.py index 6929b9bee..76f46715c 100644 --- a/module/campaign/campaign_event.py +++ b/module/campaign/campaign_event.py @@ -7,6 +7,7 @@ from module.config.utils import DEFAULT_TIME from module.logger import logger from module.ui.assets import CAMPAIGN_MENU_NO_EVENT from module.ui.page import page_event, page_campaign_menu, page_sp, page_coalition +from module.war_archives.assets import WAR_ARCHIVES_CAMPAIGN_CHECK class CampaignEvent(CampaignStatus): @@ -137,26 +138,32 @@ class CampaignEvent(CampaignStatus): def ui_goto_event(self): # Already in page_event, skip event_check. if self.ui_get_current_page() == page_event: - logger.info('Already at page_event') - return True - else: - self.ui_goto(page_campaign_menu) - # Check event availability - if self.is_event_entrance_available(): - self.ui_goto(page_event) + if self.appear(WAR_ARCHIVES_CAMPAIGN_CHECK, offset=(20, 20)): + logger.info('At war archives') + self.ui_goto_main() + else: + logger.info('Already at page_event') return True + self.ui_goto(page_campaign_menu) + # Check event availability + if self.is_event_entrance_available(): + self.ui_goto(page_event) + return True def ui_goto_sp(self): # Already in page_event, skip event_check. if self.ui_get_current_page() == page_sp: - logger.info('Already at page_sp') - return True - else: - self.ui_goto(page_campaign_menu) - # Check event availability - if self.is_event_entrance_available(): - self.ui_goto(page_sp) + if self.appear(WAR_ARCHIVES_CAMPAIGN_CHECK, offset=(20, 20)): + logger.info('At war archives') + self.ui_goto_main() + else: + logger.info('Already at page_sp') return True + self.ui_goto(page_campaign_menu) + # Check event availability + if self.is_event_entrance_available(): + self.ui_goto(page_sp) + return True def ui_goto_coalition(self): # Already in page_event, skip event_check. diff --git a/module/device/method/ldopengl.py b/module/device/method/ldopengl.py index cd7af4c59..4e4687173 100644 --- a/module/device/method/ldopengl.py +++ b/module/device/method/ldopengl.py @@ -314,6 +314,9 @@ class LDOpenGL(Platform): def ldopengl_available(self) -> bool: if not self.is_ldplayer_bluestacks_family: return False + logger.attr('EmulatorInfo_Emulator', self.config.EmulatorInfo_Emulator) + if self.config.EmulatorInfo_Emulator not in ['LDPlayer9']: + return False try: _ = self.ldopengl diff --git a/module/freebies/assets.py b/module/freebies/assets.py index 1675bf8ce..c0359782c 100644 --- a/module/freebies/assets.py +++ b/module/freebies/assets.py @@ -30,3 +30,4 @@ OCR_DATA_KEY = Button(area={'cn': (132, 42, 233, 70), 'en': (132, 42, 233, 70), PURCHASE_POPUP = Button(area={'cn': (907, 204, 934, 229), 'en': (907, 204, 934, 229), 'jp': (907, 204, 934, 229), 'tw': (907, 204, 934, 229)}, color={'cn': (176, 130, 110), 'en': (176, 130, 110), 'jp': (176, 130, 110), 'tw': (176, 130, 110)}, button={'cn': (907, 204, 934, 229), 'en': (907, 204, 934, 229), 'jp': (907, 204, 934, 229), 'tw': (907, 204, 934, 229)}, file={'cn': './assets/cn/freebies/PURCHASE_POPUP.png', 'en': './assets/en/freebies/PURCHASE_POPUP.png', 'jp': './assets/jp/freebies/PURCHASE_POPUP.png', 'tw': './assets/tw/freebies/PURCHASE_POPUP.png'}) REWARD_RECEIVE = Button(area={'cn': (1192, 520, 1255, 536), 'en': (1192, 522, 1254, 534), 'jp': (1186, 518, 1259, 536), 'tw': (1192, 520, 1255, 536)}, color={'cn': (191, 178, 163), 'en': (195, 182, 168), 'jp': (208, 197, 183), 'tw': (191, 178, 163)}, button={'cn': (1192, 520, 1255, 536), 'en': (1192, 522, 1254, 534), 'jp': (1186, 518, 1259, 536), 'tw': (1192, 520, 1255, 536)}, file={'cn': './assets/cn/freebies/REWARD_RECEIVE.png', 'en': './assets/en/freebies/REWARD_RECEIVE.png', 'jp': './assets/jp/freebies/REWARD_RECEIVE.png', 'tw': './assets/cn/freebies/REWARD_RECEIVE.png'}) REWARD_RECEIVE_SP = Button(area={'cn': (1105, 579, 1184, 597), 'en': (1090, 580, 1197, 596), 'jp': (1091, 599, 1171, 618), 'tw': (1105, 579, 1184, 597)}, color={'cn': (178, 143, 126), 'en': (168, 129, 111), 'jp': (168, 127, 109), 'tw': (178, 143, 126)}, button={'cn': (1105, 579, 1184, 597), 'en': (1090, 580, 1197, 596), 'jp': (1091, 599, 1171, 618), 'tw': (1105, 579, 1184, 597)}, file={'cn': './assets/cn/freebies/REWARD_RECEIVE_SP.png', 'en': './assets/en/freebies/REWARD_RECEIVE_SP.png', 'jp': './assets/jp/freebies/REWARD_RECEIVE_SP.png', 'tw': './assets/cn/freebies/REWARD_RECEIVE_SP.png'}) +REWARD_RECEIVE_WHITE = Button(area={'cn': (1119, 603, 1198, 622), 'en': (1115, 604, 1202, 620), 'jp': (1120, 604, 1198, 623), 'tw': (1119, 603, 1198, 622)}, color={'cn': (255, 211, 156), 'en': (255, 209, 153), 'jp': (255, 199, 131), 'tw': (255, 211, 156)}, button={'cn': (1119, 603, 1198, 622), 'en': (1115, 604, 1202, 620), 'jp': (1120, 604, 1198, 623), 'tw': (1119, 603, 1198, 622)}, file={'cn': './assets/cn/freebies/REWARD_RECEIVE_WHITE.png', 'en': './assets/en/freebies/REWARD_RECEIVE_WHITE.png', 'jp': './assets/jp/freebies/REWARD_RECEIVE_WHITE.png', 'tw': './assets/cn/freebies/REWARD_RECEIVE_WHITE.png'}) diff --git a/module/freebies/battle_pass.py b/module/freebies/battle_pass.py index 30172da31..c9986c1cc 100644 --- a/module/freebies/battle_pass.py +++ b/module/freebies/battle_pass.py @@ -69,14 +69,17 @@ class BattlePass(Combat, UI): else: self.device.screenshot() - if self.appear_then_click(REWARD_RECEIVE, offset=(20, 20), interval=2): + if self.appear_then_click(REWARD_RECEIVE, offset=(20, 20), interval=3): confirm_timer.reset() continue - if self.appear(REWARD_RECEIVE_SP, offset=(20, 20), interval=2) \ + if self.appear(REWARD_RECEIVE_SP, offset=(20, 20), interval=3) \ and REWARD_RECEIVE_SP.match_appear_on(self.device.image, threshold=15): self.device.click(REWARD_RECEIVE_SP) confirm_timer.reset() continue + if self.appear_then_click(REWARD_RECEIVE_WHITE, offset=(20, 20), interval=3): + confirm_timer.reset() + continue if self.handle_battle_pass_popup(): confirm_timer.reset() continue @@ -98,7 +101,9 @@ class BattlePass(Combat, UI): continue # End - if self.appear(BATTLE_PASS_CHECK, offset=(20, 20)) and not self.appear(REWARD_RECEIVE, offset=(20, 20)): + if self.appear(BATTLE_PASS_CHECK, offset=(20, 20)) \ + and not self.appear(REWARD_RECEIVE, offset=(20, 20)) \ + and not self.appear(REWARD_RECEIVE_WHITE, offset=(20, 20)): if confirm_timer.reached(): break else: diff --git a/module/meta_reward/meta_reward.py b/module/meta_reward/meta_reward.py index 29f025ea5..16bc07b8b 100644 --- a/module/meta_reward/meta_reward.py +++ b/module/meta_reward/meta_reward.py @@ -117,7 +117,7 @@ class DossierReward(Combat, UI): in: dossier meta page """ self.device.screenshot() - if self.appear(DOSSIER_REWARD_RECEIVE, offset=(100, 100), threshold=30): + if self.appear(DOSSIER_REWARD_RECEIVE, offset=(-40, 10, -10, 40), threshold=0.7): logger.info('Found dossier reward red dot') return True else: diff --git a/module/retire/enhancement.py b/module/retire/enhancement.py index e96177e98..1c8849967 100644 --- a/module/retire/enhancement.py +++ b/module/retire/enhancement.py @@ -220,9 +220,12 @@ class Enhancement(Dock): if state == "state_enhance_check": # Avoid too_many_click exception caused by multiple tries without material if state_list[-2:] == ["state_enhance_recommend", "state_enhance_fail"]: - if len(self.device.click_record): - while self.device.click_record[-1] in ['ENHANCE_RECOMMEND', 'SHIP_SWIPE']: - self.device.click_record.pop() + while self.device.click_record and (self.device.click_record[-1] in ['ENHANCE_RECOMMEND', 'SHIP_SWIPE']): + self.device.click_record.pop() + # Avoid too_many_click exception caused by enhancement failure on in-battle ships + elif state_list[-3:] == ["state_enhance_attempt", "state_enhance_confirm", "state_enhance_fail"]: + while self.device.click_record and (self.device.click_record[-1] in ['ENHANCE_RECOMMEND', 'SHIP_SWIPE', 'ENHANCE_CONFIRM']): + self.device.click_record.pop() state_list.clear() state_list.append(state) if len(state_list) > 30: diff --git a/module/ui/assets.py b/module/ui/assets.py index 5b02726e0..06ed63413 100644 --- a/module/ui/assets.py +++ b/module/ui/assets.py @@ -8,7 +8,7 @@ ACADEMY_CHECK = Button(area={'cn': (121, 14, 175, 39), 'en': (122, 19, 258, 35), ACADEMY_GOTO_GAME_ROOM = Button(area={'cn': (1074, 340, 1103, 374), 'en': (1074, 340, 1103, 374), 'jp': (1074, 340, 1103, 374), 'tw': (1074, 340, 1103, 374)}, color={'cn': (208, 185, 150), 'en': (208, 185, 150), 'jp': (208, 185, 150), 'tw': (208, 185, 150)}, button={'cn': (1074, 340, 1103, 374), 'en': (1074, 340, 1103, 374), 'jp': (1074, 340, 1103, 374), 'tw': (1074, 340, 1103, 374)}, file={'cn': './assets/cn/ui/ACADEMY_GOTO_GAME_ROOM.png', 'en': './assets/en/ui/ACADEMY_GOTO_GAME_ROOM.png', 'jp': './assets/jp/ui/ACADEMY_GOTO_GAME_ROOM.png', 'tw': './assets/tw/ui/ACADEMY_GOTO_GAME_ROOM.png'}) ACADEMY_GOTO_MUNITIONS = Button(area={'cn': (1046, 188, 1137, 210), 'en': (1039, 185, 1145, 209), 'jp': (1057, 188, 1126, 210), 'tw': (1044, 184, 1139, 213)}, color={'cn': (133, 135, 165), 'en': (115, 120, 153), 'jp': (129, 133, 162), 'tw': (113, 119, 149)}, button={'cn': (1046, 188, 1137, 210), 'en': (1039, 185, 1145, 209), 'jp': (1057, 188, 1126, 210), 'tw': (1044, 184, 1139, 213)}, file={'cn': './assets/cn/ui/ACADEMY_GOTO_MUNITIONS.png', 'en': './assets/en/ui/ACADEMY_GOTO_MUNITIONS.png', 'jp': './assets/jp/ui/ACADEMY_GOTO_MUNITIONS.png', 'tw': './assets/tw/ui/ACADEMY_GOTO_MUNITIONS.png'}) BACK_ARROW = Button(area={'cn': (33, 44, 47, 64), 'en': (33, 44, 47, 64), 'jp': (33, 44, 47, 64), 'tw': (33, 44, 47, 64)}, color={'cn': (112, 118, 152), 'en': (112, 118, 152), 'jp': (112, 118, 152), 'tw': (112, 118, 152)}, button={'cn': (33, 31, 81, 78), 'en': (33, 31, 81, 78), 'jp': (33, 31, 81, 78), 'tw': (33, 31, 81, 78)}, file={'cn': './assets/cn/ui/BACK_ARROW.png', 'en': './assets/en/ui/BACK_ARROW.png', 'jp': './assets/jp/ui/BACK_ARROW.png', 'tw': './assets/tw/ui/BACK_ARROW.png'}) -BATTLE_PASS_CHECK = Button(area={'cn': (130, 20, 240, 44), 'en': (133, 27, 238, 36), 'jp': (112, 18, 279, 42), 'tw': (130, 18, 241, 45)}, color={'cn': (182, 175, 165), 'en': (96, 88, 76), 'jp': (128, 123, 114), 'tw': (174, 166, 156)}, button={'cn': (130, 20, 240, 44), 'en': (133, 27, 238, 36), 'jp': (112, 18, 279, 42), 'tw': (130, 18, 241, 45)}, file={'cn': './assets/cn/ui/BATTLE_PASS_CHECK.png', 'en': './assets/en/ui/BATTLE_PASS_CHECK.png', 'jp': './assets/jp/ui/BATTLE_PASS_CHECK.png', 'tw': './assets/tw/ui/BATTLE_PASS_CHECK.png'}) +BATTLE_PASS_CHECK = Button(area={'cn': (701, 674, 723, 699), 'en': (701, 674, 723, 699), 'jp': (701, 674, 723, 699), 'tw': (130, 18, 241, 45)}, color={'cn': (129, 130, 134), 'en': (129, 130, 134), 'jp': (129, 130, 134), 'tw': (174, 166, 156)}, button={'cn': (701, 674, 723, 699), 'en': (701, 674, 723, 699), 'jp': (701, 674, 723, 699), 'tw': (130, 18, 241, 45)}, file={'cn': './assets/cn/ui/BATTLE_PASS_CHECK.png', 'en': './assets/en/ui/BATTLE_PASS_CHECK.png', 'jp': './assets/jp/ui/BATTLE_PASS_CHECK.png', 'tw': './assets/tw/ui/BATTLE_PASS_CHECK.png'}) BUILD_CHECK = Button(area={'cn': (121, 15, 175, 40), 'en': (121, 17, 191, 39), 'jp': (121, 15, 175, 40), 'tw': (116, 11, 179, 41)}, color={'cn': (163, 179, 215), 'en': (129, 144, 185), 'jp': (166, 180, 215), 'tw': (128, 142, 179)}, button={'cn': (121, 15, 175, 40), 'en': (121, 17, 191, 39), 'jp': (121, 15, 175, 40), 'tw': (116, 11, 179, 41)}, file={'cn': './assets/cn/ui/BUILD_CHECK.png', 'en': './assets/en/ui/BUILD_CHECK.png', 'jp': './assets/jp/ui/BUILD_CHECK.png', 'tw': './assets/tw/ui/BUILD_CHECK.png'}) CAMPAIGN_CHECK = Button(area={'cn': (173, 78, 194, 98), 'en': (136, 79, 183, 91), 'jp': (172, 77, 192, 98), 'tw': (173, 78, 194, 98)}, color={'cn': (165, 182, 221), 'en': (109, 126, 172), 'jp': (163, 181, 220), 'tw': (165, 182, 221)}, button={'cn': (173, 78, 194, 98), 'en': (136, 79, 183, 91), 'jp': (172, 77, 192, 98), 'tw': (173, 78, 194, 98)}, file={'cn': './assets/cn/ui/CAMPAIGN_CHECK.png', 'en': './assets/en/ui/CAMPAIGN_CHECK.gif', 'jp': './assets/jp/ui/CAMPAIGN_CHECK.png', 'tw': './assets/tw/ui/CAMPAIGN_CHECK.png'}) CAMPAIGN_GOTO_DAILY = Button(area={'cn': (804, 648, 892, 703), 'en': (807, 648, 891, 703), 'jp': (791, 647, 893, 703), 'tw': (804, 648, 892, 703)}, color={'cn': (189, 145, 78), 'en': (165, 123, 54), 'jp': (176, 141, 73), 'tw': (189, 145, 78)}, button={'cn': (804, 648, 892, 703), 'en': (807, 648, 891, 703), 'jp': (791, 647, 893, 703), 'tw': (804, 648, 892, 703)}, file={'cn': './assets/cn/ui/CAMPAIGN_GOTO_DAILY.png', 'en': './assets/en/ui/CAMPAIGN_GOTO_DAILY.png', 'jp': './assets/jp/ui/CAMPAIGN_GOTO_DAILY.png', 'tw': './assets/tw/ui/CAMPAIGN_GOTO_DAILY.png'}) diff --git a/module/war_archives/war_archives.py b/module/war_archives/war_archives.py index 40e2c9a46..d4943c1db 100644 --- a/module/war_archives/war_archives.py +++ b/module/war_archives/war_archives.py @@ -31,7 +31,5 @@ class CampaignWarArchives(CampaignRun, CampaignBase): return False def run(self, name=None, folder='campaign_main', mode='normal', total=0): - backup = self.config.temporary(USE_DATA_KEY=True) + self.config.override(USE_DATA_KEY=True) super().run(name, folder, mode, total) - backup.recover() - self.ui_goto_main() # Go to main, as remaining in page can throw off Event task