Example #1
0
def catch(maps,local_ses,new_rcp_point):
	data_list=location.get_near_p(maps)
	data_list = sorted(data_list, key = lambda x: x[5])
	if len(data_list)>0:
		print
		print '[!] found %s pokemon'%(len(data_list),)
		for idx, e in enumerate(data_list):
			if(e[0] not in config.list_banned_Pokemon): #Banned Pokemon
				print '[!] %s Type:%s its %s m away'%(idx,e[0],e[len(e)-1],)
		print 
		for idx, pok in enumerate(data_list):
			if(pok[0] not in config.list_banned_Pokemon): #Banned Pokemon
				#print '[!] %s Type:%s its %s m away'%(idx,pok[0],pok[len(pok)-1],)
				#if pok[0] < 22:
				if pok[len(pok)-1] < 600:
					print '[!] Trying to catch Type:%s its %s m away'%(pok[0],round(location.get_distance(location.get_lat(),location.get_lot(),pok[1],pok[2]),3),)
					lat1=location.l2f(location.get_lat())
					lot1=location.l2f(location.get_lot())
					lat2=location.l2f(pok[1])
					lot2=location.l2f(pok[2])
					#print location.l2f(lat1),location.l2f(lot1),location.l2f(lat2),location.l2f(lot2)
					if (lat1>lat2):
						while(lat1<lat2):
							lat1=lat1-config.steps
							location.set_lat(lat1)
							location.set_lot(lot1)
							info_prot= logic.get_info(local_ses.ses,pok)
							tmp_api=api.use_api(new_rcp_point,info_prot)
							time.sleep(2)
					else:
						while(lat1<lat2):
							lat1=lat1+config.steps
							location.set_lat(lat1)
							location.set_lot(lot1)
							info_prot= logic.get_info(local_ses.ses,pok)
							tmp_api=api.use_api(new_rcp_point,info_prot)
							time.sleep(2)
					if (lot1>lot2):
						while(lot1>lot2):
							lot1=lot1-config.steps
							location.set_lat(lat1)
							location.set_lot(lot1)
							info_prot= logic.get_info(local_ses.ses,pok)
							tmp_api=api.use_api(new_rcp_point,info_prot)
							time.sleep(2)
					else:
						while(lot2>lot1):
							lot1=lot1+config.steps
							location.set_lat(lat1)
							location.set_lot(lot1)
							info_prot= logic.get_info(local_ses.ses,pok)
							tmp_api=api.use_api(new_rcp_point,info_prot)
							time.sleep(2)
					#catch_prot= logic.catch_it(local_ses.ses,pok)
					#tmp_api=api.use_api(new_rcp_point,catch_prot)
					tmp_api=catch_t(local_ses,pok,new_rcp_point)
					if tmp_api is not None:
						catch_status = pokemon_pb2.catch_status()
						catch_status.ParseFromString(tmp_api)
						if catch_status.sess[0].status:
							print "[+] " + datetime.datetime.now().strftime("%H:%M:%S")+ " caught pok... %s"%(catch_status.sess[0].status,)
					else:
						print '[-] catch data is none'
					#exit()
				#exit()
				#walk_random()
	walk_random()
Example #2
0
def catch(maps, local_ses, new_rcp_point):
    data_list = location.get_near_p(maps)
    data_list = sorted(data_list, key=lambda x: x[5])
    if len(data_list) > 0:
        print
        print '[!] found %s pokemon' % (len(data_list), )
        for idx, e in enumerate(data_list):
            if (e[0] not in config.list_banned_Pokemon):  #Banned Pokemon
                print '[!] %s Type:%s its %s m away' % (
                    idx,
                    e[0],
                    e[len(e) - 1],
                )
        print
        for idx, pok in enumerate(data_list):
            if (pok[0] not in config.list_banned_Pokemon):  #Banned Pokemon
                #print '[!] %s Type:%s its %s m away'%(idx,pok[0],pok[len(pok)-1],)
                #if pok[0] < 22:
                if pok[len(pok) - 1] < 600:
                    print '[!] Trying to catch Type:%s its %s m away' % (
                        pok[0],
                        round(
                            location.get_distance(location.get_lat(),
                                                  location.get_lot(), pok[1],
                                                  pok[2]), 3),
                    )
                    lat1 = location.l2f(location.get_lat())
                    lot1 = location.l2f(location.get_lot())
                    lat2 = location.l2f(pok[1])
                    lot2 = location.l2f(pok[2])
                    #print location.l2f(lat1),location.l2f(lot1),location.l2f(lat2),location.l2f(lot2)
                    if (lat1 > lat2):
                        while (lat1 < lat2):
                            lat1 = lat1 - config.steps
                            location.set_lat(lat1)
                            location.set_lot(lot1)
                            info_prot = logic.get_info(local_ses.ses, pok)
                            tmp_api = api.use_api(new_rcp_point, info_prot)
                            time.sleep(2)
                    else:
                        while (lat1 < lat2):
                            lat1 = lat1 + config.steps
                            location.set_lat(lat1)
                            location.set_lot(lot1)
                            info_prot = logic.get_info(local_ses.ses, pok)
                            tmp_api = api.use_api(new_rcp_point, info_prot)
                            time.sleep(2)
                    if (lot1 > lot2):
                        while (lot1 > lot2):
                            lot1 = lot1 - config.steps
                            location.set_lat(lat1)
                            location.set_lot(lot1)
                            info_prot = logic.get_info(local_ses.ses, pok)
                            tmp_api = api.use_api(new_rcp_point, info_prot)
                            time.sleep(2)
                    else:
                        while (lot2 > lot1):
                            lot1 = lot1 + config.steps
                            location.set_lat(lat1)
                            location.set_lot(lot1)
                            info_prot = logic.get_info(local_ses.ses, pok)
                            tmp_api = api.use_api(new_rcp_point, info_prot)
                            time.sleep(2)
                    #catch_prot= logic.catch_it(local_ses.ses,pok)
                    #tmp_api=api.use_api(new_rcp_point,catch_prot)
                    tmp_api = catch_t(local_ses, pok, new_rcp_point)
                    if tmp_api is not None:
                        catch_status = pokemon_pb2.catch_status()
                        catch_status.ParseFromString(tmp_api)
                        if catch_status.sess[0].status:
                            print "[+] " + datetime.datetime.now().strftime(
                                "%H:%M:%S") + " caught pok... %s" % (
                                    catch_status.sess[0].status, )
                    else:
                        print '[-] catch data is none'
                    #exit()
                #exit()
                #walk_random()
    walk_random()
