From aa47cc9b3e5a57ffb1a4532d259e6b0498932ef6 Mon Sep 17 00:00:00 2001 From: guoh064 <50830808+guoh064@users.noreply.github.com> Date: Fri, 20 Feb 2026 11:29:39 +0800 Subject: [PATCH] fix: AUTOMATION_ON needs offset in combat --- module/combat/combat.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/module/combat/combat.py b/module/combat/combat.py index 818d3de9b..1266b3917 100644 --- a/module/combat/combat.py +++ b/module/combat/combat.py @@ -648,3 +648,38 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan # self.handle_map_after_combat_story() logger.info('Combat end.') + + +class Combat(Combat): + def handle_combat_automation_set(self, auto): + """ + Args: + auto (bool): If use auto. + + Returns: + bool: + """ + if not self._automation_set_timer.reached(): + return False + + if self.appear(AUTOMATION_ON, offset=(60, 10)): + logger.info('[Automation] ON') + if not auto: + self.device.click(AUTOMATION_SWITCH) + self.device.sleep(1) + self._automation_set_timer.reset() + return True + + if self.appear(AUTOMATION_OFF, offset=(60, 10)): + logger.info('[Automation] OFF') + if auto: + self.device.click(AUTOMATION_SWITCH) + self.device.sleep(1) + self._automation_set_timer.reset() + return True + + if self.handle_combat_automation_confirm(): + self._automation_set_timer.reset() + return True + + return False