From 625e9b08f07bf06c95216c06f363e41331b81716 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sat, 2 Sep 2023 21:07:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Fix:=20[CN]=20Handle=20ocr=20result=20with?= =?UTF-8?q?=20"=E4=BA=86"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/daily/daily_quest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/daily/daily_quest.py b/tasks/daily/daily_quest.py index f50947ee5..c5f6d0a20 100644 --- a/tasks/daily/daily_quest.py +++ b/tasks/daily/daily_quest.py @@ -31,6 +31,7 @@ class DailyQuestOcr(Ocr): if self.lang == 'ch': result = result.replace("J", "」") result = result.replace(";", "」") + result = result.replace("了", "」") result = result.replace("宇审", "宇宙") # 进行中」hbadarin if "进行中" in result: From 438ae6f488b419b0cc7d643b70ca1f35893e4406 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 3 Sep 2023 00:12:52 +0800 Subject: [PATCH 2/3] Opt: Reduce click retry when passing by page_main --- tasks/base/ui.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tasks/base/ui.py b/tasks/base/ui.py index 80bf47fe5..21abe365f 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -13,6 +13,7 @@ from tasks.combat.assets.assets_combat_prepare import COMBAT_PREPARE class UI(PopupHandler): ui_current: Page + ui_main_confirm_timer = Timer(0.2, count=0) def ui_page_appear(self, page): """ @@ -112,6 +113,8 @@ class UI(PopupHandler): # Destination page if self.ui_page_appear(destination): logger.info(f'Page arrive: {destination}') + if self.ui_page_confirm(destination): + logger.info(f'Page arrive confirm {destination}') break # Other pages @@ -121,6 +124,8 @@ class UI(PopupHandler): continue if self.appear(page.check_button, interval=5): logger.info(f'Page switch: {page} -> {page.parent}') + if self.ui_page_confirm(page): + logger.info(f'Page arrive confirm {page}') button = page.links[page.parent] self.device.click(button) self.ui_button_interval_reset(button) @@ -287,6 +292,45 @@ class UI(PopupHandler): return False + def _ui_button_confirm( + self, + button, + confirm=Timer(0.1, count=0), + timeout=Timer(2, count=6), + skip_first_screenshot=True + ): + confirm.reset() + timeout.reset() + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + + if timeout.reached(): + logger.warning(f'_ui_button_confirm({button}) timeout') + break + + if self.appear(button): + if confirm.reached(): + break + else: + confirm.reset() + + def ui_page_confirm(self, page): + """ + Args: + page (Page): + + Returns: + bool: If handled + """ + if page == page_main: + self._ui_button_confirm(page.check_button) + return True + + return False + def ui_button_interval_reset(self, button): """ Reset interval of some button to avoid mistaken clicks From 3ac9e264e6d8a5159754dd731ce3c01ea6c34a42 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 3 Sep 2023 00:27:07 +0800 Subject: [PATCH 3/3] Fix: OCR_ASSIGNMENT_LIMIT --- .../assignment/ui/OCR_ASSIGNMENT_LIMIT.png | Bin 8746 -> 11911 bytes .../assignment/assets/assets_assignment_ui.py | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png b/assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png index 30022b8bf270cede8156b06fb4096221ec2f98ec..12d28fac5bb36470f68b7c7afd86313899e66a97 100644 GIT binary patch literal 11911 zcmeH~`8!m7{QnPHs8A^iQHbsmWy?;fP_|T-Y?Up$>|+_qUAmJ!$ug!QlWbYXHkKA* zFfnCfFtVmG2E&XoGko52fA7!r{R_T7e6P!O9nP6+&YAOmzuwQ+oooNzItHsB->Xks4>LAyn`e>_l5-XRFuW$tBUWMy?PAS598 zUO?bcQzN6Jfk6QtUcT-S6fumr9&VSx5Y;C!+=Xo}{9LTe@_hiw$d>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+IyrU1=Xmweh^zkweU);U diff --git a/tasks/assignment/assets/assets_assignment_ui.py b/tasks/assignment/assets/assets_assignment_ui.py index 319fecce4..83352665a 100644 --- a/tasks/assignment/assets/assets_assignment_ui.py +++ b/tasks/assignment/assets/assets_assignment_ui.py @@ -47,10 +47,10 @@ OCR_ASSIGNMENT_LIMIT = ButtonWrapper( name='OCR_ASSIGNMENT_LIMIT', share=Button( file='./assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png', - area=(1095, 82, 1180, 125), - search=(1075, 62, 1200, 145), - color=(41, 44, 50), - button=(1095, 82, 1180, 125), + area=(1095, 95, 1180, 119), + search=(1075, 75, 1200, 139), + color=(51, 54, 60), + button=(1095, 95, 1180, 119), ), ) OCR_ASSIGNMENT_LIST = ButtonWrapper(