mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-26 09:25:02 +08:00
Fix: invest button may change in retries
This commit is contained in:
@@ -170,12 +170,14 @@ class HospitalClue(HospitalUI):
|
|||||||
if self.appear_then_click(HOSIPITAL_CLUE_CHECK, offset=(20, 20), interval=2):
|
if self.appear_then_click(HOSIPITAL_CLUE_CHECK, offset=(20, 20), interval=2):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
def invest_enter(self, invest, skip_first_screenshot=True):
|
def invest_enter(self, skip_first_screenshot=True):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
invest:
|
|
||||||
skip_first_screenshot:
|
skip_first_screenshot:
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: If success to enter
|
||||||
|
|
||||||
Pages:
|
Pages:
|
||||||
in: is_in_clue
|
in: is_in_clue
|
||||||
out: FLEET_PREPARATION
|
out: FLEET_PREPARATION
|
||||||
@@ -188,9 +190,13 @@ class HospitalClue(HospitalUI):
|
|||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
if self.appear(FLEET_PREPARATION, offset=(20, 50)):
|
if self.appear(FLEET_PREPARATION, offset=(20, 50)):
|
||||||
break
|
return True
|
||||||
|
|
||||||
if self.is_in_clue(interval=2):
|
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}')
|
logger.info(f'is_in_clue -> {invest}')
|
||||||
self.device.click(invest)
|
self.device.click(invest)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -20,12 +20,9 @@ class Hospital(HospitalClue, HospitalCombat):
|
|||||||
# May raise ScriptEnd
|
# May raise ScriptEnd
|
||||||
self.emotion.check_reduce(battle=1)
|
self.emotion.check_reduce(battle=1)
|
||||||
|
|
||||||
invest = next(self.iter_invest(), None)
|
entered = self.invest_enter()
|
||||||
if invest is None:
|
if not entered:
|
||||||
logger.info('No more invest')
|
|
||||||
break
|
break
|
||||||
|
|
||||||
self.invest_enter(invest)
|
|
||||||
self.hospital_combat()
|
self.hospital_combat()
|
||||||
|
|
||||||
# Scheduler
|
# Scheduler
|
||||||
|
|||||||
Reference in New Issue
Block a user