Example #3
0
def work_stop(local_ses,new_rcp_point):
	proto_all=logic.all_stops(local_ses)
	all_stops=api.use_api(new_rcp_point,proto_all)
	maps = pokemon_pb2.maps()
	try:
		maps.ParseFromString(all_stops)
	except:
		work_stop(local_ses,new_rcp_point)
	if show_pok:
		data_list=location.get_near_p(maps)
		if len(data_list)>0:
			print '[!] found %s pokemon near you'%(len(data_list),)
			for idx, pok in enumerate(data_list):
				print '[!] %s Type:%s its %s m away'%(idx,pok[0],pok[len(pok)-1],)
				#if pok[0] < 22:
				#if pok[len(pok)-1] < 45:
				lat1=location.l2f(location.get_lat())
				lot1=location.l2f(location.get_lot())
				lat2=location.l2f(pok[1])
				lot2=location.l2f(pok[2])
				#print location.l2f(lat1),location.l2f(lot1),location.l2f(lat2),location.l2f(lot2)
				if (lat1>lat2):
					while(lat1<lat2):
						lat1=lat1-0.000095
						location.set_lat(lat1)
						location.set_lot(lot1)
						info_prot= logic.get_info(local_ses.ses,pok)
						tmp_api=api.use_api(new_rcp_point,info_prot)
						time.sleep(2)
				else:
					while(lat1<lat2):
						lat1=lat1+0.000095
						location.set_lat(lat1)
						location.set_lot(lot1)
						info_prot= logic.get_info(local_ses.ses,pok)
						tmp_api=api.use_api(new_rcp_point,info_prot)
						time.sleep(2)
				if (lot1>lot2):
					while(lot1>lot2):
						lot1=lot1-0.000095
						location.set_lat(lat1)
						location.set_lot(lot1)
						info_prot= logic.get_info(local_ses.ses,pok)
						tmp_api=api.use_api(new_rcp_point,info_prot)
						time.sleep(2)
				else:
					while(lot2>lot1):
						lot1=lot1+0.000095
						location.set_lat(lat1)
						location.set_lot(lot1)
						info_prot= logic.get_info(local_ses.ses,pok)
						tmp_api=api.use_api(new_rcp_point,info_prot)
						time.sleep(2)
				catch_prot= logic.catch_it(local_ses.ses,pok)
				tmp_api=api.use_api(new_rcp_point,catch_prot)
				print "[+] catched pok..."
				#else:
				#	print '[-] too far away'
				#exit()
				walk_random()
		walk_random()
		time.sleep(2)
	else:
		data_list=location.get_near(maps)
		data_list = sorted(data_list, key = lambda x: x[1])
		if len(data_list)>0:
			print '[+] found: %s Pokestops near you'%(len(data_list),)
			if local_ses is not None and data_list is not None:
				print '[+] starting show'
				if multi:
					a,b=split_list(data_list)
					p = Process(target=work_half_list, args=(a,local_ses.ses,new_rcp_point))
					o = Process(target=work_half_list, args=(a,local_ses.ses,new_rcp_point))
					p.start()
					o.start()
					p.join()
					o.join()
					print '[!] farming done..'
				else:
					for t in data_list:
						if config.debug:
							print '[!] farming pokestop..'
						work_with_stops(t,local_ses.ses,new_rcp_point)
		else:
			walk_random()
			work_stop(local_ses,new_rcp_point)