Fix: Limit click area of combat states (#339)

This commit is contained in:
LmeSzinc 2024-02-23 23:45:17 +08:00
parent 3ae48fedd8
commit 60ebf0a3ff
4 changed files with 4 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -10,7 +10,7 @@ COMBAT_AUTO = ButtonWrapper(
area=(1113, 22, 1183, 58),
search=(1093, 2, 1203, 78),
color=(135, 137, 131),
button=(1113, 22, 1183, 58),
button=(1136, 31, 1161, 49),
),
)
COMBAT_PAUSE = ButtonWrapper(
@ -30,6 +30,6 @@ COMBAT_SPEED_2X = ButtonWrapper(
area=(1029, 22, 1099, 58),
search=(1009, 2, 1119, 78),
color=(138, 143, 146),
button=(1029, 22, 1099, 58),
button=(1047, 29, 1079, 49),
),
)

View File

@ -67,7 +67,8 @@ class CombatState(UI):
return False
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():
# >=0.2s after clicking the button to avoid random noice
if self._combat_click_interval.current() >= 0.15 and not self._combat_click_interval.reached():
logger.info('Combat on going, _combat_auto_checked')
self._combat_auto_checked = True
return False