File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 33from module .campaign .campaign_event import CampaignEvent
44from module .coalition .assets import *
55from module .coalition .combat import CoalitionCombat
6- from module .exception import ScriptError , ScriptEnd
6+ from module .exception import ScriptEnd , ScriptError
77from module .logger import logger
88from module .ocr .ocr import Digit
9- from module .ui .page import page_campaign_menu
109
1110
1211class AcademyPtOcr (Digit ):
@@ -61,7 +60,15 @@ def get_event_pt(self):
6160 logger .error (f'ocr object is not defined in event { event } ' )
6261 raise ScriptError
6362
64- pt = ocr .ocr (self .device .image )
63+ pt = 0
64+ for _ in self .loop (timeout = 1.5 ):
65+ pt = ocr .ocr (self .device .image )
66+ # 999999 seems to be a default value, wait
67+ if pt not in [999999 ]:
68+ break
69+ else :
70+ logger .warning ('Wait PT timeout, assume it is' )
71+
6572 return pt
6673
6774 def triggered_stop_condition (self , oil_check = False , pt_check = False ):
You can’t perform that action at this time.
0 commit comments