From fa209e1cf517ecc08479bce4c7255a48de7b2748 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 18 Apr 2024 23:00:49 +0800 Subject: [PATCH] Fix: Character trial ended at page_main --- route/daily/HimekoTrial.py | 8 +++++++- tasks/combat/skill.py | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/route/daily/HimekoTrial.py b/route/daily/HimekoTrial.py index d5f77b433..8aee25967 100644 --- a/route/daily/HimekoTrial.py +++ b/route/daily/HimekoTrial.py @@ -16,7 +16,13 @@ class Route(RouteBase, Combat, CharacterTrial): def wait_next_skill(self, expected_end=None, skip_first_screenshot=True): # Ended at START_TRIAL def combat_end(): - return self.match_template_color(START_TRIAL) + if self.match_template_color(START_TRIAL): + logger.info('Trial ended at START_TRIAL') + return True + if self.is_in_main(): + logger.warning('Trial ended at is_in_main()') + return True + return False return super().wait_next_skill(expected_end=combat_end, skip_first_screenshot=skip_first_screenshot) diff --git a/tasks/combat/skill.py b/tasks/combat/skill.py index 35e8c05fa..081c9b44d 100644 --- a/tasks/combat/skill.py +++ b/tasks/combat/skill.py @@ -13,7 +13,7 @@ class CombatSkill(UI): if not self.appear(IN_SKILL): return False - if not self.image_color_count(IN_SKILL, color=(255, 255, 255), threshold=221, count=50): + if not self.image_color_count(IN_SKILL, color=(255, 255, 255), threshold=180, count=50): return False return True @@ -51,6 +51,10 @@ class CombatSkill(UI): logger.info(f'Skill used: {button} (icon changed)') break + if self.is_in_main(): + logger.warning('_skill_click ended at is_in_main') + break + def _is_skill_active(self, button): flag = self.image_color_count(button, color=(220, 196, 145), threshold=221, count=50) return flag