mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 00:28:20 +08:00
Fix: Oil limit not working in raid
- Add wait_until_stable - Add ensure_combat_oil_loaded - Add grid_location_to_screen_point
This commit is contained in:
@@ -79,6 +79,25 @@ class ModuleBase:
|
||||
if not self.appear(button, offset=offset):
|
||||
break
|
||||
|
||||
def wait_until_stable(self, button, timer=Timer(0.3, count=1), skip_first_screenshot=True):
|
||||
button._match_init = False
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
if button._match_init:
|
||||
if button.match(self.device.image, offset=(0, 0)):
|
||||
if timer.reached():
|
||||
break
|
||||
else:
|
||||
button.load_color(self.device.image)
|
||||
timer.reset()
|
||||
else:
|
||||
button.load_color(self.device.image)
|
||||
button._match_init = True
|
||||
|
||||
def image_area(self, button):
|
||||
"""Extract the area from image.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user