0325更改
This commit is contained in:
parent
e8d912a4e7
commit
6146f19551
@ -122,9 +122,12 @@ def execute_all_tasks():
|
|||||||
print("执行任务: 师门任务")
|
print("执行任务: 师门任务")
|
||||||
shimen.shimenrenwu()
|
shimen.shimenrenwu()
|
||||||
|
|
||||||
|
if "宝图任务" in renwuliebiao:
|
||||||
|
print("执行任务: 宝图任务")
|
||||||
|
baotu.baoturenwu()
|
||||||
|
|
||||||
if "自动挖宝" in renwuliebiao:
|
if "自动挖宝" in renwuliebiao:
|
||||||
print("执行任务: 自动挖宝")
|
print("执行任务: 自动挖宝")
|
||||||
baotu.baoturenwu()
|
|
||||||
baotu.wabaotu()
|
baotu.wabaotu()
|
||||||
|
|
||||||
if "秘境降妖" in renwuliebiao:
|
if "秘境降妖" in renwuliebiao:
|
||||||
|
121
baotu.py
121
baotu.py
@ -54,59 +54,92 @@ def baoturenwu():
|
|||||||
|
|
||||||
|
|
||||||
def wabaotu():
|
def wabaotu():
|
||||||
while True:
|
|
||||||
if common.isfire():
|
|
||||||
print("战斗中,等待战斗完成")
|
|
||||||
sleep(60)
|
|
||||||
|
|
||||||
res_last = common.zhaotu("包裹.png")
|
if common.isfire():
|
||||||
if res_last is not None:
|
print("战斗中,等待战斗完成")
|
||||||
common.findandclick(res_last)
|
sleep(60)
|
||||||
sleep(1)
|
|
||||||
|
|
||||||
res_baotu = common.zhaotu("宝图任务.png")
|
if openbeibao():
|
||||||
if res_baotu is not None:
|
num =0
|
||||||
common.findandclick(res_baotu)
|
while True:
|
||||||
sleep(1)
|
res_baotu = common.zhaotu("宝图任务.png")
|
||||||
|
if res_baotu is not None:
|
||||||
|
common.findandclick(res_baotu)
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
res_shiyong_beibao = common.zhaotu("背包-使用.png")
|
res_shiyong_beibao = common.zhaotu("背包-使用.png")
|
||||||
if res_shiyong_beibao is not None:
|
if res_shiyong_beibao is not None:
|
||||||
common.findandclick(res_shiyong_beibao)
|
common.findandclick(res_shiyong_beibao)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
wabaoisover=False
|
wabaoisover = False
|
||||||
while True:
|
while True:
|
||||||
if common.isfire():
|
sleep(10)
|
||||||
print("战斗中,等待战斗完成")
|
if common.isfire():
|
||||||
sleep(60)
|
print("战斗中,等待战斗完成")
|
||||||
|
sleep(60)
|
||||||
|
res_shiyong = common.zhaotu("使用按钮.png")
|
||||||
|
if res_shiyong is not None:
|
||||||
|
common.findandclick(res_shiyong)
|
||||||
|
sleep(5)
|
||||||
|
else:
|
||||||
|
print("10秒后再次查找使用按钮")
|
||||||
|
sleep(10)
|
||||||
|
res_shiyong = common.zhaotu("使用按钮.png")
|
||||||
|
if res_shiyong is not None:
|
||||||
|
print("2次查询,找到使用按钮")
|
||||||
|
common.findandclick(res_shiyong)
|
||||||
|
sleep(5)
|
||||||
|
continue
|
||||||
|
print("没有找到使用按钮")
|
||||||
|
sleep(5)
|
||||||
|
if common.isfire():
|
||||||
|
print("战斗中,等待战斗完成")
|
||||||
|
sleep(60)
|
||||||
|
else:
|
||||||
|
print("没在战斗中")
|
||||||
|
|
||||||
res_shiyong = common.zhaotu("使用按钮.png")
|
openbeibao()
|
||||||
if res_shiyong is not None:
|
|
||||||
common.findandclick(res_shiyong)
|
|
||||||
sleep(5)
|
|
||||||
else:
|
|
||||||
print("8秒后再次查找使用按钮")
|
|
||||||
sleep(8)
|
|
||||||
res_shiyong = common.zhaotu("使用按钮.png")
|
|
||||||
if res_shiyong is not None:
|
|
||||||
print("2次查询,找到使用按钮")
|
|
||||||
common.findandclick(res_shiyong)
|
|
||||||
sleep(5)
|
|
||||||
continue
|
|
||||||
print("没有找到使用按钮")
|
|
||||||
sleep(5)
|
|
||||||
if common.isfire():
|
|
||||||
print("战斗中,等待战斗完成")
|
|
||||||
sleep(60)
|
|
||||||
else:
|
|
||||||
print("没在战斗中")
|
|
||||||
wabaoisover =True
|
|
||||||
return
|
|
||||||
|
|
||||||
sleep(8)
|
zhenglibb()
|
||||||
|
res_baotu = common.zhaotu("宝图任务.png")
|
||||||
|
if res_baotu is None:
|
||||||
|
wabaoisover = True
|
||||||
|
print("******背包中没有宝图,挖宝任务完成******")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
sleep(8)
|
||||||
|
else:
|
||||||
|
|
||||||
|
if num >1:
|
||||||
|
wabaoisover = True
|
||||||
|
print("******背包中没有宝图,挖宝任务完成******")
|
||||||
|
return
|
||||||
|
zhenglibb()
|
||||||
|
num+=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def openbeibao():
|
||||||
|
res_last = FindImages.find(
|
||||||
|
[
|
||||||
|
R.img("包裹.png"),
|
||||||
|
],
|
||||||
|
confidence=0.9,
|
||||||
|
)
|
||||||
|
if res_last is not None:
|
||||||
|
common.findandclick(res_last)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def zhenglibb():
|
||||||
|
res_bbzl = common.zhaotu("背包-整理.png")
|
||||||
|
if res_bbzl is not None:
|
||||||
|
common.findandclick(res_bbzl)
|
||||||
|
sleep(3)
|
||||||
|
|
||||||
def dianjirenwu():
|
def dianjirenwu():
|
||||||
res_btrw = common.zhaotu("日常-宝图任务.png")
|
res_btrw = common.zhaotu("日常-宝图任务.png")
|
||||||
|
@ -66,7 +66,7 @@ def xiahua():
|
|||||||
def zhaobtn(pngs):
|
def zhaobtn(pngs):
|
||||||
# 找各种任务按钮
|
# 找各种任务按钮
|
||||||
images = [R.img(png + ".png") for png in pngs]
|
images = [R.img(png + ".png") for png in pngs]
|
||||||
return FindImages.find(images, confidence=0.95)
|
return FindImages.find(images, confidence=0.9)
|
||||||
|
|
||||||
def sleep(num):
|
def sleep(num):
|
||||||
time.sleep(num)
|
time.sleep(num)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user