From e71fa39648192680ad6c23b615ff72796efb5df0 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 4 Apr 2023 21:12:29 +0800 Subject: [PATCH 1/3] Fix: Clicked MAP_GOTO_GLOBE_FOG after swiping the globe map --- module/os/globe_camera.py | 11 ++++++----- module/os/globe_operation.py | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/os/globe_camera.py b/module/os/globe_camera.py index 780906f3f0..d7ed57b7f0 100644 --- a/module/os/globe_camera.py +++ b/module/os/globe_camera.py @@ -31,6 +31,10 @@ def globe_update(self): self.device.screenshot() + # End + if self.is_in_globe(): + break + # A copy of os_map_goto_globe() # May accidentally enter map if self.appear_then_click(MAP_GOTO_GLOBE, offset=(200, 5), interval=3): @@ -63,11 +67,8 @@ def globe_update(self): timeout.reset() continue - if self.is_in_globe(): - break - else: - logger.warning('Trying to do globe_update(), but not in os globe map') - continue + logger.warning('Trying to do globe_update(), but not in os globe map') + continue self._globe_init() self.globe.load(self.device.image) diff --git a/module/os/globe_operation.py b/module/os/globe_operation.py index 114150b36a..f2852bc614 100644 --- a/module/os/globe_operation.py +++ b/module/os/globe_operation.py @@ -297,6 +297,10 @@ def os_map_goto_globe(self, unpin=True, skip_first_screenshot=True): else: self.device.screenshot() + # End + if self.is_in_globe(): + break + if self.appear_then_click(MAP_GOTO_GLOBE, offset=(200, 5), interval=5): # Just to initialize interval timer of MAP_GOTO_GLOBE_FOG self.appear(MAP_GOTO_GLOBE_FOG, interval=5) @@ -324,10 +328,6 @@ def os_map_goto_globe(self, unpin=True, skip_first_screenshot=True): if self.handle_popup_confirm('GOTO_GLOBE'): continue - # End - if self.is_in_globe(): - break - skip_first_screenshot = True confirm_timer = Timer(1, count=2).start() unpinned = 0 From de351f308e34ac2fd8b5ba1317a7fa825efe9935 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 4 Apr 2023 21:21:47 +0800 Subject: [PATCH 2/3] Fix: equip_enter with long_click=False (#2453) --- module/equipment/equipment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/equipment/equipment.py b/module/equipment/equipment.py index a9936953af..f11148c11d 100644 --- a/module/equipment/equipment.py +++ b/module/equipment/equipment.py @@ -75,10 +75,11 @@ def equip_enter(self, click_button, check_button=EQUIPMENT_OPEN, long_click=True break # Long click accidentally became normal click, exit from dock - if self.appear(DOCK_CHECK, offset=(20, 20), interval=3): - logger.info(f'equip_enter {DOCK_CHECK} -> {BACK_ARROW}') - self.device.click(BACK_ARROW) - continue + if long_click: + if self.appear(DOCK_CHECK, offset=(20, 20), interval=3): + logger.info(f'equip_enter {DOCK_CHECK} -> {BACK_ARROW}') + self.device.click(BACK_ARROW) + continue if enter_timer.reached(): if long_click: self.device.long_click(click_button, duration=(1.5, 1.7)) From 63633aea6bf838b4a95500638aaa555c6060353e Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 4 Apr 2023 22:36:44 +0800 Subject: [PATCH 3/3] Fix: Parse OpSi zone names in Arbiter zones --- module/os/globe_zone.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/module/os/globe_zone.py b/module/os/globe_zone.py index 1a3a3ddb01..df0f4ef191 100644 --- a/module/os/globe_zone.py +++ b/module/os/globe_zone.py @@ -125,6 +125,24 @@ def parse_name(n): return zone if name == parse_name(zone.tw): return zone + # Normal arbiter, Hard arbiter, BOSS after hard arbiter cleared + # 普通难度:仲裁者·XXX, 困难难度:仲裁者·XXX, 困难模拟战:仲裁机关 + for keyword in ['普通', '困难', '仲裁']: + if keyword in name: + return self.name_to_zone(154) + # Normal - Arbiter: XXX, Hard - Arbiter: XXX, Hard - Arbiter (Practice) + for keyword in ['normal', 'hard', 'arbiter']: + if keyword in name: + return self.name_to_zone(154) + # ノーマル:アビータ・XXX, ハード:アビータ・XXX, ハード模擬戦:アビータ + for keyword in ['ノーマル', 'ハード', 'アビータ', + 'ノ一マル', 'ハ一ド', 'アビ一タ']: + if keyword in name: + return self.name_to_zone(154) + # 普通難度:仲裁者·XXX, 困難難度:仲裁者·XXX, 困難模擬戰:仲裁機關 + for keyword in ['普通', '困難', '仲裁']: + if keyword in name: + return self.name_to_zone(154) raise ScriptError(f'Unable to find OS globe zone: {name}') def zone_nearest_azur_port(self, zone):