rubenvereecken / pokemongo-api

Pokemon Go API for Python
Other
358 stars 120 forks source link

Change Trainer.setEggs() to put best eggs in all available incubators. #94

Closed jmaygarden closed 8 years ago

jmaygarden commented 8 years ago

The current code tries to put the first egg in the list in the first incubator in the list without regard to (a) the egg already being in an incubator or (b) the incubator already containing an egg. Additionally, the current code will only place a single egg in a single incubator in the best case. This change utilizes all empty incubators and prioritizes eggs that are not already in an incubator based on distance (i.e. 10km > 5km >2km).

dnsBlah commented 8 years ago

i rather sort the eggs in timestamp and incubate in order i gathered then

jmaygarden commented 8 years ago

That could be done as well. Is there an advantage to either method?

dnsBlah commented 8 years ago

no? 😆 i just like to have the bot play as i play always wanna get rid of the eggs when i get then

jmaygarden commented 8 years ago

How about I change it to take a sort key as a parameter and default to not sorting?

dnsBlah commented 8 years ago

why you need a sort key then just follow the order which comes from your inventory