mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 02:48:23 +08:00
Merge branch 'master' into gems_farming
This commit is contained in:
@@ -5,6 +5,7 @@ from module.base.timer import Timer
|
||||
from module.base.utils import *
|
||||
from module.config.config import AzurLaneConfig
|
||||
from module.device.device import Device
|
||||
from module.logger import logger
|
||||
from module.statistics.azurstats import AzurStats
|
||||
|
||||
|
||||
@@ -94,8 +95,9 @@ 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):
|
||||
def wait_until_stable(self, button, timer=Timer(0.3, count=1), timeout=Timer(5, count=10), skip_first_screenshot=True):
|
||||
button._match_init = False
|
||||
timeout.start()
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
@@ -113,6 +115,10 @@ class ModuleBase:
|
||||
button.load_color(self.device.image)
|
||||
button._match_init = True
|
||||
|
||||
if timeout.reached():
|
||||
logger.warning(f'wait_until_stable({button}) timeout')
|
||||
break
|
||||
|
||||
def image_area(self, button):
|
||||
"""Extract the area from image.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user