1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-04-13 02:25:51 +08:00

Fix: invest button may change in retries

This commit is contained in:
LmeSzinc
2025-03-28 01:35:45 +08:00
parent a4233d4743
commit 6ba14c4873
2 changed files with 11 additions and 8 deletions

View File

@@ -170,12 +170,14 @@ class HospitalClue(HospitalUI):
if self.appear_then_click(HOSIPITAL_CLUE_CHECK, offset=(20, 20), interval=2):
continue
def invest_enter(self, invest, skip_first_screenshot=True):
def invest_enter(self, skip_first_screenshot=True):
"""
Args:
invest:
skip_first_screenshot:
Returns:
bool: If success to enter
Pages:
in: is_in_clue
out: FLEET_PREPARATION
@@ -188,9 +190,13 @@ class HospitalClue(HospitalUI):
else:
self.device.screenshot()
if self.appear(FLEET_PREPARATION, offset=(20, 50)):
break
return True
if self.is_in_clue(interval=2):
invest = next(self.iter_invest(), None)
if invest is None:
logger.info('No more invest')
return False
logger.info(f'is_in_clue -> {invest}')
self.device.click(invest)
continue