mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 08:38:20 +08:00
Pref: Reuse image array to improve memory performance
This commit is contained in:
@@ -66,7 +66,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
similarity, button = TEMPLATE_COMBAT_LOADING.match_result(self.image_crop((0, 620, 1280, 720)))
|
||||
similarity, button = TEMPLATE_COMBAT_LOADING.match_result(self.image_crop((0, 620, 1280, 720), copy=False))
|
||||
if similarity > 0.85:
|
||||
loading = (button.area[0] + 38 - LOADING_BAR.area[0]) / (LOADING_BAR.area[2] - LOADING_BAR.area[0])
|
||||
logger.attr('Loading', f'{int(loading * 100)}%')
|
||||
@@ -82,7 +82,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
self.device.stuck_record_add(PAUSE)
|
||||
color = get_color(self.device.image, PAUSE.area)
|
||||
if color_similar(color, PAUSE.color) or color_similar(color, (238, 244, 248)):
|
||||
if np.max(self.image_crop(PAUSE_DOUBLE_CHECK)) < 153:
|
||||
if np.max(self.image_crop(PAUSE_DOUBLE_CHECK, copy=False)) < 153:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user