GithubHelp home page GithubHelp logo

Comments (23)

jangeja avatar jangeja commented on June 23, 2024

Need to increase radius of get map objects call to 1000

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

@jmangeja1 to 1000 !?
Even on 10 I find 196 pokestops, how can that radius be too low for decent pokemons ? 👯

Any idea about my 're-using' mapobjects issue? Looks like I can't re-use it at all, as it appears empty by then :S

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah I actually haven't used this Ali, but if you look at keyphacts phosphine you'll see they use 1000 as the radius

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

Sorry my spelling is awful. I'm on an iPhone. Ali= API
Phosphine = pygo api

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

hmmm I will have a look in that later then
dont worry, same thing here ;-)

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

I do see a limit of 100 there, going to give it a try :)
With laods of delays I'm already getting more results.

Still an issue when re-using mapobjects like this:

aCells = getMapObjects(session)
pokemons = getPokemonsNearby(session, aCells)
for pokemon in pokemons:
    #looping here
pokeForts = getPokeFortsNearby(session,aCells)
#from here aCells is empty! :-/

getPokemonsNearby and getPokeFortsNearby look like this:

#get pokemons
def getPokemonsNearby(session, cells):
    tPokemons = []
    latitude, longitude, _ = session.getCoordinates()
    for cell in cells.map_cells:
        pokemons = [p for p in cell.wild_pokemons] + [p for p in cell.catchable_pokemons]
        for pokemon in pokemons:
            dist = Location.getDistance(
                latitude,
                longitude,
                pokemon.latitude,
                pokemon.longitude
            )
            tPokemons.append({'distance': dist, 'pokemon': pokemon})

    if len(tPokemons) == 0:
        cells = getMapObjects(session, 10)
        for cell in cells.map_cells:
            pokemons = [p for p in cell.wild_pokemons] + [p for p in cell.catchable_pokemons]
            for pokemon in pokemons:
                dist = Location.getDistance(
                    latitude,
                    longitude,
                    pokemon.latitude,
                    pokemon.longitude
                )
                tPokemons.append({'distance': dist, 'pokemon': pokemon})

    tPokemons = sorted(tPokemons, key=lambda k: k['distance'])

    return [instance['pokemon'] for instance in tPokemons]

#get forts (pokestops and gyms)
def getPokeFortsNearby(session, cells):    
    ordered_forts = []
    latitude, longitude, _ = session.getCoordinates()
    for cell in cells.map_cells:
        for fort in cell.forts:
            dist = Location.getDistance(
                latitude,
                longitude,
                fort.latitude,
                fort.longitude
            )
            if fort.type == 1:
                if fort.cooldown_complete_timestamp_ms<time.time():
                    ordered_forts.append({'distance': dist, 'fort': fort})
            else:
                ordered_forts.append({'distance': dist, 'fort': fort})

    ordered_forts = sorted(ordered_forts, key=lambda k: k['distance'])

    return [instance['fort'] for instance in ordered_forts]

As far as I know, I'm not getting 'new' mapObjects, just trying to re-use the mapobjects i retrieved earlier.
Any idea?

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah. Yea, you can only scan a short distance for Pokemon so not many will show up. I recommend implementing a mapping tool and incorporating that in your program

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

@jmangeja1 Yes I gathered that one :)
I also think there will be a proto update soon related to pokemons nearby, as its back in the game

Anyways yet I don't understand the second part

I retrieve map objects and store it in a variable (aCells)
when I print that variable, I see forts and pokemons
Now I'm using this variable to filter out pokemons and store it in another variable (pokemons)
i loop through them, walk and catch
when finished I use the aCells to filter out the forts
and store it pokeForts
but pokeForts got empty!?

If I print aCells after the pokemon loop
the aCells got empty cells
I haven't rechecked mapobjects yet
Why is it empty?

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah I'm learning N as I go with this app, but what do you mean there has been an update to pokemons nearby in the game?

Regarding your second question as to why the Acells empty... Are you modifying acells as you loop through Pokemon?

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah let me read your source code posted above.

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah in function getnearbypokemons look at the line cells= getmapobjects(radius =10) that's clearing acells because radius is only 10 and its overwriting acells

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

actually I don't think that should affect it

from pokemongo-api.

Jefreesujit avatar Jefreesujit commented on June 23, 2024

could someone tell me where to place this libencrypt.so

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

Place it in same directory as the python program that you are running or edit path to include it

from pokemongo-api.

Jefreesujit avatar Jefreesujit commented on June 23, 2024

still it says no forts found.. what could be the problem?

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

Did you download correct version? I actually don't use this Ali. I use keyphacts edited pgoapi

from pokemongo-api.

Jefreesujit avatar Jefreesujit commented on June 23, 2024

i just downloaded it.. its the latest one

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

Hi @jmangeja1 ,

thanks for your time, but I only do
cells = getMapObjects(session, 10)
When I don't see any pokemons. Just for the... you know, maybe there are a few in the area where I am at that moment, instead of the area where I scanned aCells
Next to that, it will be stored as 'cells', and not 'aCells' as I pass it to the location :)

And if radius 10 is too low, I even put it on 9 now. As it gives me more often results without multiple loops and sleep times.
[ ] Found 147 Forts nearby
*** These are pokestops AND gyms ofcourse.

pgoapi / kryphacts are using radius in meters I guess.
But indeed, I'm also only getting empty cells there.

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

@dnsBlah that line is called when you don't find any Pokemon so it might be clearing out the cells variable. I would test that. Take out that getmapcells call inside the get pokemonsnearby and see if that works. I think that's why your forts are empty

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

@jmangeja1 is it possible by calling getmapobjects to return to a variable named cells inside pokemonsnearby function, to overwrite an older variable named aCells, which is even outside that function, and without mentioning it to be global at the beginning of pokemonsnearby function?

Then it's time to stop doing python...

Maybe its a bug/'unsolved feature' from proto's ? They work in 'memory/cache' ? Is getmapobjects stored in something like 'cache' instead of the variable I defined?

from pokemongo-api.

jangeja avatar jangeja commented on June 23, 2024

I would google a little but on Python pass by object reference. This is the explanation of how Python passes arguments in functions. From what I can remember a cells should be unaffected once you reassign something in a function. So I'm not sure why you're cells are being cleared out.

from pokemongo-api.

dnsBlah avatar dnsBlah commented on June 23, 2024

It's ok for now.. with my workaround with threshold delays
Still, I find it weird that it hardly sees any.

from pokemongo-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.