From 57c0ed8531e93bd24cbf76c62de4defd532015b4 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Fri, 3 Nov 2023 21:47:08 +0800 Subject: [PATCH] fix: improve cafe performance and stability --- tasks/cafe/cafe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/cafe/cafe.py b/tasks/cafe/cafe.py index e80b847..1776827 100644 --- a/tasks/cafe/cafe.py +++ b/tasks/cafe/cafe.py @@ -133,7 +133,8 @@ class Cafe(UI): case CafeStatus.GOT: logger.info('Cafe reward have been got') self.appear_then_click(GET_REWARD_CLOSE) - return CafeStatus.CLICK + if not self.appear(GET_REWARD_CLOSE): + return CafeStatus.CLICK case CafeStatus.CLICK: buttons = self._get_clickable_buttons(offset=(45, 10)) self.click = len(buttons) @@ -198,7 +199,7 @@ class Cafe(UI): if not is_list and status == CafeStatus.STUDENT_LIST and self.appear(STUDENT_LIST): is_list = True - loading_timer = Timer(5).start() + loading_timer = Timer(4).start() continue if not is_reward_on and status == CafeStatus.OCR: