getCatchablePokemon method still returning 0 results
i updated api dependency to use the last version (0.3.4), but this method still return no results, i'm pretty sure in the location where i execute this methos there is many pokemons !
This is related to the closed issue : #486
Maybe i missed something to make it work again ?
Ok, this is strange maybe...but same code in eclipse works in android studio dont P.S. I used your fork
@FabianTerhorst How can you implement the SensorInfo part without using your pr? I am using reflection to set the values and all that but the only problem is setting the SensorInfo.
try {
SignatureOuterClass.Signature.SensorInfo sensorInfo = SignatureOuterClass.Signature.SensorInfo.newBuilder().build();
Field field = sensorInfo.getClass().getField("angleNormalizedZ_");
field.setAccessible(true);
field.setInt(sensorInfo, 0);
} catch (Exception e) {
e.printStackTrace();
}
@mackenziejgoodwin its merged now, you can use the latest commit.
@FabianTerhorst Despite the update I am still getting zero pokemon and zero pokestops...
Example:
List<CatchablePokemon> pokemons = getBot().getPokemonGo().getMap().getCatchablePokemon();
System.out.println(pokemons.size() + " Pokemon");
if (pokemons != null) {
if (pokemons.size() > 0) {
CatchablePokemon catchablePokemon = pokemons.get(0);
EncounterResult encounterResult = catchablePokemon.encounterPokemon();
if (encounterResult.getCaptureProbability().getCaptureProbabilityCount() <= Config.getCatchChanceUseRazzberry())
; //TODO use razzberrry
CatchResult catchResult = catchablePokemon.catchPokemon(Pokeball.POKEBALL);
if (catchResult.getStatus().equals(CatchPokemonResponseOuterClass.CatchPokemonResponse.CatchStatus.CATCH_SUCCESS)) {
System.out.println(Ansi.ansi().fg(Ansi.Color.GREEN).a("Caught a " + catchablePokemon.getPokemonId().name() + "!"));
} else {
System.out.println(Ansi.ansi().fg(Ansi.Color.GREEN).a("Error Catching pokemon " + catchablePokemon.getPokemonId().name() + "... Fled?"));
}
}
Walk.setLocation(this.getBot());
}
you setted the Default device infos?
@FabianTerhorst
DeviceInfo deviceInfo = DeviceInfo.DEFAULT;
pokemonGo.setDeviceInfo(deviceInfo);
SensorInfo sensorInfo = new SensorInfo();
sensorInfo.setAngleNormalizedZ(0);
pokemonGo.setSensorInfo(sensorInfo);
and without the sensorinfos, because im using for default now a ios device and i don´t know the sensor infos for ios.
looks like niantic requires more infos now, because at the morning i got catchable pokemon back now with the same request im only getting pokestops back
Im getting 1 back everytime when i change the location a little bit.
At this place there isn´t more then one so its ok.
@FabianTerhorst What is your location because no matter what location I set it returns 0. My Code: https://github.com/mackenziejgoodwin/PokemonGoBot/blob/master/src/main/java/com/pokemongobot/PokemonGoBot.java https://github.com/mackenziejgoodwin/PokemonGoBot/blob/master/src/main/java/com/pokemongobot/tasks/CatchPokemon.java
double lat = 48.847533008980086;
double lng = 2.3301315307617188;
go.setLocation(lat,lng, 0);
When you don´t get some back create a new account.
@FabianTerhorst I created a new account (found out my other account was softbanned) and it still doesn't find any pokemon or stops.
@mackenziejgoodwin you don´t even find 94 stops on the lat lng i provided and you are using 3g?
@FabianTerhorst Indeed. Here is some debug output...
System.out.println(pokemonGo.getMap().getMapObjects().toString());
MapObjects(nearbyPokemons=[], catchablePokemons=[], wildPokemons=[], decimatedSpawnPoints=[], spawnPoints=[], gyms=[], pokestops=[], complete=false, api=com.pokegoapi.api.PokemonGo@7f77e91b)
Appears to not see anything on the map... weird. It does pull the inventory properly though
List<Pokemon> s = pokemonGo.getInventories().getPokebank().getPokemons();
String t = "";
for(Pokemon pokemon : s) {
t += pokemon.getPokemonId().name();
}
System.out.println(t);
SQUIRTLE
Can you test 3g when not wait 24hours and try again could be a local ip ban.
@FabianTerhorst Made another account, tried using a proxy and changing ip, still nothing.
you tried the catch example?
@mackenziejgoodwin your MapObjects has complete=false thats why there is nothing near you. Try to debug your code to see when it is updated and when you are using it.
I tried to use the last sources of the library to test it, but when i import the jar to my project, i have this compile error :
Error:(58, 54) Gradle: error: cannot access MessageOrBuilder
class file for com.google.protobuf.MessageOrBuilder not found
Error:(60, 80) Gradle: error: cannot access GeneratedMessage
class file for com.google.protobuf.GeneratedMessage not found
I tried to add com.google.protobuf plugin to my gradle build file, but this not resolves my problem..