# 创作者: anjdeng
# !/usr/bin/python
# -*- coding: UTF-8 -*-
# 雷电模拟器分别率选择1280*720
#游戏包裹满了一定要清
import pyautogui
import win32gui
import win32con
import time
import random
import pytesseract as pt
from PIL import Image
#周一晚上8点半以后不要做单机任务
hwnd = win32gui.FindWindow('LDPlayerMainFrame','雷电模拟器')
win32gui.ShowWindow(hwnd,win32con.SW_SHOWDEFAULT)
print("进入游戏画面...")
left, top, right, bottom = win32gui.GetWindowRect(hwnd)
listsize = [left,top,right,bottom]
#print("%d" % listsize[0])
time.sleep(3)
worklistsize = ['宝图','师','秘境','运镖','抓鬼']
#-------------------操作界面-------------------
def 选择任务(a):
return a
def gethamming(dif1=[], dif2=[]):
hamming_distance = 0
for i in range(len(dif1)):
if dif1[i] != dif2[i]:
hamming_distance += 1
if hamming_distance>7: #一般这个值需要自己调整,找一个合适的值
return 0
else:
return 1
def get_hash(im):
"""get image hash string"""
# antialias 抗锯齿
# convert 转换 L 代表灰度
im = im.resize((8, 8), Image.ANTIALIAS).convert('L')
# avg:像素的平均值
avg = sum(list(im.getdata())) / 64.0
# avg和每个像素比较,得到长度64的字符串
str = ''.join(map(lambda i: '0' if i < avg else '1', im.getdata()))
# str切割,每4个字符一组,转成16进制字符
return ''.join(map(lambda x: '%x' % int(str[x:x + 4], 2), range(0, 64, 4)))
def 监听判断人物是否正在战斗():
img1 = Image.open('战斗-取消_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 1107, listsize[1] + 605, 85, 85)) #战斗-取消
im.save('战斗-取消.png')
img2 = Image.open('战斗-取消.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
return 1
else:
return 0
def 点击意外窗口确定按钮():
pyautogui.click(listsize[0] + random.randint(650, 740), listsize[1] + random.randint(420, 450), duration=0.5)
print("点击意外窗口确定...")
time.sleep(1)
return
def 点击意外窗口取消按钮():
pyautogui.click(listsize[0] + random.randint(450, 540), listsize[1] + random.randint(420, 450), duration=0.5)
print("点击意外窗口取消...")
time.sleep(1)
return
def 点击关闭刮刮乐界面():
pyautogui.click(listsize[0] + random.randint(1060, 1075), listsize[1] + random.randint(70, 85), duration=0.5)
print("点击关闭刮刮乐界面...")
time.sleep(1)
return
def 点击关闭福利界面():
pyautogui.click(listsize[0] + random.randint(1010, 1020), listsize[1] + random.randint(95, 105), duration=0.5)
print("点击关闭福利界面...")
time.sleep(1)
def 点击关闭启动插件():
pyautogui.click(listsize[0] + random.randint(865, 885), listsize[1] + random.randint(250, 265), duration=0.5)
print("点击关闭插件...")
time.sleep(1)
def 点击中心区域():
pyautogui.click(listsize[0] + random.randint(600,620), listsize[1] + random.randint(400, 420), duration=0.5)
print("点击中心区域...")
time.sleep(1)
def 点击活动():
pyautogui.click(listsize[0]+random.randint(295,340),listsize[1]+random.randint(40,90),duration=0.5)
print("点击活动...")
time.sleep(1)
return
def 点击参加按钮(k,x,y,i): #i = 1
if i == k:
pyautogui.click(listsize[0] + random.randint(593, 664) + x, listsize[1] + random.randint(152, 185) + y, duration=0.5)
print("点击参加...")
time.sleep(1)
return
i = i + 1
if i % 2 == 0:
x = x + 383
return 点击参加按钮(k,x,y,i)
else:
y = y + 106
x = x - 383
return 点击参加按钮(k,x,y,i)
def 点击任务按钮():
pyautogui.click(listsize[0] + random.randint(967,1063), listsize[1] + random.randint(143,183), duration=0.5)
print("点击任务按钮...")
time.sleep(1)
return
def 点击队伍按钮():
pyautogui.click(listsize[0] + random.randint(1100, 1140), listsize[1] + random.randint(140, 180), duration=0.5)
print("点击队伍按钮...")
time.sleep(1)
return
def 点击退出或创建队伍按钮():
pyautogui.click(listsize[0] + random.randint(147, 300), listsize[1] + random.randint(630, 670), duration=0.5)
print("点击退出或创建队伍按钮...")
time.sleep(1)
return
def 点击关闭队伍窗口按钮():
pyautogui.click(listsize[0] + random.randint(1020, 1040), listsize[1] + random.randint(65, 82), duration=0.5)
print("点击关闭队伍窗口...")
time.sleep(1)
return
def 点击关闭活动窗口按钮():
pyautogui.click(listsize[0] + random.randint(1056, 1073), listsize[1] + random.randint(75, 90), duration=0.5)
time.sleep(1)
print("点击关闭活动窗口")
return
def 点击任务窗口当前按钮():
pyautogui.click(listsize[0] + random.randint(1054, 1084), listsize[1] + random.randint(148, 238), duration=0.5)
print("点击当前...")
time.sleep(1)
return
def 点击常规任务按钮():
pyautogui.click(listsize[0] + random.randint(186, 321), listsize[1] + random.randint(146, 186), duration=0.5)
print("点击常规任务...")
time.sleep(1)
return
def 点击常规任务列表中的宝图任务按钮(y):
pyautogui.click(listsize[0] + random.randint(186, 321), listsize[1] + random.randint(227+y, 267+y), duration=0.5)
print("点击常规任务列表中的宝图任务...")
time.sleep(1)
return
def 点击马上传送按钮():
pyautogui.click(listsize[0] + random.randint(830, 970), listsize[1] + random.randint(617, 647), duration=0.5)
print("点击马上传送...")
time.sleep(1)
return
def 点击关闭任务窗口按钮():
pyautogui.click(listsize[0] + random.randint(1020, 1040), listsize[1] + random.randint(67, 87), duration=0.5)
print("点击关闭任务窗口...")
time.sleep(1)
def 点击任务列表第一个任务按钮():
pyautogui.click(listsize[0] + random.randint(1140, 1180), listsize[1] + random.randint(225, 275), duration=0.5)
print("点击任务列表第一个任务...")
time.sleep(1)
return
def 点击商城购买按钮():
pyautogui.click(listsize[0] + random.randint(870, 1000), listsize[1] + random.randint(630, 650), duration=0.5)
print("点击商城购买...")
time.sleep(1)
return
def 点击商城列表的第一件物品按钮():
pyautogui.click(listsize[0] + random.randint(380, 672), listsize[1] + random.randint(197, 270), duration=0.5)
print("点击商城列表的第一件物品...")
time.sleep(1)
return
def 点击拉出任务列表按钮():
pyautogui.click(listsize[0] + random.randint(1152, 1174), listsize[1] + random.randint(153, 173), duration=0.5)
print("点击拉出任务列表...")
time.sleep(1)
return
def 点击普通商城购买按钮():
pyautogui.click(listsize[0] + random.randint(830, 980), listsize[1] + random.randint(560, 600), duration=0.5)
print("点击普通商城购买...")
time.sleep(1)
return
def 点击活动窗口日常任务按钮():
pyautogui.click(listsize[0] + random.randint(151, 274), listsize[1] + random.randint(133, 175), duration=0.5)
print("点击日常活动...")
time.sleep(1)
return
def 点击上交():
pyautogui.click(listsize[0] + random.randint(953, 1058), listsize[1] + random.randint(555, 600), duration=0.5)
print("点击上交...")
time.sleep(1)
return
def 识别任务(x,y,a,k):
time.sleep(1)
#保存截图
im = pyautogui.screenshot(region=(listsize[0]+391+x,listsize[1]+118+y,188,55))
im.save('做活动.png')
#识别文字
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("做活动.png")
img = img.convert('L')
arm = pt.image_to_string(img,lang="chi_sim")
print(arm)
global worklistsize
for i in arm:
if i in worklistsize[a]:
k = k + 1
print("检索任务成功...")
return k
k = k + 1
if k % 2 != 0:
x = x + 381
return 识别任务(x,y,a,k)
else:
x = x -381
y = y + 107
return 识别任务(x,y,a,k)
def 识别地图():
im = pyautogui.screenshot(region=(listsize[0] + 110, listsize[1] + 60, 100, 28))
im.save('识别地图.png')
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别地图.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
print(arm)
test1 = "瑶方寸山长寿宝象战两届魔王大雪唐官府塔长安狮女龙洛阳城建邺海宫女东阴花果傲来渔港普地"
for i in test1:
for i in arm:
return 0
return 1
def 识别队伍窗口():
time.sleep(1)
# 保存截图
im = pyautogui.screenshot(region=(listsize[0] + 388, listsize[1] + 122, 180, 50))
im.save('识别队伍窗口.png')
# 识别文字
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别队伍窗口.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1 = "目标尚未创建"
for i in test1:
if i in arm:
return 1
return 0
def 识别活动窗口():
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 151, listsize[1] + 133, 123, 42))
im.save('识别活动窗口.png')
# 识别文字
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别活动窗口.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1="日常活动"
for i in arm:
if i in test1:
return 1
return 0
def 判断是否尚未创建队伍():
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 318, listsize[1] + 126, 540, 32))
im.save('拉胯.png')
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("拉胯.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
time.sleep(1)
test1 = "尚未创建"
for i in test1:
if i in arm:
return 1
return 0
def 识别创建两字():
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 980, listsize[1] + 466, 89, 34))
im.save('识别创建两字.png')
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别创建两字.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
print(arm)
test1 = "创建"
for i in test1:
if i in arm:
return 1
return 0
def 识别任务窗口常规任务(y,v):
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 186, listsize[1] + 227 + y, 135, 40)) # y加81
im.save('识别任务窗口任务.png')
# 识别文字
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别任务窗口任务.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1 = "活动支主线派引导"
for i in test1:
if i in arm:
if v == 0:
点击常规任务按钮()
return 识别任务窗口常规任务(y,v)
else:
return -1
test2 = "宝图"
for j in test2:
if j in arm:
点击常规任务列表中的宝图任务按钮(y)
return 1
y = y + 81
v = v + 1
return 识别任务窗口常规任务(y,v)
def 识别商城窗口():
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 179, listsize[1] + 115, 486, 36))
im.save('识别商城窗口.png')
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别商城窗口.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1 = "购买出售物品"
for i in test1:
if i in arm:
return 1
return 0
def 识别任务列表():
点击队伍按钮()
点击队伍按钮()
i = 识别队伍窗口()
if i:
点击关闭队伍窗口按钮()
点击任务按钮()
return 1
return 0
def 识别普通商城窗口():
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 746, listsize[1] + 380, 98, 35))
im.save('识别普通商城窗口.png')
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别普通商城窗口.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1 = "购买"
for i in test1:
if i in arm:
return 1
return 0
def 识别请按任意键继续():
im = pyautogui.screenshot(region=(listsize[0] + 96, listsize[1] + 73, 270, 42))
im.save('识别请按任意键继续.png')
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别请按任意键继续.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1="请按任意键继续"
for i in test1:
if i in arm:
return 1
return 0
def 拖拽任务列表():
pyautogui.moveTo(listsize[0] + 1067,listsize[1] + 215,duration=0.5)
pyautogui.dragTo(listsize[0]+1100,listsize[1]+750,duration=0.5)
print("拖拽任务列表...")
return
def 识别使用():
img1 = Image.open('使用_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 968, listsize[1] + 549, 105, 45)) #使用
im.save('使用.png')
img2 = Image.open('使用.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
return 1
else:
return 0
def 识别战斗():
img1 = Image.open('战斗-取消_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 1107, listsize[1] + 605, 85, 85)) # 战斗-取消
im.save('战斗-取消.png')
img2 = Image.open('战斗-取消.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
return 1
else:
return 0
def 识别上交():
img1 = Image.open('上交_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 935, listsize[1] + 555, 105, 45)) #上交
im.save('上交.png')
img2 = Image.open('上交.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
return 1
else:
return 0
#-------------------宝图任务-----------------------------
def 点击听听无妨():
pyautogui.click(listsize[0] + random.randint(890, 1125), listsize[1] + random.randint(455,485), duration=0.5)
print("点击听听无妨...")
time.sleep(1)
return
def 监听宝图():
j, k = 1, 0
while j == 1:
i = 0
k = k + 1
print("监听中... %d 次" % k)
j = 监听判断人物是否正在战斗(i)
return j
#-------------------秘境任务-----------------------------
def 点击进入():
pyautogui.click(listsize[0] + random.randint(280, 420), listsize[1] + random.randint(610, 630), duration=0.5)
print("点击进入...")
time.sleep(1)
return
def 点击第一关():
pyautogui.click(listsize[0] + random.randint(295, 335), listsize[1] + random.randint(345, 375), duration=0.5)
print("点击第一关...")
time.sleep(1)
return
def 点击挑战():
pyautogui.click(listsize[0] + random.randint(570, 670), listsize[1] + random.randint(510, 540), duration=0.5)
print("点击挑战...")
time.sleep(1)
return
def 正在秘境任务():
i,s= 1,0
点击关卡()
while 1:
time.sleep(30)
i = 识别战斗()
if i == 1 and s != 0:
s = 0
if i == 0:
点击师门列表任务按钮(252)
s = s + 1
if s == 3:
break
def 点击关卡():
pyautogui.click(listsize[0] + random.randint(990, 1150), listsize[1] + random.randint(260, 310), duration=0.5)
print("点击关卡...")
time.sleep(1)
return
def 点击离开():
pyautogui.click(listsize[0] + random.randint(1100, 1150), listsize[1] + random.randint(350, 370), duration=0.5)
print("点击离开...")
time.sleep(1)
return
#-------------------抓鬼任务-----------------------------
def 点击自动匹配():
time.sleep(1)
pyautogui.click(listsize[0] + random.randint(638, 800), listsize[1] + random.randint(626, 661) , duration=0.5)
return
def 识别抓鬼匹配界面():
im = pyautogui.screenshot(region=(listsize[0] + 185, listsize[1] + 125, 124, 42))
im.save('识别是否匹配成功.png')
# 识别文字
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别是否匹配成功.png")
img = img.convert('L')
arm = pt.image_to_string(img, lang="chi_sim")
test1 = "抓鬼"
for i in test1:
if i in arm:
time.sleep(1)
return 0
return 1
def 识别是否匹配成功(h):
i = 识别抓鬼匹配界面()
if i == 1:
return i
h = h + 1
print("匹配中... %d次" % h)
if h == 11:
return 2
time.sleep(1)
return 识别是否匹配成功(h)
def 监听抓鬼(a):
j,k,g=1,0,0
while j == 1:
i = 0
k = k + 1
if g < 2:
if 识别活动窗口():
点击关闭活动窗口按钮()
g = g + 1
if 识别队伍窗口():
点击关闭队伍窗口按钮()
g = g + 1
print("监听中... %d 次" % k)
j = 监听判断人物是否正在战斗(i)
return j
def 分析原因():
print("自动分析原因...")
#在执行任务,但是被系统错误检测了
点击队伍按钮()
i = 判断是否尚未创建队伍()
if i == 1:
print("尚未创建队伍...")
return 0
elif i == 0:
i = 识别创建两字()
if i == 1:
print("队伍为空...")
return 1
elif i == 0:
print("队伍不为空...")
return 2
def 解决问题(reason):
print("正在解决...")
if reason == 0:
点击关闭队伍窗口按钮()
点击任务按钮()
return 1
elif reason == 1:
点击任务按钮()
return 1
elif reason == 2:
点击队伍按钮()
点击退出或创建队伍按钮()
点击关闭队伍窗口按钮()
点击任务按钮()
#-------------------师门任务-----------------------------
def 点击师门选择按钮(x,l):
if x == 0:
time.sleep(1)
pyautogui.click(listsize[0] + random.randint(390+x, 445+x),listsize[1] + random.randint(429,450),duration=0.5) # x加111
print("点击选择...")
l = l + 1
i = 识别师门任务选择窗口()
if i:
x = x + 111
if l == 6:
return 0
return 点击师门选择按钮(x,l)
else:
return 1
def 识别师门任务选择窗口():
time.sleep(1)
im = pyautogui.screenshot(region=(listsize[0] + 511, listsize[1] + 529, 195, 32))
im.save('识别师门任务选择窗口.png')
# 识别文字
path = r"E:\tesseract-ocr\tesseract.exe"
pt.pytesseract.tesseract_cmd = path
img = Image.open("识别师门任务选择窗口.png")
arm = pt.image_to_string(img, lang="chi_sim")
test1 = "选择"
for i in test1:
if i in arm:
return 1
return 0
def 识别师门任务列表(y,l):
img1 = Image.open('师门任务_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 880, listsize[1] + 130 + y, 20, 45)) # 加63 第一排 师门任务
im.save('师门任务.png')
img2 = Image.open('师门任务.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
jun = [y,l]
return jun
else:
if l == 6:
l = -1
jun = [y,l]
return jun
y = y + 63
l = l + 1
return 识别师门任务列表(y,l)
def 识别师门任务窗口():
img1 = Image.open('门派关系_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 956, listsize[1] + 507, 80, 80)) #门派关系
im.save('门派关系-.png')
img2 = Image.open('门派关系-.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
return 1
else:
return 0
def 识别任务列表师门任务():
img1 = Image.open('师门-_副本.png')
img1 = get_hash(img1)
im = pyautogui.screenshot(region=(listsize[0] + 964, listsize[1] + 203, 60, 30))#师门-
im.save('师门-.png')
img2 = Image.open('师门-.png')
img2 = get_hash(img2)
i = gethamming(img1, img2)
if i:
return 1
else:
return 0
def 正在跑师门任务():
end,i,sum,s= 1,0,0,0
while end == 1:
if sum == 0:
点击任务列表第一个任务按钮()
time.sleep(1)
y,l=0,0
jun = 识别师门任务列表(y,l)
if jun[1] != -1:
点击师门列表任务按钮(jun[0])
if l <= 3 and l != -1:
s = s + 1
elif l>3:
s = 0
time.sleep(1)
jun = 识别师门任务列表(jun[0],jun[1])
if jun[1] != -1:
s = 0
点击师门列表任务按钮(jun[0])
else:
if s == 3:
点击师门列表任务按钮(315)
s = 0
elif s == 4:
点击师门列表任务按钮(-32)
s = 0
l = 识别商城窗口()
while l:
点击商城列表的第一件物品按钮()
点击商城购买按钮()
l = 识别商城窗口()
l = 识别普通商城窗口()
if l:
点击普通商城购买按钮()
l = 识别使用()
if l:
点击师门任务意外弹出窗口()
点击中心区域()
l = 识别上交()
if l:
点击上交()
time.sleep(2)
点击中心区域()
time.sleep(1)
l = 识别战斗()
while l:
time.sleep(10)
l = 识别战斗()
i = i + 1
time.sleep(2)
l = 识别任务列表师门任务()
print("......")
if l:
end = 1
sum = 0
print("第 %d 次循环" % i)
else:
sum = sum + 1
if sum == 4:
end = 0
elif sum == 2 or sum == 3:
time.sleep(5)
点击中心区域()
end = 1
else:
time.sleep(5)
end = 1
def 点击师门列表任务按钮(y):
pyautogui.click(listsize[0] + random.randint(890, 930), listsize[1] + random.randint(130 + y, 175 + y), duration=0.5)
print("点击师门任务...")
time.sleep(1)
return
def 点击师门任务意外弹出窗口():
pyautogui.click(listsize[0] + random.randint(975, 995), listsize[1] + random.randint(565, 585),duration=0.5)
print("点击意外窗口...")
time.sleep(1)
return
def 点击关闭做完师门任务弹出的窗口():
pyautogui.click(listsize[0] + random.randint(1033, 1047), listsize[1] + random.randint(164, 178), duration=0.5)
print("点击关闭师门任务窗口...")
time.sleep(1)
return
def 点击宝箱():
pyautogui.click(listsize[0] + random.randint(390, 430), listsize[1] + random.randint(520, 560), duration=0.5)
print("点击宝箱...")
time.sleep(1)
return
#-------------------控制台-------------------------------
a = 3
while a >= 0:
a = 选择任务(a)
if a == 0: #宝图
i, j = 1, 0
while i:
点击活动()
识别活动窗口()
点击活动窗口日常任务按钮()
time.sleep(1)
j = j + 1
print("任务寻找...")
x, y, k, i = 0, 0, 0, 1
k = 识别任务(x, y, a, k)
点击参加按钮(k, x, y, i)
i = 识别活动窗口()
if j == 4:
a = -1
break
if a == -1:
break
print("自动寻路中...")
time.sleep(20)
y,v=0,0
点击听听无妨()
点击任务按钮()
点击任务按钮() #点掉宝图老板的答话
点击任务窗口当前按钮()
i = 识别任务窗口常规任务(y,v)
if i == -1:
print("程序出错...")
else:
点击马上传送按钮()
点击关闭任务窗口按钮()
print("正在监听...")
监听宝图()
print("退出监听...")
print("任务完成...")
a = a + 1
elif a == 1: #师门
i, j = 1, 0
while i:
点击活动()
识别活动窗口()
点击活动窗口日常任务按钮()
time.sleep(1)
j = j + 1
print("任务寻找...")
x, y, k, i = 0, 0, 0, 1
k = 识别任务(x, y, a, k)
点击参加按钮(k, x, y, i)
i = 识别活动窗口()
if j == 4:
a = -1
break
if a == -1:
break
time.sleep(1)
x,l = 0,0
x = 点击师门选择按钮(x,l)
if x == 0:
print("识别失败...")
print("程序终止...")
a = -1
break
else:
print("开始任务...")
点击中心区域()
b = 识别任务列表()
if b == 0:
点击拉出任务列表按钮()
拖拽任务列表()
正在跑师门任务()
print("结束任务...")
while 识别使用():
点击师门任务意外弹出窗口()
if 识别师门任务窗口():
点击宝箱()
点击关闭做完师门任务弹出的窗口()
time.sleep(1)
点击中心区域()
a = -1;
elif a == 2: #秘境
i,j= 1,0
while i:
点击活动()
识别活动窗口()
点击活动窗口日常任务按钮()
time.sleep(1)
j = j + 1
print("任务寻找...")
x, y, k, i = 0, 0, 0, 1
k = 识别任务(x, y, a, k)
点击参加按钮(k, x, y, i)
i = 识别活动窗口()
if j == 4:
a = -1
break
if a == -1:
break
time.sleep(1)
y,l=0,0
jun = 识别师门任务列表(y,l)
if jun[1] != -1:
点击师门列表任务按钮(jun[0])
time.sleep(1)
点击进入()
time.sleep(1)
点击意外窗口确定按钮()
time.sleep(1)
点击第一关()
time.sleep(1)
点击挑战()
print('进入秘境...')
正在秘境任务()
while 识别使用():
点击师门任务意外弹出窗口()
time.sleep(1)
点击离开()
time.sleep(5)
elif a == 3 : # 运镖
i, j = 1, 0
while i:
点击活动()
识别活动窗口()
点击活动窗口日常任务按钮()
time.sleep(1)
j = j + 1
print("任务寻找...")
x, y, k, i = 0, 0, 0, 1
k = 识别任务(x, y, a, k)
点击参加按钮(k, x, y, i)
i = 识别活动窗口()
if j == 4:
a = -1
break
if a == -1:
break
time.sleep(15)
s = 0
while 1:
s = s + 1
点击师门列表任务按钮(252)
time.sleep(1)
点击意外窗口确定按钮()
time.sleep(1)
while 识别地图():
time.sleep(10)
if s == 3:
break
elif a == 5: #抓鬼任务
anjdeng = 0
while anjdeng >= 0:
time.sleep(1)
点击活动()
i = 识别活动窗口()
if i == 0:
anjdeng = -1
break;
time.sleep(1)
print("任务寻找...")
x, y, k, i = 0, 0, 0, 1
k = 识别任务(x, y, a, k)
点击参加按钮(k, x, y, i)
print("开始任务...")
点击自动匹配()
i,h= 1,0
while i > 0:
print("自动匹配中...")
i = 识别是否匹配成功(h)
if i == 1:
print("自动识别:匹配成功...")
i = 0
elif i == 2:
print("匹配时间过长...")
time.sleep(1)
点击自动匹配()
print("取消自动匹配...")
time.sleep(1)
点击自动匹配()
print("正在抓鬼...")
print("监听中...")
j = 监听抓鬼(a)
print("退出监听...")
reason = 分析原因()
print("分析完成...")
解决问题(reason)
print("错误,程序停止...")
#点击队伍
06-12
701
02-27
691
02-16
3万+
11-23