def yuhun(t): #开始时间: print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), '开始:') yuhun_tubiao() yuhun_dashe_tubiao() t = int(t) while t > 0: tiaozhan() #************这里要做一下验证,有时候会出现bug导致无法进入御魂。********************** s = 10 j = 0 #s= checking(opencvjietu.jieshu(),yuhun_jieshu_pic_s) while s >= 5: i = 10 jieshu = opencvjietu.jieshu() jieshu = opencv_compare.PIL_opencv(jieshu) # 截取图片 s = similarity.classify_aHash(yuhun_jieshu_pic_s, jieshu) #print(s) yysclient = opencvjietu.yys_client() yysclient = opencv_compare.PIL_opencv(yysclient) i = similarity.classify_aHash(yuhun_shibai_pic, yysclient) #print('i=',i) if i < 5: j = j + 1 # 统计失败次数 t = t + 1 print('这是第', j, '次失败!') break #设置一个队列,把s存入队列中当队列中的数值都一样时证明停留在了同一画面 time.sleep(2) #******御魂结束之后的等待时间有点长应该在中间加一个点击,另外一个问题就是如果结束是正好有好友来了协作就GG结束不了************** a = feature_matching(yuhun_jieshu_pic) mousedianji.mouse_click(a[0], a[1], 0) t = t - 1 time.sleep(random.randint(0, 1)) #打印基本信息 print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())), '阴阳师大人,小助手已经帮您刷了', 500 - t, '次御魂了!总共失败', j, '次,继续加油哦!')
def yuhun(t): yuhun_tubiao() yuhun_dashe_tubiao() t = int(t) while t > 0: tiaozhan() s = 10 j = 0 #s= checking(opencvjietu.jieshu(),yuhun_jieshu_pic_s) while s >= 5: i = 10 jieshu = opencvjietu.jieshu() jieshu = opencv_compare.PIL_opencv(jieshu) # 截取图片 s = similarity.classify_aHash(yuling_jieshu_pic_s, jieshu) #print(s) defeated = opencvjietu.defeated() defeated = opencv_compare.PIL_opencv(defeated) i = similarity.classify_aHash(img_defeated, defeated) #print('i=',i) if i < 10: tiaozhan() j = j + 1 #统计失败次数 t = t + 1 print('这是第', j, '次失败!') break #设置一个队列,把s存入队列中当队列中的数值都一样时证明停留在了同一画面 time.sleep(2) if s < 5: a = feature_matching(yuling_jieshu_pic) mousedianji.mouse_click(a[0], a[1], 0) t = t - 1 time.sleep(random.randint(0, 3)) print('阴阳师大人,小助手已经帮您刷了', 1000 - t, '次暗孔雀御灵了!总共失败', j, '次,继续加油哦!') #刷100,200,350,500,800次时停下来半个小时 while t == 800 or t == 500 or t == 300 or t == 200 or t == 100: time.sleep(1800)
def yuhunjiacheng(): if a == 1: yuhunjiacheng_pic = cv2.imread('pic/yuhunjiacheng.png', 0) yysclient = opencvjietu.yys_client() #yysclient.show() yysclient = opencv_compare.PIL_opencv(yysclient) jiacheng_xy = opencv_compare.template_matching(yysclient,jiacheng_pic) mousedianji.mouse_click(jiacheng_xy[0], jiacheng_xy[1],3) yysclient = opencvjietu.yys_client() #yysclient.show() yysclient = opencv_compare.PIL_opencv(yysclient) jiacheng_xy = opencv_compare.template_matching(yysclient,yuhunjiacheng_pic) mousedianji.mouse_click(jiacheng_xy[0] + 250, jiacheng_xy[1],3) mousedianji.mouse_click(jiacheng_xy[0] + 400, jiacheng_xy[1], 3) else: print('没有选择开启加成')
def tiaozhan(): yuhuntiaozhan_xy = feature_matching(yuhuntiaozhan_pic) mousedianji.mouse_click(yuhuntiaozhan_xy[0], yuhuntiaozhan_xy[1], 0)
def yuhun_dashe_tubiao(): # 选择御魂-八岐大蛇 dasheyyh_xy = feature_matching(yuhundashe_pic) mousedianji.mouse_click(dasheyyh_xy[0], dasheyyh_xy[1], 0)
def yuhun_tubiao(): yuhun_xy = feature_matching(yuhun_pic) mousedianji.mouse_click(yuhun_xy[0], yuhun_xy[1], 3)