PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Evolutions are happening without lucky eggs

Open pacpac42 opened this issue 10 years ago • 3 comments

Expected Behavior

Evolutions should only happen when lucky egg is activated

Actual Behavior

Evolving is skipped at first tick, but happens on subsequent ticks

2016-08-12 05:26:07,339 [PokemonGoBot] [INFO] [bot_start] Starting bot...
2016-08-12 05:26:08,747 [CollectLevelUpReward] [INFO] [level_up_reward] Received level up reward: []
2016-08-12 05:26:08,748 [IncubateEggs] [INFO] [next_egg_incubates] Next egg incubates in 1.10 km
...
2016-08-12 05:26:14,292 [EvolvePokemon] [INFO] [skip_evolve] Skipping evolve because has no lucky egg.
...
2016-08-12 05:26:49,555 [EvolvePokemon] [INFO] [pokemon_evolved] Successfully evolved Spearow with CP 46 and IV 0.67!
2016-08-12 05:27:13,232 [EvolvePokemon] [INFO] [pokemon_evolved] Successfully evolved Spearow with CP 332 and IV 0.58!

Your config.json (remove your credentials and any other private info)

See below

Steps to Reproduce

Have no lucky eggs in inventory and set "use_lucky_egg": true in config.json

Other Information

OS: Mac OS X El Capitan Version 10.11.6 Git Commit: 49f9177ef4226a6a69499d7afc1fb24e5c72fc50 Python Version: Python 2.7.12

Suggested Fix

Put this at the top of _should_run

    def _should_run(self):
        if not self.evolve_all or self.evolve_all[0] == 'none':
            return False

        lucky_egg_count = self.bot.item_inventory_count(Item.ITEM_LUCKY_EGG.value)

        if self.use_lucky_egg and ((self.bot.tick_count is 1 and not lucky_egg_count > 0) or (self.bot.tick_count is not 1 and <lucky egg is not activated>)) :
            return False

        # Evolve all is used - Use Lucky egg only at the first tick
        if self.bot.tick_count is not 1 or not self.use_lucky_egg:
            return True

Seems like there needs to be a timer attached to lucky egg too, to check if it's still on.

pacpac42 avatar Aug 12 '16 09:08 pacpac42

there is an error in the latest dev version 2016-08-12 10:05:45,651 [EvolvePokemon] [ERROR] [lucky_egg_error] Failed to use lucky egg!

bruvv avatar Aug 12 '16 10:08 bruvv

@pacpac42 & @nivong has this been resolved?

k4n30 avatar Aug 16 '16 12:08 k4n30

I didn't have time to to any debugging. Just close it for now. If I find something more I will reference this issue and do some debugging

bruvv avatar Aug 16 '16 18:08 bruvv