1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 07:49:25 +08:00

fix: AUTOMATION_ON needs offset in combat

This commit is contained in:
guoh064
2026-02-20 11:29:39 +08:00
committed by 0O0o0oOoO00
parent 947f66c915
commit aa47cc9b3e

View File

@@ -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