Пример #1
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()
	maps.ParseFromString(all_stops)
	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'%(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..'
					walk_random()
					proto_all=logic.all_stops(local_ses)
					api.use_api(new_rcp_point,proto_all)
					time.sleep(3)
					work_with_stops(t,local_ses.ses,new_rcp_point)
	else:
		walk_random()
		work_stop(local_ses,new_rcp_point)
Пример #2
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()
    maps.ParseFromString(all_stops)
    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] < 20:
                catch_prot = logic.catch_it(local_ses.ses, pok)
                tmp_api = api.use_api(new_rcp_point, catch_prot)
                #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 within %s m' % (
                len(data_list),
                config.distance,
            )
            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)
Пример #3
0
def start_private_show(access_token,ltype,loc):
	location.set_location(loc)
	print '[+] Token:',access_token[:40]+'...'
	prot1=logic.gen_first_data(access_token,ltype)
	local_ses=api.get_rpc_server(access_token,prot1)
	new_rcp_point='https://%s/rpc'%(local_ses.rpc_server,)
	while(True):
		proto_all=logic.all_stops(local_ses)
		api.use_api(new_rcp_point,proto_all)
		#walk_circle(120)
		walk_random()
		time.sleep(2)
		work_stop(local_ses,new_rcp_point)
Пример #4
0
def get_map(local_ses,new_rcp_point):
	proto_all=logic.all_stops(local_ses)
	all_stops=api.use_api(new_rcp_point,proto_all)
	if all_stops is not None:
		return all_stops
	else:
		return get_map(local_ses,new_rcp_point)
Пример #5
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()
    maps.ParseFromString(all_stops)
    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' % (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)
Пример #6
0
def get_map(local_ses, new_rcp_point):
    proto_all = logic.all_stops(local_ses)
    all_stops = api.use_api(new_rcp_point, proto_all)
    if all_stops is not None:
        return all_stops
    else:
        return get_map(local_ses, new_rcp_point)
Пример #7
0
def work_with_stops(current_stop,ses,new_rcp_point):
	Kinder= logic.gen_stop_data(ses,current_stop)
	tmp_api=api.use_api(new_rcp_point,Kinder)
	try:
		if tmp_api is not None:
			map = pokemon_pb2.map()
			map.ParseFromString(tmp_api)
			st= map.sess[0].status
			config.earned_xp+=map.sess[0].amt
			if st==4:
				print "[!] +%s (%s)"%(map.sess[0].amt,config.earned_xp)
			elif st==3:
				print "[!] used"
			elif st==2:
				print "[!] charging"
			elif st==1:
				print "[!] teleport.."
				time.sleep(14)
				work_with_stops(current_stop,ses,new_rcp_point)
			else:
				print "[?]:",st
		else:
			print '[-] tmp_api empty'
	except:
		print '[-] error work_with_stops'
		raise Exception('kill')
Пример #8
0
def work_with_stops(current_stop, ses, new_rcp_point):
    Kinder = logic.gen_stop_data(ses, current_stop)
    tmp_api = api.use_api(new_rcp_point, Kinder)
    try:
        if tmp_api is not None:
            map = pokemon_pb2.map()
            map.ParseFromString(tmp_api)
            st = map.sess[0].status
            config.earned_xp += map.sess[0].amt
            if st == 4:
                print "[!] +%s (%s)" % (map.sess[0].amt, config.earned_xp)
            elif st == 3:
                print "[!] used"
            elif st == 2:
                print "[!] charging"
            elif st == 1:
                print "[!] walking.."
                expPerHour()
                time.sleep(14)
                work_with_stops(current_stop, ses, new_rcp_point)
            else:
                print "[?]:", st
        else:
            print '[-] tmp_api empty'
        return True
    except:
        print '[-] error work_with_stops - Trying to restart process'
        return False
