mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-04 06:54:52 +08:00
Add: Claim invest reward
This commit is contained in:
@@ -168,7 +168,7 @@ class HospitalClue(HospitalUI):
|
|||||||
if self.appear(FLEET_PREPARATION, offset=(20, 50)):
|
if self.appear(FLEET_PREPARATION, offset=(20, 50)):
|
||||||
break
|
break
|
||||||
|
|
||||||
if self.is_in_clue(interval=3):
|
if self.is_in_clue(interval=2):
|
||||||
logger.info(f'is_in_clue -> {invest}')
|
logger.info(f'is_in_clue -> {invest}')
|
||||||
self.device.click(invest)
|
self.device.click(invest)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from module.event_hospital.clue import HospitalClue
|
from module.event_hospital.clue import HospitalClue
|
||||||
|
from module.event_hospital.assets import *
|
||||||
from module.event_hospital.combat import HospitalCombat
|
from module.event_hospital.combat import HospitalCombat
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
|
|
||||||
@@ -18,6 +19,38 @@ class Hospital(HospitalClue, HospitalCombat):
|
|||||||
self.invest_enter(invest)
|
self.invest_enter(invest)
|
||||||
self.hospital_combat()
|
self.hospital_combat()
|
||||||
|
|
||||||
|
self.claim_invest_reward()
|
||||||
|
logger.info('Loop invest end')
|
||||||
|
|
||||||
|
def invest_reward_appear(self) -> bool:
|
||||||
|
return self.image_color_count(INVEST_REWARD_RECEIVE, color=(33, 77, 189), threshold=221, count=100)
|
||||||
|
|
||||||
|
def claim_invest_reward(self):
|
||||||
|
if self.invest_reward_appear():
|
||||||
|
logger.info('Invest reward appear')
|
||||||
|
else:
|
||||||
|
logger.info('No invest reward')
|
||||||
|
return False
|
||||||
|
# Get reward
|
||||||
|
skip_first_screenshot = True
|
||||||
|
clicked = True
|
||||||
|
while 1:
|
||||||
|
if skip_first_screenshot:
|
||||||
|
skip_first_screenshot = False
|
||||||
|
else:
|
||||||
|
self.device.screenshot()
|
||||||
|
|
||||||
|
if clicked:
|
||||||
|
if self.is_in_clue() and not self.invest_reward_appear():
|
||||||
|
return True
|
||||||
|
if self.handle_get_items():
|
||||||
|
clicked = True
|
||||||
|
continue
|
||||||
|
if self.is_in_clue(interval=2):
|
||||||
|
if self.invest_reward_appear():
|
||||||
|
self.device.click(INVEST_REWARD_RECEIVE)
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
self = Hospital('alas')
|
self = Hospital('alas')
|
||||||
|
|||||||
Reference in New Issue
Block a user