Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This line fails: assert max(int(self.cp_exact), 10) == self.cp #5830

Closed
Admdebian opened this issue Nov 21, 2016 · 8 comments
Closed

This line fails: assert max(int(self.cp_exact), 10) == self.cp #5830

Admdebian opened this issue Nov 21, 2016 · 8 comments

Comments

@Admdebian
Copy link

I found an assertion error.

The file is:
pokemongo_bot/inventory.py

The line is:
991

` # Exact value of current CP (not rounded)

    self.cp_exact = _calc_cp(
        base_attack, base_defense, base_stamina,
        self.iv_attack, self.iv_defense, self.iv_stamina, self.cp_m)
    #assert max(int(self.cp_exact), 10) == self.cp

    # Percent of maximum possible CP
    self.cp_percent = self.cp_exact / self.static.max_cp

`

If I comment the line, the bot works.

This issue is very similar but the solution is different:
#4942

@xty
Copy link
Contributor

xty commented Nov 21, 2016

Same here. Below is the output when I tried to run the bot without commenting the line in question:

2016-11-22 04:12:25,241 [       cli] [INFO] PokemonGO Bot v1.0
2016-11-22 04:12:25,244 [       cli] [INFO] commit: 979fb4d8
2016-11-22 04:12:25,247 [       cli] [INFO] Configuration initialized
[2016-11-22 04:12:25] [PokemonGoBot] [INFO] Setting start location.
[2016-11-22 04:12:25] [PokemonGoBot] [INFO] [x] Coordinates found in passed in location, not geocoding.
[2016-11-22 04:12:25] [PokemonGoBot] [INFO] Location found: 38.423287,141.306736 (38.423287, 141.306736, 8.0)
[2016-11-22 04:12:25] [PokemonGoBot] [INFO] Now at (38.423287, 141.306736, 8.0)
[2016-11-22 04:12:25] [PokemonGoBot] [INFO] Login procedure started.
[2016-11-22 04:12:28] [PokemonGoBot] [INFO] Login successful.
[2016-11-22 04:12:28] [PokemonGoBot] [INFO] 
_inventory was not initialized
_inventory was not initialized
[2016-11-22 04:12:29] [       cli] [INFO] 
[2016-11-22 04:12:29] [       cli] [INFO] Ran for 0:00:04
[2016-11-22 04:12:29] [       cli] [INFO] Total XP Earned: 0  Average: 0.00/h
[2016-11-22 04:12:29] [       cli] [INFO] Travelled 0.00km
[2016-11-22 04:12:29] [       cli] [INFO] Visited 0 stops
[2016-11-22 04:12:29] [       cli] [INFO] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before ()
[2016-11-22 04:12:29] [       cli] [INFO] Threw 0 pokeballs
[2016-11-22 04:12:29] [       cli] [INFO] Earned 0 Stardust
[2016-11-22 04:12:29] [       cli] [INFO] Hatched eggs 0
[2016-11-22 04:12:29] [       cli] [INFO] 
[2016-11-22 04:12:29] [       cli] [INFO] Highest CP Pokemon: 
[2016-11-22 04:12:29] [       cli] [INFO] Most Perfect Pokemon: 
Traceback (most recent call last):
  File "pokecli.py", line 846, in <module>
    main()
  File "pokecli.py", line 194, in main
    bot = start_bot(bot, config)
  File "pokecli.py", line 146, in start_bot
    bot.start()
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/__init__.py", line 149, in start
    init_inventory(self)
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1416, in init_inventory
    _inventory = Inventory(bot)
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1260, in __init__
    self.refresh()
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1270, in refresh
    i.refresh(inventory)
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 75, in refresh
    self._data = self.retrieve_data(inventory)
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 71, in retrieve_data
    ret[key] = self.parse(item)
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 490, in parse
    return Pokemon(item)
  File "/home/tx/Downloads/PokemonGo-Bot/pokemongo_bot/inventory.py", line 991, in __init__
    assert max(int(self.cp_exact), 10) == self.cp