Пример #9
0
def work_with_stops(current_stop, ses, new_rcp_point):
    Kinder = logic.gen_stop_data(ses, current_stop)
    tmp_api = api.use_api(new_rcp_point, Kinder)
    try:
        if tmp_api is not None:
            map = pokemon_pb2.map()
            map.ParseFromString(tmp_api)
            st = map.sess[0].status
            config.earned_xp += map.sess[0].amt
            if st == 4:
                print "[!] +%s (%s)" % (map.sess[0].amt, config.earned_xp)
            elif st == 3:
                print "[!] used"
            elif st == 2:
                print "[!] charging"
            elif st == 1:
                print "[!] teleport.."
                time.sleep(14)
                work_with_stops(current_stop, ses, new_rcp_point)
            else:
                print "[?]:", st
        else:
            print '[-] tmp_api empty'
    except:
        print '[-] error work_with_stops'
Пример #10
0
def start_private_show(access_token,ltype):
	print '[+] Token:',access_token[:40]+'...'
	prot1=logic.gen_first_data(access_token)
	new_rcp_point,ses= api.get_rpc_server(access_token,prot1)
	print new_rcp_point
	login_data=api.use_api(new_rcp_point,prot1)
	#cis= api.get_session(login_data)
	if ses is not None:
		for t in stops.get_static():
			print '[!] farming pokestop..'
			#walking=logic.simulate_walking(ses,t)
			#api.use_api(new_rcp_point,walking)
			#time.sleep(1)
			Kinder_pre=logic.gen_stop_data_pre(ses,t)
			api.use_api(new_rcp_point,Kinder_pre)
			Kinder= logic.gen_stop_data(ses,t)
			api.use_api(new_rcp_point,Kinder)
			time.sleep(3)
Пример #11
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()
	maps.ParseFromString(all_stops)
	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] < 20:
				catch_prot= logic.catch_it(local_ses.ses,pok)
				tmp_api=api.use_api(new_rcp_point,catch_prot)
				#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 within %s m'%(len(data_list),config.distance,)
			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)
Пример #12
0
def work_stop(local_ses, new_rcp_point):
    all_stops = get_map(local_ses, new_rcp_point)
    #maps = pokemon_pb2.maps()
    maps = pokemon_pb2.maps_1()
    #try:
    maps.ParseFromString(all_stops)
    #except:
    #	print '[-] map bad'
    #	work_stop(local_ses,new_rcp_point)
    if try_item:
        print '[+] deleting 9 pokeballs'
        info_prot = logic.delete_items(local_ses.ses, 1, 9)
        tmp_api = api.use_api(new_rcp_point, info_prot)
        exit()
    else:
        if show_pok:
            catch(maps, local_ses, new_rcp_point)
        else:
            data_list = location.get_near(maps)
            data_list = sorted(data_list, key=lambda x: x[3])
            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:
                            #print t[0]
                            #print t[1],t[2]
                            #print location.get_lat(),location.get_lot()
                            #print location.l2f(t[1]),location.l2f(t[2])
                            #print location.l2f(location.get_lat()),location.l2f(location.get_lot())
                            #print location.get_distance(location.get_lat(),location.get_lot(),t[1],t[2])
                            print
                            print '[!] %s m away' % (round(
                                location.get_distance(location.get_lat(),
                                                      location.get_lot(), t[1],
                                                      t[2]), 3), )
                            if config.debug:
                                print '[!] farming pokestop..'
                            work_with_stops(t, local_ses.ses, new_rcp_point)
            else:
                walk_random()
Пример #13
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()
	maps.ParseFromString(all_stops)
	data_list=location.get_near(maps)
	data_list = sorted(data_list, key = lambda x: x[1])
	print '[+] found: %s Pokestops within %s m'%(len(data_list),config.distance,)
	if local_ses is not None and data_list is not None:
		print '[+] starting show'
		for t in data_list:
			print '[!] farming pokestop..'
			work_with_stops(t,local_ses.ses,new_rcp_point)
