Exemple #1
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')
Exemple #2
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'
Exemple #3
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
Exemple #4
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)
Exemple #5
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()
Exemple #6
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'
Exemple #7
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()
Exemple #8
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'
Exemple #9
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'