AssertionError
Tue 22 Nov 04:12:29 CST 2016 Pokebot  Stopped.
Press any button or wait 20 seconds to continue.

@SiyuanQi-zz
Copy link

SiyuanQi-zz commented Nov 21, 2016

Same error occurred:

[2016-11-21 12:17:27] [       cli] [INFO] Most Perfect Pokemon: 
Traceback (most recent call last):
  File "pokecli.py", line 846, in <module>
    main()
  File "pokecli.py", line 194, in main
    bot = start_bot(bot, config)
  File "pokecli.py", line 146, in start_bot
    bot.start()
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/__init__.py", line 149, in start
    init_inventory(self)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1416, in init_inventory
    _inventory = Inventory(bot)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1260, in __init__
    self.refresh()
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1270, in refresh
    i.refresh(inventory)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 75, in refresh
    self._data = self.retrieve_data(inventory)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 71, in retrieve_data
    ret[key] = self.parse(item)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 490, in parse
    return Pokemon(item)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/pokemongo_bot/inventory.py", line 991, in __init__
    assert max(int(self.cp_exact), 10) == self.cp
AssertionError
[2016-11-21 12:17:27] [sentry.errors] [ERROR] Sentry responded with an error: 'module' object has no attribute 'HTTPSHandler' (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/home/siyuan/Downloads/test/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 44, in urlopen
    class ValidHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'
[2016-11-21 12:17:27] [sentry.errors.uncaught] [ERROR] [u'AssertionError', u'  File "pokecli.py", line 846, in <module>', u'  File "pokecli.py", line 194, in main', u'  File "pokecli.py", line 146, in start_bot', u'  File "pokemongo_bot/__init__.py", line 149, in start', u'  File "pokemongo_bot/inventory.py", line 1416, in init_inventory', u'  File "pokemongo_bot/inventory.py", line 1260, in __init__', u'  File "pokemongo_bot/inventory.py", line 1270, in refresh', u'  File "pokemongo_bot/inventory.py", line 75, in refresh', u'  File "pokemongo_bot/inventory.py", line 71, in retrieve_data', u'  File "pokemongo_bot/inventory.py", line 490, in parse', u'  File "pokemongo_bot/inventory.py", line 991, in __init__']
Mon Nov 21 12:17:27 PST 2016 Pokebot  Stopped.
Press any button or wait 20 seconds to continue.

After commenting out the assertion, the bot runs. But it is not moving anywhere.

@Admdebian
Copy link
Author

Niantic said they changed pokemon points:

Alakazam(+++), Aerodactyl, Beedrill, Butterfree, Chansey, Charizard(+), Cloyster, Dodrio(++), Dragonite(+), Electabuzz, Electrode, Flareon, Hitmonlee, Gengar, Golem(+++), Gydrados, Jolteon(+++), Jynx, Kabutops, Kangaskhans, Kingler(+++), Machamp(+++), Magneton, Mr. Mime, Muk, Omastar, Onix, Pinsir, Pidgeot, Primeape, Raichu, Rapidash(+), Rhydon, Sandslash, Scyther(++), Snorlax, Starmie, Tangela, Tauros, Tentacruel, Vaporeon, Venomoth(++)

Arcanine, Blastoise, Clefable, Dewgong, Exeggutor, Goldbat(-), Golduck, Hypno, Lickitung(--), Nidoking, Nidoqueen, Ninetails(--), Parasect, Poliwrath, Porygon, Seadra, Slowbro(-), Venusaur, Victreebell, Vileplume, Wigglytuff(---)

@Jcolomar
Copy link
Contributor

Dont run bot. Niantic updated api to 0.47. Hash and crypt libraries will be updated when devs end crack new api

@cierzniak
Copy link

So is it safe to play now?

@Jcolomar
Copy link
Contributor

No

@camnomis
Copy link

camnomis commented Nov 22, 2016

I commented out the assertion and the bot runs, although the API may be an issue they have not pulled the old API as they did last time, yet!

Will spin up a new account and see what happens

@nachi9211
Copy link

Commenting out assertion worked, however captcha magnemite is getting more frequent by the hour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants