mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 16:19:03 +08:00
Fix: Ignore default raid PT value 70000
This commit is contained in:
parent
a937994aab
commit
2c3360f988
@ -1,6 +1,7 @@
|
||||
import numpy as np
|
||||
|
||||
import module.config.server as server
|
||||
from module.base.timer import Timer
|
||||
from module.campaign.campaign_event import CampaignEvent
|
||||
from module.campaign.run import OCR_OIL
|
||||
from module.combat.assets import *
|
||||
@ -237,9 +238,25 @@ class Raid(MapOperation, Combat, CampaignEvent):
|
||||
Pages:
|
||||
in: page_raid
|
||||
"""
|
||||
skip_first_screenshot = True
|
||||
timeout = Timer(1.5, count=5).start()
|
||||
ocr = pt_ocr(self.config.Campaign_Event)
|
||||
if ocr is not None:
|
||||
return ocr.ocr(self.device.image)
|
||||
# 70000 seems to be a default value, wait
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
pt = ocr.ocr(self.device.image)
|
||||
if timeout.reached():
|
||||
logger.warning('Wait PT timeout, assume it is')
|
||||
return pt
|
||||
if pt in [70000]:
|
||||
continue
|
||||
else:
|
||||
return pt
|
||||
else:
|
||||
logger.info(f'Raid {self.config.Campaign_Event} does not support PT ocr, skip')
|
||||
return 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user