mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-23 13:18:01 +08:00
Upd: GemsFarming change common cv
This commit is contained in:
@@ -374,26 +374,38 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange, GemsEquipmentHandler):
|
|||||||
if self.config.GemsFarming_CommonCV == 'any':
|
if self.config.GemsFarming_CommonCV == 'any':
|
||||||
common_cv['Hermes'] = TEMPLATE_HERMES
|
common_cv['Hermes'] = TEMPLATE_HERMES
|
||||||
|
|
||||||
for name, template in common_cv.items():
|
logger.info(f'Search for Common CV.')
|
||||||
logger.info(f'Search for CV {name}.')
|
self.dock_sort_method_dsc_set()
|
||||||
self.dock_sort_method_dsc_set()
|
|
||||||
|
|
||||||
|
find_bogue = True
|
||||||
|
common_cv_candidates = {}
|
||||||
|
for name, template in common_cv.items():
|
||||||
candidates = [ship for ship in scanner.scan(self.device.image, output=False)
|
candidates = [ship for ship in scanner.scan(self.device.image, output=False)
|
||||||
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
|
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
|
||||||
|
|
||||||
if candidates:
|
if find_bogue:
|
||||||
return candidates
|
find_bogue = False
|
||||||
|
if candidates:
|
||||||
|
logger.info(f'Find Common CV {name}.')
|
||||||
|
return candidates
|
||||||
|
|
||||||
logger.info(f'No suitable CV {name} was found, try reversed order.')
|
common_cv_candidates[name] = candidates
|
||||||
self.dock_sort_method_dsc_set(False)
|
|
||||||
|
|
||||||
|
logger.info(f'No suitable CV was found, try reversed order.')
|
||||||
|
self.dock_sort_method_dsc_set(False)
|
||||||
|
|
||||||
|
for name, template in common_cv.items():
|
||||||
candidates = [ship for ship in scanner.scan(self.device.image)
|
candidates = [ship for ship in scanner.scan(self.device.image)
|
||||||
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
|
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
|
||||||
|
|
||||||
if candidates:
|
if candidates:
|
||||||
|
logger.info(f'Find Common CV {name}.')
|
||||||
return candidates
|
return candidates
|
||||||
|
elif common_cv_candidates[name]:
|
||||||
|
logger.info(f'Find Common CV {name}.')
|
||||||
|
self.dock_sort_method_dsc_set()
|
||||||
|
return common_cv_candidates[name]
|
||||||
|
|
||||||
self.dock_sort_method_dsc_set(False)
|
|
||||||
return scanner.scan(self.device.image, output=False)
|
return scanner.scan(self.device.image, output=False)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user