陰陽師 自動刷御魂以及覺醒副本
阿新 • • 發佈:2020-10-21
airtest環境搭建,將下面的圖片和程式碼檔案放在同一個目錄下,
確保手機已開啟usb除錯,
將遊戲調整到副本頁面,
執行py檔案,即可!
pic
#
#
#
#
code
from airtest.core.api import * import time import datetime import logging logging.basicConfig(level=None) init_device("Android") def gen(times,nstatus): duration=30 for i in range(0,times): print(i+1) print(duration,"*"*20) status=nstatus while(1): if(exists(Template(r"tpl1602912634311.png", record_pos=(0.331, 0.173), resolution=(1560, 720)))): touch(Template(r"tpl1602864978373.png", record_pos=(1.34, -0.201), resolution=(720, 1560))) status=False t1=time.time() time.sleep(duration) else: if(exists(Template(r"tpl1602912796157.png", record_pos=(0.005, 0.092), resolution=(1560, 720)))): t2=time.time() tmp=(datetime.datetime.fromtimestamp(t2)-datetime.datetime.fromtimestamp(t1)).seconds-6if(duration==30): duration=tmp else: if(tmp>duration): pass else: duration=tmp status=True touch(Template(r"tpl1602912825170.png", record_pos=(0.001, 0.09), resolution=(1560, 720))) if(not status): #開始 time.sleep(3) else: #結束 time.sleep(3) break nstatus=False
#傳入的數字代表刷副本的次數 gen(2,nstatus) time.sleep(5)