mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-08 20:36:04 +08:00
Fix: aside button may change in retries
This commit is contained in:
@@ -272,8 +272,20 @@ class HospitalClue(HospitalUI):
|
|||||||
continue
|
continue
|
||||||
yield button
|
yield button
|
||||||
|
|
||||||
def select_aside(self, button, skip_first_screenshot=True):
|
def select_aside(self, skip_first_screenshot=True):
|
||||||
logger.info(f'Select aside: {button}')
|
"""
|
||||||
|
Args:
|
||||||
|
skip_first_screenshot:
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: True if success to select any unfinished aside
|
||||||
|
False if all aside finished
|
||||||
|
|
||||||
|
Pages:
|
||||||
|
in: is_in_clue
|
||||||
|
"""
|
||||||
|
logger.info(f'Select aside')
|
||||||
|
aside = None
|
||||||
self.interval_clear(HOSIPITAL_CLUE_CHECK)
|
self.interval_clear(HOSIPITAL_CLUE_CHECK)
|
||||||
while 1:
|
while 1:
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
@@ -281,10 +293,15 @@ class HospitalClue(HospitalUI):
|
|||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
# End
|
# End
|
||||||
if self.is_aside_selected(button):
|
if aside is not None and self.is_aside_selected(aside):
|
||||||
break
|
return True
|
||||||
if self.is_in_clue(interval=2):
|
if self.is_in_clue(interval=2):
|
||||||
self.device.click(button)
|
aside = next(self.iter_aside(), None)
|
||||||
|
if aside is None:
|
||||||
|
logger.info('No more aside')
|
||||||
|
return False
|
||||||
|
logger.info(f'is_in_clue -> {aside}')
|
||||||
|
self.device.click(aside)
|
||||||
continue
|
continue
|
||||||
if self.handle_clue_exit():
|
if self.handle_clue_exit():
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user