fix(task): 修复启动游戏后无法自动关闭弹窗
This commit is contained in:
parent
ac455348b4
commit
076ae6d7d8
|
@ -1,12 +1,14 @@
|
|||
"""启动游戏,领取登录奖励,直到首页为止"""
|
||||
import logging
|
||||
from time import sleep
|
||||
|
||||
from kotonebot import task, device, image, cropped
|
||||
from . import R
|
||||
from .common import Priority
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@task('启动游戏')
|
||||
@task('启动游戏', priority=Priority.START_GAME)
|
||||
def start_game():
|
||||
"""
|
||||
启动游戏,直到游戏进入首页为止。
|
||||
|
@ -18,8 +20,16 @@ def start_game():
|
|||
image.wait_for(R.Daily.ButonLinkData, timeout=30)
|
||||
sleep(2)
|
||||
device.click_center()
|
||||
while not image.wait_for(R.Daily.ButtonHomeCurrent, timeout=3):
|
||||
device.click_center()
|
||||
while True:
|
||||
with device.pinned():
|
||||
if image.find(R.Daily.ButtonHomeCurrent):
|
||||
break
|
||||
# [screenshots/startup/announcement1.png]
|
||||
elif image.find(R.Common.ButtonIconClose):
|
||||
device.click()
|
||||
else:
|
||||
device.click_center()
|
||||
sleep(2)
|
||||
|
||||
if __name__ == '__main__':
|
||||
from kotonebot.backend.context import init_context
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 699 KiB |
Loading…
Reference in New Issue