Пример #14
0
def work_stop(local_ses,new_rcp_point):
	all_stops=get_map(local_ses,new_rcp_point)
	#maps = pokemon_pb2.maps()
	maps = pokemon_pb2.maps_1()
	#try:
	maps.ParseFromString(all_stops)
	#except:
	#	print '[-] map bad'
	#	work_stop(local_ses,new_rcp_point)
	if try_item:
		print '[+] deleting 9 pokeballs'
		info_prot= logic.delete_items(local_ses.ses,1,9)
		tmp_api=api.use_api(new_rcp_point,info_prot)
		exit()
	else:
		if show_pok:
			catch(maps,local_ses,new_rcp_point)
		else:
			data_list=location.get_near(maps)
			data_list = sorted(data_list, key = lambda x: x[3])
			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:
							#print t[0]
							#print t[1],t[2]
							#print location.get_lat(),location.get_lot()
							#print location.l2f(t[1]),location.l2f(t[2])
							#print location.l2f(location.get_lat()),location.l2f(location.get_lot())
							#print location.get_distance(location.get_lat(),location.get_lot(),t[1],t[2])
							print
							print '[!] %s m away'%(round(location.get_distance(location.get_lat(),location.get_lot(),t[1],t[2]),3),)
							if config.debug:
								print '[!] farming pokestop..'
							work_with_stops(t,local_ses.ses,new_rcp_point)
			else:
				walk_random()
Пример #15
0
def work_with_stops(current_stop,ses,new_rcp_point):
	Kinder= logic.gen_stop_data(ses,current_stop)
	tmp_api=api.use_api(new_rcp_point,Kinder)
	try:
		if tmp_api is not None:
			map = pokemon_pb2.map()
			map.ParseFromString(tmp_api)

			if len(map.sess) > 0:
				st= map.sess[0].status
				config.earned_xp+=map.sess[0].amt
				if st==4:
					print "   [!] +%s (%s)"%(map.sess[0].amt,config.earned_xp)
				elif st==3:
					print "   [!] used"
				elif st==2:
					print "   [!] charging"
				elif st==1:
					print "   [!] walking.."
					wait_to_move()
					work_with_stops(current_stop,ses,new_rcp_point)
				else:
					print "   [?]: Unknown status %s, stop data: %s" % (st, map.sess[0])
				if map.sess[0].amt > 0:
					print "   [xp] %s" % map.sess[0].amt
			else:
				print "   [?] no map session. Expected array.  Got: %s" % str(map)
				wait_to_move()

		else:
			print '   [-] tmp_api empty (no stops in range)'
        except KeyboardInterrupt:
            print "Ending farming run.  Total XP: %s" % config.earned_xp
            sys.exit()
	except Exception, e:
		print '   [-] error work_with_stops: %s' % e
		import traceback
		print traceback.print_exc()
		print "*** len map.sess: %s" % len(map.sess)
		if len(map.sess):
			print "*** map.sess: %s" % str(map.sess)
		else: print "*** map: %s" % str(map)
		wait_to_move()
Пример #16
0
def work_with_stops(current_stop,ses,new_rcp_point):
	Kinder= logic.gen_stop_data(ses,current_stop)
	tmp_api=api.use_api(new_rcp_point,Kinder)
	if tmp_api is not None:
		map = pokemon_pb2.map()
		map.ParseFromString(tmp_api)
		st= map.sess[0].status
		if st==4:
			print "[!] +%s"%map.sess[0].amt
		elif st==3:
			print "[!] used"
		elif st==2:
			print "[!] charging"
		elif st==1:
			print "[!] teleport.."
			time.sleep(14)
			work_with_stops(current_stop,ses,new_rcp_point)
		else:
			print "[?]:",st
	else:
		print '[-] tmp_api empty'
Пример #17
0
def work_with_stops(current_stop,ses,new_rcp_point):
	COORDS_LATITUDE, COORDS_LONGITUDE, COORDS_ALTITUDE=location.get_location_coords()
	TARGET_LATITUDE=location.l2f(current_stop[1])
	TARGET_LONGITUDE=location.l2f(current_stop[2])
	TARGET_ALTITUDE=location.l2f(0x4049000000000000)
	Kinder= logic.gen_stop_data(ses,current_stop)
	tmp_api=api.use_api(new_rcp_point,Kinder)
	#proto_all=logic.all_stops(local_ses)
	#api.use_api(new_rcp_point,proto_all)
	#walk_random()
	#time.sleep(3)
	try:
		#walk_random()
		#time.sleep(3)
		if tmp_api is not None:
			map = pokemon_pb2.map()
			map.ParseFromString(tmp_api)
			st= map.sess[0].status
			config.earned_xp+=map.sess[0].amt
			if st==4:
				print "[!] +%s (%s)"%(map.sess[0].amt,config.earned_xp)
			elif st==3:
				print "[!] used"
				#item full
			elif st==2:
				print "[!] charging"
			elif st==1:
				print "[!] walking.."
				#walk_random()
				expPerHour()
				time.sleep(14)
				work_with_stops(current_stop,ses,new_rcp_point)
			else:
				print "[?]:",st
		else:
			print '[-] tmp_api empty'
	except:
		print '[-] error work_with_stops - Trying to restart process'
		restartProcess()
