def douji(): global last_click doujipaidui = 0 refresh = 0 while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) for i in ['jujue','shoudong','zidong','queren',\ 'douji','douji3',\ 'doujiqueren','doujiend','ying',\ 'zhunbei','zhunbei2',\ 'doujiquxiao']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() if i == 'douji': doujipaidui = 0 print('斗技开始', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(15, 30) / 100 time.sleep(t) break elif i == 'doujiquxiao': refresh = 0 doujipaidui = doujipaidui + 1 print('斗技搜索:', doujipaidui) if doujipaidui > 5: doujipaidui = 0 print('取消搜索') xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(15, 30) / 100 time.sleep(t) break else: print('斗技中。。。', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(50, 100) / 100 time.sleep(t) break
def yuhun(): global last_click cishu = 0 refresh = 0 while True: #鼠标移到最右侧中止 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #print('screen shot ok',time.ctime()) #体力不足 want = imgs['notili'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('体力不足') select_mode() #自动点击通关结束后的页面 for i in ['jujue','tiaozhan','tiaozhan2',\ 'moren','queding','querenyuhun','ying','jiangli',\ 'jixu','shibai']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 elif i == 'querenyuhun': refresh = refresh + 2 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() if i == 'tiaozhan' or i == 'tiaozhan2': if refresh == 0: cishu = cishu + 1 print('挑战次数:', cishu) t = random.randint(50, 150) / 100 time.sleep(t) else: print('挑战中。。。', i) t = random.randint(50, 100) / 100 xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) time.sleep(t) break
def yaoqi(): global last_click count = 0 refresh = 0 while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #委派任务 for i in ['jujue','jiangli','jixu','zhunbei',\ 'shibai','zidongpipei','zudui2',\ 'ying','tiaozhan3','tiaozhan4']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() if i == 'zidongpipei' or i == 'tiaozhan3' or i == 'tiaozhan4': if refresh == 0: count = count + 1 print('次数:', count) t = 100 / 100 elif i == 'shibai': print('自动结束') select_mode() else: print('活动中。。。', i) t = random.randint(30, 80) / 100 xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) time.sleep(t) break #体力不足 want = imgs['notili'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('体力不足') select_mode()
def huodong(): global last_click count = 0 refresh = 0 while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #体力不足 want = imgs['notili'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('体力不足 ') select_mode() for i in ['jujue','hdxuanze','hdxuanze2','hdzhandou','hdjieshou',\ 'hdtiaozhan','zhunbei','querenyuhun',\ 'jiangli','ying','shibai','jixu','hdend','hdguanbi']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) print('活动中', i) if refresh > 6: print('进攻次数上限') select_mode() if i == 'hdtiaozhan': if refresh == 0: count = count + 1 print('挑战次数:', count) if i == 'hdend': if refresh == 0: print('疲劳度满,休息1小时') t = 60 * 60 time.sleep(t) else: xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(300, 500) / 100 time.sleep(t)
def shengxing(): global last_click count = 0 refresh = 0 while True: #鼠标移到右侧中止 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) for i in ['jineng','jixushengxing',\ 'jixuyucheng','querenshengxing']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('升级中。。。', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) if i == 'querenshengxing': if refresh == 0: count = count + 1 print('升级个数:', count) t = random.randint(250, 350) / 100 else: t = random.randint(20, 100) / 100 time.sleep(t)
def chouka(): global last_click count = 0 while True: #鼠标移到右侧中止 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) want = imgs['zaicizhaohuan'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if count > 200: print('次数上限') select_mode() count = count + 1 print('抽卡中。。。', count) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy)
def tupo(): global last_click count = 0 #总次数 cishu = 0 refresh = 0 liaotu = None while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 #im = np.array(mss.mss().grab(monitor)) #screen = cv2.cvtColor(im, cv2.COLOR_BGRA2BGR) #print(scalar) screen = action.screenshot(monitor) #cv2.imshow("Image", screen) #cv2.waitKey(0) #寮突破判断 if liaotu == None: want = imgs['liaotupo'] size = want[0].shape h, w, ___ = size pts = action.locate(screen, want, 0) if not len(pts) == 0: liaotu = True print('寮突破') want = imgs['gerentupo'] size = want[0].shape h, w, ___ = size pts = action.locate(screen, want, 0) if not len(pts) == 0: liaotu = False print('个人突破') if liaotu == True: if cishu >= 6: print('等待5分钟CD') t = 5 * 60 - 20 #t=2 time.sleep(t) cishu = cishu - 1 elif liaotu == False: if cishu >= 31: print('进攻次数上限') select_mode() want = imgs['jingonghuise'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: cishu = 6 refresh = refresh + 1 print('进攻次数上限:', count) #奖励 for i in ['jujue','queding',\ 'shibai','ying','jiangli',\ 'jingong','jingong2',\ 'lingxunzhang','lingxunzhang2',\ 'shuaxin']: #print(i) want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: if i == 'jingong' or i == 'jingong2': refresh = refresh + 7 else: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(15, 50) / 100 if i == 'shibai': if cishu > 0: cishu = cishu - 1 if count > 0: count = count - 1 print('进攻总次数:', count) t = random.randint(50, 100) / 100 elif i == 'jingong' or i == 'jingong2': if refresh == 0: cishu = cishu + 1 count = count + 1 print('进攻总次数:', count) t = random.randint(500, 800) / 100 elif i == 'lingxunzhang' or i == 'lingxunzhang2': t = random.randint(50, 100) / 100 else: print('突破中。。。', i) time.sleep(t) break
def baigui(): global last_click cishu = 0 while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #设定目标,开始查找 #进入后 for i in ['baigui', 'gailv', 'douzihuoqu']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('点击', i) xy = action.cheat(pts[0], w, h) pyautogui.click(xy) t = random.randint(15, 30) / 100 time.sleep(t) continue want = imgs['youxiang'] target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('正在邮箱中') want = imgs['guanbi'] size = want[0].shape h, w, ___ = size target = screen pts2 = action.locate(target, want, 0) if not len(pts2) == 0: print('关闭窗口', pts2) xx = action.cheat(pts2[0], w, h) pyautogui.click(xx) time.sleep(0.5) want = imgs['inbaigui'] target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: #print('正在百鬼中') want = imgs['blank'] target = screen pts = action.locate(target, want, 0) if len(pts) == 0: #小怪出现! print('点击小怪') pts2 = (640, 450) xx = action.cheat(pts2, 100, 80) pyautogui.click(xx) time.sleep(0.5) continue want = imgs['jinru'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: cishu = cishu + 1 print('进入百鬼:', cishu) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) t = random.randint(300, 400) / 100 time.sleep(t) want = imgs['kaishi'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('选择界面: ', pts[0]) want = imgs['ya'] size = want[0].shape h, w, ___ = size target = screen pts2 = action.locate(target, want, 0) if not len(pts2) == 0: print('点击开始: ', pts[0]) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) t = random.randint(15, 30) / 100 time.sleep(t) else: #选择押注 index = random.randint(0, 2) pts2 = (300 + index * 340, 500) print('选择押注: ', index) xy = action.cheat(pts2, w, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) t = random.randint(15, 30) / 100 time.sleep(t) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) t = random.randint(15, 30) / 100 time.sleep(t) want = imgs['fenxiang'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('结束界面: ', pts[0]) pts[0] = (1200, 100) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) t = random.randint(15, 30) / 100 time.sleep(t)
def gouliang3(): global last_click count = 0 refresh = 0 while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #体力不足 want = imgs['notili'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('体力不足 ') select_mode() want = imgs['queren'] size = want[0].shape h, w, ___ = size target = screen #x1,x2 = upleft, (965, 522) #target = action.cut(screen, x1, x2) pts = action.locate(target, want, 0) if not len(pts) == 0: print('确认退出') try: queding = pts[1] except: queding = pts[0] xy = action.cheat(queding, w, h) pyautogui.click(xy) pyautogui.moveTo(xy) t = random.randint(15, 30) / 100 time.sleep(t) #设定目标,开始查找 #进入后 want = imgs['guding'] #x1 = (785, 606) #x2 = downright #target = action.cut(screen, x1, x2) pts = action.locate(screen, want, 0) if not len(pts) == 0: print('正在地图中') want = imgs['left'] target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if scalar: right = (854 / 2, 528 / 2) else: right = (854, 527) right = action.cheat(right, 10, 10) pyautogui.click(right) t = random.randint(50, 80) / 100 time.sleep(t) continue for i in ['boss', 'jian']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() if refresh == 0: count = count + 1 print('点击小怪', i) print('探索次数:', count) if count > 500: print('次数上限') select_mode() xx = action.cheat(pts[0], w, h) pyautogui.click(xx) time.sleep(0.5) break if len(pts) == 0: for i in ['queren', 'queren2', 'tuichu']: want = imgs[i] size = want[0].shape h, w, ___ = size pts = action.locate(screen, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('退出中', i) try: queding = pts[1] except: queding = pts[0] queding = action.cheat(queding, w, h) pyautogui.click(queding) t = random.randint(50, 80) / 100 time.sleep(t) break continue for i in ['jujue','querenyuhun',\ 'tansuo','ying','jiangli','jixu','c28','ditu']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('领取奖励', i) xy = action.cheat(pts[0], w, h) pyautogui.click(xy) t = random.randint(15, 30) / 100 time.sleep(t) break
def gouliang2(): global last_click refresh = 0 while True: #直到取消,或者出错 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #体力不足 want = imgs['notili'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('体力不足 ') select_mode() #进入后 want = imgs['guding'] pts = action.locate(screen, want, 0) if not len(pts) == 0: print('正在地图中') want = imgs['xiao'] pts = action.locate(screen, want, 0) if not len(pts) == 0: print('组队状态中') else: print('退出重新组队') for i in ['queren', 'queren2', 'tuichu']: want = imgs[i] size = want[0].shape h, w, ___ = size pts = action.locate(screen, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('退出中', i) try: queding = pts[1] except: queding = pts[0] queding = action.cheat(queding, w, h) pyautogui.click(queding) t = random.randint(50, 80) / 100 time.sleep(t) break continue for i in ['jujue','jieshou','querenyuhun','ying',\ 'jiangli','jixu']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('领取奖励', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) if i == 'jieshou' or i == 'jieshou1': t = random.randint(15, 30) / 100 else: t = random.randint(15, 30) / 100 time.sleep(t) break
def yuhun2(): global last_click cishu = 0 refresh = 0 while True: #鼠标移到最右侧中止 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #体力不足 want = imgs['notili'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('体力不足') select_mode() #如果队友推出则自己也退出 want = imgs['tiaozhanhuise'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: print('队友已退出') want = imgs['likaiduiwu'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(15, 30) / 100 time.sleep(t) #自动点击通关结束后的页面 for i in ['jujue','moren','queding','querenyuhun',\ 'ying','jiangli','jixu',\ 'jieshou2','jieshou','shibai']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 elif i == 'querenyuhun': refresh = refresh + 2 else: refresh = 0 #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() elif refresh == 0 and i == 'jiangli' and not last_click == 'querenyuhun': #print('last',last_click) cishu = cishu + 1 print('挑战次数:', cishu) print('挑战中。。。', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) last_click = i t = random.randint(15, 30) / 100 time.sleep(t) break
def mijing(): global last_click refresh = 0 while True: #鼠标移到右侧中止 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) #检测聊天界面 want = imgs['liaotianguanbi'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: #print('搜索秘境车中。。。') for i in ['jujue', 'mijingzhaohuan', 'mijingzhaohuan2']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('秘境召唤。。。', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) #t = random.randint(10,100) / 100 #time.sleep(t) break else: for i in ['jujue', 'canjia', 'liaotian']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() if i == 'canjia': print('加入秘境召唤!', i) xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) t = random.randint(10, 30) / 100 time.sleep(t) break
def card(): global last_click refresh = 0 while True: #鼠标移到右侧中止 if pyautogui.position()[0] >= pyautogui.size()[0] * 0.98: select_mode() #截屏 screen = action.screenshot(monitor) for i in ['taiyin2', 'sanshinei', 'taiyin3']: want = imgs[i] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = i #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('结界卡*', i) xy = action.cheat(pts[0], w / 2, h - 10) pyautogui.click(xy) break if len(pts) == 0: print('结界卡不足') select_mode() for i in range(2): #截屏 im = np.array(mss.mss().grab(monitor)) screen = cv2.cvtColor(im, cv2.COLOR_BGRA2BGR) want = imgs['taiyin'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if len(pts) == 0: print('结界卡不足') select_mode() else: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = 'taiyin' #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('结界卡', i) xy = action.cheat(pts[0], w / 2, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) #截屏 screen = action.screenshot(monitor) want = imgs['hecheng'] size = want[0].shape h, w, ___ = size target = screen pts = action.locate(target, want, 0) if not len(pts) == 0: if last_click == i: refresh = refresh + 1 else: refresh = 0 last_click = 'hecheng' #print('重复次数:',refresh) if refresh > 6: print('进攻次数上限') select_mode() print('合成中。。。') xy = action.cheat(pts[0], w, h - 10) pyautogui.click(xy) pyautogui.moveTo(xy) time.sleep(1)