PokemonGo-Bot: The bot is releasing pokemons that shouldn't be released.

Expected Behavior

The bot shouldn’t release duplicate pokemons when CP/IV is set to 0.

Actual Behavior

If CP/IV is set to 0, the bot still releases the pokemons.

Recently the bot released all my Vaporeons, Flareons and Jolteons, even though I configured it not to. http://prntscr.com/bycq14

Steps to Reproduce

Navigate to configs/ and modify the config.json file. Add this to your configuration file:

          "Vaporeon": { "release_below_cp": 0, "release_below_iv": 0, "logic": "and" },
          "Jolteon": { "release_below_cp": 0, "release_below_iv": 0, "logic": "and" },
          "Flareon": { "release_below_cp": 0, "release_below_iv": 0, "logic": "and" },

Other Information

OS: Ubuntu, 14.04 Git Commit: 15a034427d805e0bacb79fc0a1f3c96a6c93f0e3

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 36 (34 by maintainers)

Most upvoted comments

The whole code is clear:

release_results = {
            'cp': False,
            'iv': False,
        }

        if release_config.get('never_release', False):
            return False

        if release_config.get('always_release', False):
            return True

        release_cp = release_config.get('release_below_cp', 0)
        if cp < release_cp:
            release_results['cp'] = True

        release_iv = release_config.get('release_below_iv', 0)
        if iv < release_iv:
            release_results['iv'] = True

        logic_to_function = {
            'or': lambda x, y: x or y,
            'and': lambda x, y: x and y
        }

        return logic_to_function[cp_iv_logic](*release_results.values())