mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 00:28:20 +08:00
Refactor: Use numpy image cache instead of pillow image
This commit is contained in:
@@ -145,7 +145,7 @@ class MapOrderHandler(MapOperation, ActionPointHandler, MapEventHandler, ZoneMan
|
||||
"""
|
||||
if not self.map_cat_attack_timer.reached():
|
||||
return False
|
||||
if np.sum(color_similarity_2d(self.image_area(MAP_CAT_ATTACK), (255, 231, 123)) > 221) > 100:
|
||||
if np.sum(color_similarity_2d(self.image_crop(MAP_CAT_ATTACK), (255, 231, 123)) > 221) > 100:
|
||||
logger.info('Skip map cat attack')
|
||||
self.device.click(CLICK_SAFE_AREA)
|
||||
self.map_cat_attack_timer.reset()
|
||||
|
||||
@@ -22,7 +22,7 @@ class MissionHandler(GlobeOperation, ZoneManager):
|
||||
"""
|
||||
area = (341, 72, 1217, 648)
|
||||
# Points of the yellow `!`
|
||||
image = color_similarity_2d(self.image_area(area), color=(255, 207, 66))
|
||||
image = color_similarity_2d(self.image_crop(area), color=(255, 207, 66))
|
||||
points = np.array(np.where(image > 235)).T[:, ::-1]
|
||||
if not len(points):
|
||||
logger.warning('Unable to find mission on OS mission map')
|
||||
|
||||
Reference in New Issue
Block a user