示例#1
0
# -*- encoding=utf8 -*-
""" 业原火-痴之阵自动脚本
"""
import time

from airtest.core.api import *
from common.const import GLOBAL_BUTTON_EXPLORE, GLOBAL_SIFT_SHARE, GLOBAL_SIFT_CONTINUE
from common.utils import random_pos, touch_pos, image

auto_setup(__file__)


# 探索-御魂 按钮
step1 = image("explore_yuhun.png", (0.723, 0.379), (1152, 679))

# 御魂-业原火封面
step2 = image("yuhun_yeyuanhuo.png", (0.605, 0.039), (1152, 679))

# 业原火-痴之阵
step3 = image("yeyuanhuo_chi_page.png", (0.783, 0.294), (1152, 679))

# 痴之阵-挑战 按钮
step4 = image("yeyuanhuo_chi_challenge.png", (1.059, 0.296), (1152, 679))


def enter_challenge_ui():
    """主界面跳转到痴之阵界面
    """
    touch(GLOBAL_BUTTON_EXPLORE)
    touch(step1)
    touch(step2)
示例#2
0
# -*- encoding=utf8 -*-
""" 御灵自动脚本
"""
import time

from airtest.core.api import *
from common.const import GLOBAL_SIFT_CONTINUE
from common.utils import random_pos, touch_pos, image

auto_setup(__file__)

# 挑战 按钮
step1 = image("yeyuanhuo_chi_challenge.png", (1.059, 0.296), (1152, 679))


def challenge():
    touch(wait(step1, timeout=60))
    pos = wait(GLOBAL_SIFT_CONTINUE, timeout=120)
    touch_pos(random_pos(pos, 50, 100, 0, 1), 2)
    time.sleep(4)
    touch_pos(random_pos(pos, 50, 100, 0, 1), 2)


def run(args):
    print("御灵 自动挂机脚本运行...")
    while (True):
        challenge()
示例#3
0
文件: tupo.py 项目: github-alvin/yys
# 突破名单窗口坐标偏移
COMMON_POS = (
    (-0.189, -0.089),
    (0.068, -0.089),
    (0.324, -0.089),
    (-0.189, 0.014),
    (0.068, 0.014),
    (0.324, 0.014),
    (-0.189, 0.118),
    (0.068, 0.118),
    (0.324, 0.118),
)

# 挑战按钮
challenge_button = image("tupo_fuck.png", (0, 0), (1152, 679))

# 挑战券不足
tip_noticket = image("tupo_no_ticket.png", (0.221, 0.083), (1152, 679))


def calc_pos():
    """ 根据当前分辨率计算出每个突破可选窗口坐标
    """
    resolution = get_current_resolution()
    ret = []
    for pos in COMMON_POS:
        ret.append(Predictor.get_predict_point(pos, resolution))
    return ret

示例#4
0
# -*- encoding=utf8 -*-
""" 御灵自动脚本
"""
import time

from airtest.core.api import *
from common.const import GLOBAL_SIFT_CONTINUE
from common.utils import random_pos, touch_pos, image

auto_setup(__file__)


# 挑战 按钮
step1 = image("temp.jpg", (1.059, 0.296), (1152, 679))


def challenge():
    touch(wait(step1, timeout=60)) 
    pos = wait(GLOBAL_SIFT_CONTINUE, timeout = 120)
    touch_pos(random_pos(pos, 50, 100, 0, 1), 2)
    time.sleep(4)
    touch_pos(random_pos(pos, 50, 100, 0, 1), 2)


def run(args):
    print("活动 自动挂机脚本运行...")
    while(True):
        challenge()