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