airtest
利用airtest编写了一个简单自动刷取喵币的任务,无法放图,因为CSDN说我包含广告,我懵了。
文章底下有源码链接,下载可用
# -*- encoding=utf8 -*-
__author__ = "Administrator"from airtest.core.api import *auto_setup(__file__)
def cat_coin():touch(Template(r"tpl1572768128549.png", record_pos=(0.352, -0.031), resolution=(1080, 2160)))sleep(5)touch(Template(r"tpl1572768228735.png", record_pos=(0.244, 0.545), resolution=(1080, 2160)))sleep(5)while exists(Template(r"tpl1572768311939.png", record_pos=(-0.001, 0.56), resolution=(1080, 2160))):touch(Template(r"tpl1572768321597.png", record_pos=(0.003, 0.559), resolution=(1080, 2160)))sleep(2)touch(Template(r"tpl1572768420009.png", record_pos=(0.018, 0.26), resolution=(1080, 2160)))sleep(2)touch(Template(r"tpl1572768404865.png", record_pos=(0.349, 0.556), resolution=(1080, 2160)))sleep(2)# touch(Template(r"tpl1572768463099.png", record_pos=(0.324, -0.462), resolution=(1080, 2160)))# sleep(2)while exists(Template(r"tpl1572768496550.png", record_pos=(0.322, -0.126), resolution=(1080, 2160))):touch(Template(r"tpl1572768496550.png", record_pos=(0.322, -0.126), resolution=(1080, 2160)))sleep(20)if exists(Template(r"tpl1572768906414.png", record_pos=(0.372, 0.407), resolution=(1080, 2160))):touch(Template(r"tpl1572768520022.png", record_pos=(-0.41, -0.886), resolution=(1080, 2160)))sleep(5)else:sleep(5)touch(Template(r"tpl1572768520022.png", record_pos=(-0.41, -0.886), resolution=(1080, 2160)))
cat_coin()
源码:链接: 提取码:qj20