mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 08:38:20 +08:00
Refactor: Use numpy image cache instead of pillow image
This commit is contained in:
@@ -72,7 +72,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
similarity, button = TEMPLATE_COMBAT_LOADING.match_result(self.image_area((0, 620, 1280, 720)))
|
||||
similarity, button = TEMPLATE_COMBAT_LOADING.match_result(self.image_crop((0, 620, 1280, 720)))
|
||||
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)}%')
|
||||
@@ -85,7 +85,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
return self.appear(PAUSE) and np.max(self.image_area(PAUSE_DOUBLE_CHECK)) < 153
|
||||
return self.appear(PAUSE) and np.max(self.image_crop(PAUSE_DOUBLE_CHECK)) < 153
|
||||
|
||||
def ensure_combat_oil_loaded(self):
|
||||
self.wait_until_stable(COMBAT_OIL_LOADING)
|
||||
|
||||
@@ -38,10 +38,10 @@ class CombatManual(ModuleBase):
|
||||
return True
|
||||
|
||||
def handle_combat_weapon_release(self):
|
||||
if self.appear_then_click(READY_AIR_RAID, interval=5):
|
||||
return True
|
||||
if self.appear_then_click(READY_TORPEDO, interval=5):
|
||||
return True
|
||||
# if self.appear_then_click(READY_AIR_RAID, interval=5):
|
||||
# return True
|
||||
# if self.appear_then_click(READY_TORPEDO, interval=5):
|
||||
# return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user