Closed firanto closed 8 years ago
To tag along, here are my similar questions from another github issues thread:
In lieu of a new Pokemon species, I'm now encountering a new problem instead.
My script, made to print the Pokemon available in the surrounding area (using WildPokemon), seems to only work when I set my location to popular places like the Santa Monica Pier or Times Square. Otherwise, when it's set to locations like the street I live on, it prints absolutely nothing, bar the heartbeat notification. Is this a kink in the api? Or is my search radius simply not large enough to detect the surrounding "invisible" Pokemon?
Assuming the latter: I was under the impression that WildPokemon would reveal all Pokemon in a larger radius than NearbyPokemon, but I suppose this is not the case. I take it the only way to map out the locations of all the local Pokemon is to write an algorithm that has my character move in circles that gradually grow in size. Has something like this already been developed?
I'm not sure it makes much of a difference in this use case, but I switched over to @d-pollard's fork of the api.
Edit: Just stumbled upon the nearby Pokemon function found in this https://github.com/Daplie/node-pokemap/blob/master/index.js ... They don't seem to have a script implemented that moves their character around. Why/how are they able to register these Pokemon?
After I look into it a bit more, I think each this is flow:
By these flow, that script mentioned by @WhataShane is reading this map pokemons data from the heartbeat which only returned if the player is sending heartbeat with location data near enough to the pokemon location stored on the server. He does exactly what the game did. He didn't scan all nearby pokemons' location.
This way, we cannot get all pokemon's position without actually moving the character's location. As WhataShane said, we must decide a point, and then move in circular motion wider and back to the center to scan the vicinity. Note that each pokemon will disappear after each of them reach their designated expiration (which means you need to constantly moving in circular motion with your gps location as the center).
My suggestion when doing this, use any secondary, disposable account just in case you get banned. You didn't plan to catch anything anyway.
I have a few question regarding heartbeat payload sent by the server.