1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 22:05:12 +00:00

perf: use better cafe interact method

This commit is contained in:
YoursFunny 2023-11-03 22:27:54 +08:00
parent 0b2487487b
commit d53e280bfc
Signed by: YoursFunny
GPG Key ID: 207EDC3CD5B40F9C

View File

@ -151,7 +151,7 @@ class Cafe(UI):
logger.attr('Clickable', self.click) logger.attr('Clickable', self.click)
if not buttons: if not buttons:
return CafeStatus.CHECK return CafeStatus.CHECK
self.device.click(buttons[0]) self.click_with_interval(buttons[0], interval=1)
case CafeStatus.CHECK: case CafeStatus.CHECK:
buttons = self._get_clickable_buttons() buttons = self._get_clickable_buttons()
if not self.is_adjust_on: if not self.is_adjust_on:
@ -194,7 +194,6 @@ class Cafe(UI):
status = CafeStatus.STUDENT_LIST status = CafeStatus.STUDENT_LIST
loading_timer = Timer(2).start() loading_timer = Timer(2).start()
action_timer = Timer(1.5, count=1) # cant be too fast action_timer = Timer(1.5, count=1) # cant be too fast
check_timer = Timer(1, count=1)
is_list = False is_list = False
is_reset = False is_reset = False
is_second = False is_second = False
@ -253,9 +252,6 @@ class Cafe(UI):
is_reset = True is_reset = True
continue continue
if status == CafeStatus.CHECK and not check_timer.reached_and_reset():
continue
if action_timer.reached_and_reset(): if action_timer.reached_and_reset():
logger.attr('Status', status) logger.attr('Status', status)
status = self._handle_cafe(status) status = self._handle_cafe(status)