Fix: Combat auto on cloud game

This commit is contained in:
LmeSzinc 2024-01-15 03:15:38 +08:00
parent 832b474a56
commit 576276e2da
3 changed files with 9 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -17,10 +17,10 @@ COMBAT_PAUSE = ButtonWrapper(
name='COMBAT_PAUSE', name='COMBAT_PAUSE',
share=Button( share=Button(
file='./assets/share/combat/state/COMBAT_PAUSE.png', file='./assets/share/combat/state/COMBAT_PAUSE.png',
area=(1218, 27, 1245, 53), area=(1218, 43, 1245, 53),
search=(1198, 7, 1265, 73), search=(1198, 23, 1265, 73),
color=(125, 129, 134), color=(121, 126, 131),
button=(1218, 27, 1245, 53), button=(1218, 43, 1245, 53),
), ),
) )
COMBAT_SPEED_2X = ButtonWrapper( COMBAT_SPEED_2X = ButtonWrapper(

View File

@ -54,6 +54,7 @@ class CombatState(UI):
def combat_state_reset(self): def combat_state_reset(self):
self._combat_auto_checked = False self._combat_auto_checked = False
self._combat_2x_checked = False self._combat_2x_checked = False
self._combat_click_interval.clear()
def handle_combat_state(self, auto=True, speed_2x=True): def handle_combat_state(self, auto=True, speed_2x=True):
""" """
@ -65,6 +66,10 @@ class CombatState(UI):
if self._combat_auto_checked and self._combat_2x_checked: if self._combat_auto_checked and self._combat_2x_checked:
return False return False
if not self.is_combat_executing(): if not self.is_combat_executing():
if not self._combat_auto_checked and auto:
if self._combat_click_interval.started() and not self._combat_click_interval.reached():
logger.info('Combat on going, _combat_auto_checked')
self._combat_auto_checked = True
return False return False
if not self._combat_2x_checked: if not self._combat_2x_checked: