mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Loop tries on 2 adjacent fleet mechanism (#1475)
This commit is contained in:
parent
428cf48b25
commit
5239c632f2
@ -456,8 +456,18 @@ class OSMap(OSFleet, Map, GlobeCamera):
|
|||||||
break
|
break
|
||||||
|
|
||||||
def clear_question(self, drop):
|
def clear_question(self, drop):
|
||||||
|
"""
|
||||||
|
Clear nearly (and 3 grids from above) question marks on radar.
|
||||||
|
Try 3 times at max to avoid loop tries on 2 adjacent fleet mechanism.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
drop:
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: If cleared
|
||||||
|
"""
|
||||||
logger.hr('Clear question', level=2)
|
logger.hr('Clear question', level=2)
|
||||||
while 1:
|
for _ in range(3):
|
||||||
grid = self.radar.predict_question(self.device.image)
|
grid = self.radar.predict_question(self.device.image)
|
||||||
if grid is None:
|
if grid is None:
|
||||||
logger.info('No question mark above current fleet on this radar')
|
logger.info('No question mark above current fleet on this radar')
|
||||||
@ -487,6 +497,10 @@ class OSMap(OSFleet, Map, GlobeCamera):
|
|||||||
logger.warning(f'Arrive question with unexpected result: {result}, expected: {grid.str}')
|
logger.warning(f'Arrive question with unexpected result: {result}, expected: {grid.str}')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
logger.warning('Failed to goto question mark after 5 trail, '
|
||||||
|
'this might be 2 adjacent fleet mechanism, stopped')
|
||||||
|
return False
|
||||||
|
|
||||||
def run_auto_search(self, question=True, rescan=None):
|
def run_auto_search(self, question=True, rescan=None):
|
||||||
"""
|
"""
|
||||||
Clear current zone by running auto search.
|
Clear current zone by running auto search.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user