1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-11 23:18:22 +08:00

Pref: Faster is_combat_loading()

This commit is contained in:
LmeSzinc
2024-06-05 02:24:47 +08:00
parent eada57f97d
commit a668840ee9
3 changed files with 56 additions and 10 deletions

View File

@@ -66,7 +66,8 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
Returns:
bool:
"""
similarity, button = TEMPLATE_COMBAT_LOADING.match_result(self.image_crop((0, 620, 1280, 720), copy=False))
image = self.image_crop((0, 620, 1280, 720), copy=False)
similarity, button = TEMPLATE_COMBAT_LOADING.match_luma_result(image)
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)}%')