Пример #18
0
def catch_t(local_ses,pok,new_rcp_point):
	catch_prot= logic.catch_it(local_ses.ses,pok)
	return api.use_api(new_rcp_point,catch_prot)
Пример #19
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)
Пример #20
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()
Пример #21
0
def work_with_stops(current_stop, ses, new_rcp_point):
    lat1 = location.l2f(location.get_lat())
    lot1 = location.l2f(location.get_lot())
    lat2 = location.l2f(current_stop[1])
    lot2 = location.l2f(current_stop[2])
    #print location.l2f(lat1),location.l2f(lot1),location.l2f(lat2),location.l2f(lot2)
    walk_to_s = True
    if walk_to_s:
        if (lat1 > lat2):
            while (lat1 < lat2):
                lat1 = lat1 - config.steps * 5
                location.set_lat(lat1)
                location.set_lot(lot1)
                info_prot = logic.gen_stop_data_pre(ses, current_stop)
                tmp_api = api.use_api(new_rcp_point, info_prot)
                time.sleep(1)
        else:
            while (lat1 < lat2):
                lat1 = lat1 + config.steps * 5
                location.set_lat(lat1)
                location.set_lot(lot1)
                info_prot = logic.gen_stop_data_pre(ses, current_stop)
                tmp_api = api.use_api(new_rcp_point, info_prot)
                time.sleep(1)
        if (lot1 > lot2):
            while (lot1 > lot2):
                lot1 = lot1 - config.steps * 5
                location.set_lat(lat1)
                location.set_lot(lot1)
                info_prot = logic.gen_stop_data_pre(ses, current_stop)
                tmp_api = api.use_api(new_rcp_point, info_prot)
                time.sleep(1)
        else:
            while (lot2 > lot1):
                lot1 = lot1 + config.steps * 5
                location.set_lat(lat1)
                location.set_lot(lot1)
                info_prot = logic.gen_stop_data_pre(ses, current_stop)
                tmp_api = api.use_api(new_rcp_point, info_prot)
                time.sleep(1)
    Kinder = logic.gen_stop_data(ses, current_stop)
    tmp_api = api.use_api(new_rcp_point, Kinder)
    try:
        if tmp_api is not None:
            map = pokemon_pb2.map()
            map.ParseFromString(tmp_api)
            st = map.sess[0].status
            if map.sess[0].amt is not None:
                config.earned_xp += map.sess[0].amt
            if st == 4:
                print "[!] " + datetime.datetime.now().strftime(
                    "%H:%M:%S") + " bag full +%s (%s)" % (map.sess[0].amt,
                                                          config.earned_xp)
            elif st == 3:
                print "[!] " + datetime.datetime.now().strftime(
                    "%H:%M:%S") + " cooldown"
            elif st == 2:
                print "[!] " + datetime.datetime.now().strftime(
                    "%H:%M:%S") + " charging"
            elif st == 1:
                print "[!] " + datetime.datetime.now().strftime(
                    "%H:%M:%S") + " +%s (%s)" % (map.sess[0].amt,
                                                 config.earned_xp)
                #work_with_stops(current_stop,ses,new_rcp_point)
            else:
                print "[?]:", st
        else:
            print '[-] tmp_api empty'
    except:
        print '[-] error work_with_stops'
Пример #22
0
def start_private_show(access_token,ltype):
	print '[+] Token:',access_token[:40]+'...'
	prot1=logic.gen_first_data(access_token)
	new_api= api.get_rpc_server(access_token,prot1)
	login_data=api.use_api(new_api,prot1)
	cis= api.get_session(login_data)
Пример #23
0
def catch_t(local_ses, pok, new_rcp_point):
    catch_prot = logic.catch_it(local_ses.ses, pok)
    return api.use_api(new_rcp_point, catch_prot)
