# incoding=gbk
"""
菜单(90, 170)
去赚钱(820, 1100)
1000金币悬赏任务(930, 450) (930, 640) 关闭(1000, 105)
广告(73 93 288 154)
签到(930, 1150)
点赞任务(930, 1280) 点赞(980, 1440)
关注作者(970, 1280) 取消关注(670, 590) (550, 1825)
看直播领金币(950, 1520)
"""
import os
import time
def back():
"""返回上一层"""
fun=os.system('adb shell input keyevent 4')
time.sleep(1)
def video():
"""向上滑动,刷视频"""
fun=os.system('adb shell input swipe 300 600 300 100') ##坐标根据需要自己修改
time.sleep(8)
def enter_the_task_page():
"""进入任务页面"""
fun=os.system('adb shell input tap 90 170')
time.sleep(1)
fun=os.system('adb shell input tap 820 1250')
time.sleep(1)
def slide_to_the_bottom():
"""滑动到页面底部"""
fun=os.system('adb shell input swipe 300 1400 300 100')
time.sleep(1)
def slide_to_the_top():
"""滑动到页面顶部"""
fun=os.system('adb shell input swipe 300 100 300 1400')
time.sleep(1)
def task_1():
"""签到任务"""
enter_the_task_page()
slide_to_the_bottom()
slide_to_the_bottom()
print("签到任务开始")
fun=os.system('adb shell input tap 930 1150')
time.sleep(1)
back()
def task_2():
"""1000金币悬赏任务"""
enter_the_task_page()
slide_to_the_bottom()
for i in range(10):
slide_to_the_bottom()
print("1000金币悬赏任务第", i+1, "次开始")
fun=os.system('adb shell input tap 930 640')
time.sleep(31)
fun=os.system('adb shell input tap 1000 105')
back()
def task_3():
"""点赞和关注任务"""
for i in range(2):
enter_the_task_page()
print("点赞和关注任务开始")
fun=os.system('adb shell input tap 930 1280')
time.sleep(1)
# 点赞并取消
for i in range(2):
fun=os.system('adb shell input tap 980 1440')
time.sleep(0.5)
# 关注并取消
for i in range(2):
fun=os.system('adb shell input tap 970 1280')
time.sleep(0.5)
fun=os.system('adb shell input tap 670 590')
time.sleep(0.5)
fun=os.system('adb shell input tap 550 1825')
time.sleep(0.5)
back()
def task_4():
"""看直播领金币任务"""
enter_the_task_page()
slide_to_the_bottom()
for i in range(10):
slide_to_the_bottom()
print("看直播领金币任务第", i+1, "次开始")
fun=os.system('adb shell input tap 950 1520')
time.sleep(16)
back()
def task_5():
"""刷视频任务"""
for i in range(1000):
print("刷视频任务第", i+1, "次开始")
video()
if __name__ == '__main__':
os.chdir("C:\\adb") ##切换到adb所在目录可以自己修改
print("已连接设备名称如下:")
os.system('adb version')
fun= os.system('adb devices')
#task_1()
#task_2()
#task_3()
#task_4()
task_5()
else:
print("任务全部完成")
#关闭adb服务:adb kill-server
fun=os.system('adb kill-server') ##运行结束杀掉adb进程
exit()