mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Skip moving down when switching from auto to manual
This commit is contained in:
parent
ed25ce48ae
commit
dc54220dbc
@ -8,6 +8,7 @@ class CombatAuto(ModuleBase):
|
|||||||
auto_skip_timer = Timer(1)
|
auto_skip_timer = Timer(1)
|
||||||
auto_click_interval_timer = Timer(1)
|
auto_click_interval_timer = Timer(1)
|
||||||
auto_mode_checked = False
|
auto_mode_checked = False
|
||||||
|
auto_mode_switched = False
|
||||||
auto_mode_click_timer = Timer(5)
|
auto_mode_click_timer = Timer(5)
|
||||||
|
|
||||||
def combat_joystick_appear(self) -> bool:
|
def combat_joystick_appear(self) -> bool:
|
||||||
@ -26,6 +27,7 @@ class CombatAuto(ModuleBase):
|
|||||||
self.auto_mode_click_timer.reset()
|
self.auto_mode_click_timer.reset()
|
||||||
self.auto_skip_timer.reset()
|
self.auto_skip_timer.reset()
|
||||||
self.auto_mode_checked = False
|
self.auto_mode_checked = False
|
||||||
|
self.auto_mode_switched = False
|
||||||
|
|
||||||
def handle_combat_auto(self, auto):
|
def handle_combat_auto(self, auto):
|
||||||
"""
|
"""
|
||||||
@ -51,11 +53,13 @@ class CombatAuto(ModuleBase):
|
|||||||
if auto:
|
if auto:
|
||||||
self.device.click(COMBAT_AUTO_SWITCH)
|
self.device.click(COMBAT_AUTO_SWITCH)
|
||||||
self.auto_click_interval_timer.reset()
|
self.auto_click_interval_timer.reset()
|
||||||
|
self.auto_mode_switched = True
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
if not auto:
|
if not auto:
|
||||||
self.device.click(COMBAT_AUTO_SWITCH)
|
self.device.click(COMBAT_AUTO_SWITCH)
|
||||||
self.auto_click_interval_timer.reset()
|
self.auto_click_interval_timer.reset()
|
||||||
|
self.auto_mode_switched = True
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
@ -4,6 +4,7 @@ from module.combat.assets import *
|
|||||||
|
|
||||||
class CombatManual(ModuleBase):
|
class CombatManual(ModuleBase):
|
||||||
auto_mode_checked = False
|
auto_mode_checked = False
|
||||||
|
auto_mode_switched = False
|
||||||
manual_executed = False
|
manual_executed = False
|
||||||
|
|
||||||
def combat_manual_reset(self):
|
def combat_manual_reset(self):
|
||||||
@ -19,6 +20,10 @@ class CombatManual(ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if auto != 'stand_still_in_the_middle':
|
if auto != 'stand_still_in_the_middle':
|
||||||
return False
|
return False
|
||||||
|
# When switching from auto to manual, fleets are usually in the middle, no need to move down
|
||||||
|
# Otherwise fleet will be moved to the bottom
|
||||||
|
if self.auto_mode_switched:
|
||||||
|
return False
|
||||||
|
|
||||||
self.device.long_click(MOVE_DOWN, duration=0.8)
|
self.device.long_click(MOVE_DOWN, duration=0.8)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user