Пример #24
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()
Пример #25
0
def submit():
    n=[]
    r=[]
    x=[]
    ty = (request.form.get('lan'))
    if request.method == 'POST' and  ty == 'ENG':
        r=request.form['textT']
        tn=api.use_api(r,'en')
        n=tn.split("\n")
        c="\n".join(n)
        z=summarize(c)
        return render_template('generic.html',z=z,tn=tn,r=r)
    elif request.method == 'POST' and ty == 'CHI':
        r=request.form['textT']
        n=r.split("\n")
        c="\n".join(n)
        z=summarize(c)
        z=api.use_api(z,'zh-tw')
        tn = api.use_api(c, 'zh-tw')
        return render_template('generic.html',z=z,tn=tn,r=r)
    elif request.method == 'POST' and ty == 'SPI':
        r=request.form['textT']
        n=r.split("\n")
        c="\n".join(n)
        z=summarize(c)
        z=api.use_api(z,'es')
        tn=api.use_api(c,'es')
        return render_template('generic.html',z=z,tn=tn,r=r)
    elif request.method == 'POST' and ty == 'ARA':
        r=request.form['textT']
        n=r.split("\n")
        c="\n".join(n)
        z=summarize(c)
        z=api.use_api(z,'ar')
        tn=api.use_api(c,'ar')
        return render_template('generic.html',z=z,tn=tn,r=r)
    elif request.method == 'POST' and ty == 'HIN':
        r=request.form['textT']
        n=r.split("\n")
        c="\n".join(n)
        z=summarize(c)
        z=api.use_api(z,'hi')
        tn=api.use_api(c,'hi')
        return render_template('generic.html',z=z,tn=tn,r=r)
    elif request.method == 'POST' and  ty == 'kENG' : # URL(K)
        t,z=IU.CU(request.form['textU'])
        r=t+z
        tn=api.use_api(z,'en')
        z=summarize(z)
        x.append(t)
        x.append(z)
        z="\n".join(x)
        z=api.use_api(z,'en')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and  ty == 'kKOR' :
        t,z=IU.CU(request.form['textU'])
        r=t+z
        z=summarize(z)
        x.append(t)
        x.append(z)
        z="\n".join(x)
        return render_template('generic.html', z=z,r=r)
    elif request.method == 'POST' and  ty == 'kCHI' : # URL(K)
        t,z=IU.CU(request.form['textU'])
        r=t+z
        tn=api.use_api(z,'zh-tw')
        z=summarize(z)
        x.append(t)
        x.append(z)
        z="\n".join(x)
        z=api.use_api(z,'zh-tw')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and  ty == 'kSPI' : # URL(K)
        t,z=IU.CU(request.form['textU'])
        r=t+z
        tn=api.use_api(z,'es')
        z=summarize(z)
        x.append(t)
        x.append(z)
        z="\n".join(x)
        z=api.use_api(z,'es')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and  ty == 'kARA' : # URL(K)
        t,z=IU.CU(request.form['textU'])
        r=t+z
        tn=api.use_api(z,'ar')
        z=summarize(z)
        x.append(t)
        x.append(z)
        z="\n".join(x)
        z=api.use_api(z,'ar')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and  ty == 'kHIN' : # URL(K)
        t,z=IU.CU(request.form['textU'])
        r=t+z
        tn=api.use_api(z,'hi')
        z=summarize(z)
        x.append(t)
        x.append(z)
        z="\n".join(x)
        z=api.use_api(z,'hi')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and ty == 'eENG':
        t, z = IE.CU1(request.form['textU'])
        r=t+z
        z = summarize(z)
        x.append(t)
        x.append(z)
        z = "\n".join(x)
        return render_template('generic.html', z=z,r=r)
    elif request.method == 'POST' and ty == 'eKOR':
        t, z = IE.CU1(request.form['textU'])
        r = t + z
        tn=api.use_api(z,'ko')
        z = summarize(z)
        x.append(t)
        x.append(z)
        z = "\n".join(x)
        z=api.use_api(z,'ko')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and ty == 'eCHI':
        t, z = IE.CU1(request.form['textU'])
        r = t + z
        tn = api.use_api(z, 'zh-tw')
        z = summarize(z)
        x.append(t)
        x.append(z)
        z = "\n".join(x)
        z = api.use_api(z, 'zh-tw')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and ty == 'eSPI':
        t, z = IE.CU1(request.form['textU'])
        r=t+z
        tn = api.use_api(z, 'es')
        z = summarize(z)
        x.append(t)
        x.append(z)
        z = "\n".join(x)
        z = api.use_api(z, 'es')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and ty == 'eARA':
        t, z = IE.CU1(request.form['textU'])
        r = t + z
        tn = api.use_api(z, 'ar')
        z = KOR.kor(z)
        x.append(t)
        x.append(z)
        z = "\n".join(x)
        z = api.use_api(z, 'ar')
        return render_template('generic.html', z=z,r=r,tn=tn)
    elif request.method == 'POST' and ty == 'eHIN':
        t, z = IE.CU1(request.form['textU'])
        r = t + z
        tn = api.use_api(z, 'hi')
        z = summarize(z)
        x.append(t)
        x.append(z)
        z = "\n".join(x)
        z = api.use_api(z, 'hi')
        return render_template('generic.html', z=z,r=r,tn=tn)
    else :
        r = request.form['textT']
        tn=api.use_api(r,'ko')
        n=tn.split("\n")
        c="\n".join(n)
        z = KOR.kor(c)
        return render_template('generic.html',z=z,r=r,tn=tn)
