PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

catchablePokemon..encounterPokemon() allways FALSE

Open kilicool opened this issue 10 years ago • 9 comments

Hello,

My account is not banish. Pokemon Go still works.

I try my code few hours ago 2 or 3 times, it works. Since, no. Every pokemon encounter return false to the encounterPokemon() function.

Can someone help me ?

Regards

`PokemonGo go = new PokemonGo(new GoogleUserCredentialProvider(http, token), http);

        go.setLocation(X,Y, Math.random());

        List<CatchablePokemon> catchablePokemon = go.getMap().getCatchablePokemon();
        System.out.println("Pokemon : " + catchablePokemon.size());

        for (CatchablePokemon cp : catchablePokemon) {
            EncounterResult encResult = cp.encounterPokemon();
            if (encResult.wasSuccessful()) { // ALWAYS RETURN FALSE NOW
                System.out.println("Encounter: " + cp.getPokemonId());
                CatchOptions options = new CatchOptions(go);
                options.useRazzberries(false);
                CatchResult result = cp.catchPokemon(options);
                System.out.println("Try to catch : " + cp.getPokemonId() + " " + result.getStatus());
                try {
                    Random r = new Random();
                    int low = 5000;
                    int high = 10000;
                    int res = r.nextInt(high-low) + low;
                    new Thread().sleep(res);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        }

`

kilicool avatar Aug 25 '16 18:08 kilicool

That could be the temp ban that prevents capture. Try again in a few hours and report back if it doesn't resolve itself.

AbandonedCart avatar Aug 25 '16 18:08 AbandonedCart

I only use this code 2 or 3 times working and you think i'm already temp ban ? So what's the point ? What am I doing wrong ? Because i only use this in area near to my house

kilicool avatar Aug 25 '16 18:08 kilicool

Only things i always use a new token to make my program work. Could be from there ? I don't know how to do otherwise on a main Java class

kilicool avatar Aug 25 '16 18:08 kilicool

In a for loop, you still fire each encounter immediately, but the catch results are posted with a random sleep time. In theory, you could still be firing each catch result within 0 - 5000 MS of each other.

AbandonedCart avatar Aug 25 '16 18:08 AbandonedCart

Ok, better like this ? :

for (CatchablePokemon cp : catchablePokemon) { try { Random r = new Random(); int low = 5000; int high = 10000; int res = r.nextInt(high-low) + low; new Thread().sleep(res); } catch (InterruptedException e) { e.printStackTrace(); } EncounterResult encResult = cp.encounterPokemon(); if (encResult.wasSuccessful()) { System.out.println("Meet : " + cp.getPokemonId()); CatchOptions options = new CatchOptions(go); options.useRazzberries(false); CatchResult result = cp.catchPokemon(options); System.out.println("Try catch: " + cp.getPokemonId() + " " + result.getStatus()); try { Random r = new Random(); int low = 1000; int high = 5000; int res = r.nextInt(high-low) + low; new Thread().sleep(res); } catch (InterruptedException e) { e.printStackTrace(); } } }

Also how can i store the google authentification ?

kilicool avatar Aug 25 '16 19:08 kilicool

It now seems to works again. What are the precaution to take to not be ban ?

kilicool avatar Aug 25 '16 19:08 kilicool

I use my program this morning, first location it works, next, just above, it does not.

What's wrong ?

kilicool avatar Aug 26 '16 07:08 kilicool

Maybe don´t use a random for z?

FabianTerhorst avatar Aug 29 '16 13:08 FabianTerhorst

Is this still occurring? If it is, what does EncounterResult#getStatus return?

Gegy avatar Dec 18 '16 10:12 Gegy