基于Airtest陀螺世界辅助源代码
程序员文章站
2022-06-22 23:22:51
之前写过一个抖音的虽然不全但是抛砖引玉是可以了 今天这个陀螺世界的,看ad得金币点转盘、加速、任务都搞了一下,效果还可以分享给大家。最大的问题就是如何发代码里的图片呢~,~# -*- encoding=utf8 -*-__author__ = "Administrator"from airtest.core.api import *from airtest.core.android.android import Androidfrom poco.drivers.unity3d im...
之前写过一个抖音的虽然不全但是抛砖引玉是可以了 今天这个陀螺世界的,看ad得金币点转盘、加速、任务都搞了一下,效果还可以分享给大家。
代码下载地址:https://download.csdn.net/download/zy0412326/13104534
代码发是发不上来了 感兴趣的下载吧~
最大的问题就是如何发代码里的图片呢~,~
# -*- encoding=utf8 -*-
__author__ = "Administrator"
from airtest.core.api import *
from airtest.core.android.android import Android
from poco.drivers.unity3d import UnityPoco
import random
keyevent("home")
auto_setup(__file__)
touch(Template(r"tpl1605063294771.png", record_pos=(-0.194, 0.207), resolution=(720, 1600)))
sleep(random.randint(10,15)) #等一会防止app加载ad慢
if(exists(Template(r"tpl1605063456584.png", record_pos=(-0.003, 0.657), resolution=(720, 1600)))):
touch(Template(r"tpl1605063587214.png", record_pos=(0.001, 0.66), resolution=(720, 1600)))
if(exists(Template(r"tpl1605063675247.png", record_pos=(-0.003, -0.188), resolution=(720, 1600)))):
touch(Template(r"tpl1605063705424.png", record_pos=(-0.006, -0.185), resolution=(720, 1600)))
sleep(35)
touch(Template(r"tpl1605066420045.png", record_pos=(0.394, -0.938), resolution=(720, 1600)))
if(exists(Template(r"tpl1605064136020.png", record_pos=(-0.011, -0.814), resolution=(720, 1600)))):
touch(Template(r"tpl1605064136020.png", record_pos=(-0.011, -0.814), resolution=(720, 1600)))
sleep(2)
while True:
if(exists(Template(r"tpl1605067261659.png", record_pos=(0.378, -0.221), resolution=(720, 1600)))):
touch(Template(r"tpl1605067261659.png", record_pos=(0.378, -0.221), resolution=(720, 1600)))
if(exists(Template(r"tpl1605064193939.png", record_pos=(0.001, 0.483), resolution=(720, 1600)))):
touch(Template(r"tpl1605064193939.png", record_pos=(0.001, 0.483), resolution=(720, 1600)))
sleep(3)
if(exists(Template(r"tpl1605064982283.png", record_pos=(-0.003, -0.146), resolution=(720, 1600)))):
touch(Template(r"tpl1605064982283.png", record_pos=(-0.003, -0.146), resolution=(720, 1600)))
if(exists(Template(r"tpl1605063675247.png", record_pos=(-0.003, -0.188), resolution=(720, 1600)))):
touch(Template(r"tpl1605063705424.png", record_pos=(-0.006, -0.185), resolution=(720, 1600)))
sleep(35)
touch(Template(r"tpl1605066420045.png", record_pos=(0.394, -0.938), resolution=(720, 1600)))
touch(Template(r"tpl1605067916902.png", record_pos=(0.021, 0.246), resolution=(720, 1600)))
if(exists(Template(r"tpl1605067916902.png", record_pos=(0.021, 0.246), resolution=(720, 1600)))):
touch(Template(r"tpl1605066685939.png", record_pos=(0.237, 0.254), resolution=(720, 1600)))
sleep(2)
if(exists(Template(r"tpl1605067916902.png", record_pos=(0.021, 0.246), resolution=(720, 1600)))):
touch(Template(r"tpl1605068143397.png", record_pos=(0.335, -0.657), resolution=(720, 1600)))
break
if(exists(Template(r"tpl1605066757680.png", record_pos=(0.007, -0.011), resolution=(720, 1600)))):
touch(Template(r"tpl1605066757680.png", record_pos=(0.007, -0.011), resolution=(720, 1600)))
sleep(35)
touch(Template(r"tpl1605066420045.png", record_pos=(0.394, -0.938), resolution=(720, 1600)))
if(exists(Template(r"tpl1605068480924.png", record_pos=(0.365, -0.207), resolution=(720, 1600)))):
touch(Template(r"tpl1605068480924.png", record_pos=(0.365, -0.207), resolution=(720, 1600)))
if(exists(Template(r"tpl1605069232954.png", record_pos=(-0.249, 0.738), resolution=(720, 1600)))):
touch(Template(r"tpl1605069232954.png", record_pos=(-0.249, 0.738), resolution=(720, 1600)))
sleep(1)
touch(Template(r"tpl1605068669049.png", record_pos=(0.008, 0.011), resolution=(720, 1600)))
sleep(35)
touch(Template(r"tpl1605066420045.png", record_pos=(0.394, -0.938), resolution=(720, 1600)))
if(exists(Template(r"tpl1605068582091.png", record_pos=(0.417, -0.815), resolution=(720, 1600)))):
touch(Template(r"tpl1605068582091.png", record_pos=(0.417, -0.815), resolution=(720, 1600)))
sleep(1)
touch(Template(r"tpl1605068819010.png", record_pos=(0.013, -0.147), resolution=(720, 1600)))
sleep(35)
touch(Template(r"tpl1605066420045.png", record_pos=(0.394, -0.938), resolution=(720, 1600)))
sleep(1)
touch(Template(r"tpl1605068884592.png", record_pos=(0.007, 0.236), resolution=(720, 1600)))
代码下载地址:https://download.csdn.net/download/zy0412326/13104534
本文地址:https://blog.csdn.net/zy0412326/article/details/109616489