Пример #26
0
def work_with_stops(current_stop,ses,new_rcp_point):
	lat1=location.l2f(location.get_lat())
	lot1=location.l2f(location.get_lot())
	lat2=location.l2f(current_stop[1])
	lot2=location.l2f(current_stop[2])
	#print location.l2f(lat1),location.l2f(lot1),location.l2f(lat2),location.l2f(lot2)
	walk_to_s=True
	if walk_to_s:
		if (lat1>lat2):
			while(lat1<lat2):
				lat1=lat1-config.steps*5
				location.set_lat(lat1)
				location.set_lot(lot1)
				info_prot= logic.gen_stop_data_pre(ses,current_stop)
				tmp_api=api.use_api(new_rcp_point,info_prot)
				time.sleep(1)
		else:
			while(lat1<lat2):
				lat1=lat1+config.steps*5
				location.set_lat(lat1)
				location.set_lot(lot1)
				info_prot= logic.gen_stop_data_pre(ses,current_stop)
				tmp_api=api.use_api(new_rcp_point,info_prot)
				time.sleep(1)
		if (lot1>lot2):
			while(lot1>lot2):
				lot1=lot1-config.steps*5
				location.set_lat(lat1)
				location.set_lot(lot1)
				info_prot= logic.gen_stop_data_pre(ses,current_stop)
				tmp_api=api.use_api(new_rcp_point,info_prot)
				time.sleep(1)
		else:
			while(lot2>lot1):
				lot1=lot1+config.steps*5
				location.set_lat(lat1)
				location.set_lot(lot1)
				info_prot= logic.gen_stop_data_pre(ses,current_stop)
				tmp_api=api.use_api(new_rcp_point,info_prot)
				time.sleep(1)
	Kinder= logic.gen_stop_data(ses,current_stop)
	tmp_api=api.use_api(new_rcp_point,Kinder)
	try:
		if tmp_api is not None:
			map = pokemon_pb2.map()
			map.ParseFromString(tmp_api)
			st= map.sess[0].status
			if map.sess[0].amt is not None:
				config.earned_xp+=map.sess[0].amt
			if st==4:
				print "[!] " + datetime.datetime.now().strftime("%H:%M:%S") + " bag full +%s (%s)"%(map.sess[0].amt,config.earned_xp)
			elif st==3:
				print "[!] " + datetime.datetime.now().strftime("%H:%M:%S")+ " cooldown"
			elif st==2:
				print "[!] " + datetime.datetime.now().strftime("%H:%M:%S")+ " charging"
			elif st==1:
				print "[!] " + datetime.datetime.now().strftime("%H:%M:%S")+ " +%s (%s)"%(map.sess[0].amt,config.earned_xp)
				#work_with_stops(current_stop,ses,new_rcp_point)
			else:
				print "[?]:",st
		else:
			print '[-] tmp_api empty'
	except:
		print '[-] error work_with_stops'