def start(zuobiao,close): print("kaishi") gogogo = 1 while gogogo>0: #^ 判断人物是否在移动,静止返回-1,在移动返回0,只判断一次,实时返回 panduan1 = isMove_once() # panduan2 = isFight_once() if panduan1 ==0: while panduan1 == 0: sleep(1) panduan1 = isMove_once() jiepin() zhandou = matchImg('home.jpg','./wenzi_huihe.jpg') if zhandou[0]>0: # if panduan1 ==0 : # isfight = 0 # if zhandou[0]>0: print("战斗中") isfight = 1 while isfight > 0: jiepin() sleep(0.5) zhandou = matchImg('home.jpg','./wenzi_huihe.jpg') if zhandou[0] > 0: isfight = 1 print('战斗中') else: isfight = 0 print('战斗结束') else: # go_move() # jingwai_go_move() # huaguoshan_go_move() # haidi1_go_move() daidui_go_move(zuobiao,close) sleep(5)
def start(): gogogo = 1 while gogogo > 0: #^ 判断人物是否在移动,静止返回-1,在移动返回0,只判断一次,实时返回 panduan1 = isMove_once() # panduan2 = isFight_once() if panduan1 == 0: while panduan1 == 0: sleep(1) panduan1 = isMove_once() jiepin() zhandou = matchImg('home.jpg', './wenzi_huihe.jpg') if zhandou[0] > 0: # if panduan1 ==0 : # isfight = 0 # if zhandou[0]>0: print("fighting") isfight = 1 while isfight > 0: jiepin() sleep(0.5) zhandou = matchImg('home.jpg', './wenzi_huihe.jpg') if zhandou[0] > 0: isfight = 1 print('fighting') else: isfight = 0 print('战斗结束') else: # go_move() huaguoshan_go_move() sleep(5)
def start(zuobiao, close): print("kaishi") gogogo = 1 while gogogo > 0: #^ 判断人物是否在移动,静止返回-1,在移动返回0,只判断一次,实时返回 panduan1 = isMove_once() # panduan2 = isFight_once() if panduan1 == 0: while panduan1 == 0: sleep(1) panduan1 = isMove_once() jiepin() zidong = matchImg('saota_home.jpg', './chongzhi_pic.jpg', 0.40) # zidong = get_pay_keyboard_number_location('test_saota_home.jpg','chongzhi_pic.jpg',0.8) if zidong[0] <= 0: send_message_to_slack('主号需要处理') sleep(5) print("取消自动了") else: print("自动 ing") zhandou = matchImg('saota_home.jpg', './wenzi_huihe.jpg') if zhandou[0] > 0: # # if panduan1 ==0 : # time_start = time.time() #开始计时 # isfight = 0 # if zhandou[0]>0: print("fight中") isfight = 1 while isfight > 0: jiepin() sleep(0.5) zhandou = matchImg('saota_home.jpg', './wenzi_huihe.jpg') if zhandou[0] > 0: isfight = 1 print('fighting中') jiepin2() jiepin() sleep(1) zidong = matchImg('saota_home.jpg', './chongzhi_pic.jpg', 0.5) # zidong = get_pay_keyboard_number_location('test_saota_home.jpg','chongzhi_pic.jpg',0.8) if zidong[0] <= 0: # send_message_to_slack('主号需要处理') sleep(2) print("取消自动了") else: print("自动 ing") # time_end = time.time() #结束计时 # time_c= time_end - time_start #运行所花时间 # time_c=int(time_c) # print('战斗耗时: ' + str(time_c)) # if time_c > 70: # send_message_to_slack('fight超时') # time.sleep(30) # time_start = time.time() else: isfight = 0 print('fighting结束') else: # T5_move() long1_move() # long3_move() # huaguoshan_move() # beiju_move() # daidui_go_move(zuobiao,close) sleep(5) new_sleep()