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

ERROR: assert max(int(self.cp_exact), 10) == self.cp [inventory.py Line: 845] #4942

Closed
SiRoCu1976 opened this issue Aug 30, 2016 · 8 comments

Comments

@SiRoCu1976
Copy link

The error occur on only one my account(but can play on the game client as well), on the other account the BOT work fine. Can you help to solve this problem?
Thank you.

...sorry with my english :(

Expected Behavior

Actual Behavior

Your FULL config.json (remove your username, password, gmapkey and any other private info)

Output when issue occurred

Steps to Reproduce

Other Information

OS:

Branch:

Git Commit:

Python Version:

Any other relevant files/configs (eg: path files)

Short Description

Possible solution

How it would help others

@mjmadsen
Copy link
Contributor

We need your config, the terminal log, and teh commit branch. Completing the issue template is important.

@SiRoCu1976
Copy link
Author

I mean something wrong with contents in the trainer account. The pokemons or the items to make the only one account conflict with this bot. May be it crate a Null pointer or Nonetype of the statbase of the pokemon in class Pokemon() and then crashed.

Spec Info:
Linux CentOS 7.2
git clone -b master https://github.com/PokemonGoF/PokemonGo-Bot
Python 2.7.6

PS. All other 3 accounts work fine with this bot. (use the same config file but auth.json with each other)

======= Terminate log =======
(PokemonGo-Bot) [root@localhost PokemonGo-Bot]# ./run.sh
2016-08-30 21:36:28,710 [ cli] [INFO] PokemonGO Bot v1.0
2016-08-30 21:36:28,713 [ cli] [INFO] commit: 56339fb
2016-08-30 21:36:28,716 [ cli] [INFO] Configuration initialized
2016-08-30 21:36:28,716 [pokemongo_bot.health_record.bot_event] [INFO] Health check is enabled. For more information:
2016-08-30 21:36:28,716 [pokemongo_bot.health_record.bot_event] [INFO] https://github.com/PokemonGoF/PokemonGo-Bot/tree/dev#analytics
2016-08-30 21:36:28,722 [requests.packages.urllib3.connectionpool] [INFO] Starting new HTTP connection (1): www.google-analytics.com
[2016-08-30 21:36:28] [SleepSchedule] [INFO] [next_sleep] Next sleep at 2016-08-31 12:12:44.898704
[2016-08-30 21:36:29] [PokemonGoBot] [INFO] [set_start_location] Setting start location.
[2016-08-30 21:36:29] [PokemonGoBot] [INFO] [x] Coordinates found in passed in location, not geocoding.
[2016-08-30 21:36:29] [PokemonGoBot] [INFO] [location_found] Location found: 16.45837,102.828102 (16.45837, 102.828102, 8.0)
[2016-08-30 21:36:29] [PokemonGoBot] [INFO] [position_update] Now at (16.45837, 102.828102, 8.0)
[2016-08-30 21:36:29] [PokemonGoBot] [INFO] [login_started] Login procedure started.
[2016-08-30 21:36:32] [PokemonGoBot] [INFO] [login_successful] Login successful.
[2016-08-30 21:36:32] [PokemonGoBot] [INFO] Found encrypt.so! Platform: linux2 encrypt.so directory: /home/siwa/Poke/PokemonGo-Bot
[2016-08-30 21:36:32] [PokemonGoBot] [INFO]
[2016-08-30 21:36:34] [ cli] [INFO]
[2016-08-30 21:36:34] [ cli] [INFO] Ran for 0:00:06
[2016-08-30 21:36:34] [ cli] [INFO] Total XP Earned: 0 Average: 0.00/h
[2016-08-30 21:36:34] [ cli] [INFO] Travelled 0.00km
[2016-08-30 21:36:34] [ cli] [INFO] Visited 0 stops
[2016-08-30 21:36:34] [ cli] [INFO] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before ()
[2016-08-30 21:36:34] [ cli] [INFO] Threw 0 pokeballs
[2016-08-30 21:36:34] [ cli] [INFO] Earned 0 Stardust
[2016-08-30 21:36:34] [ cli] [INFO] Hatched eggs 0
[2016-08-30 21:36:34] [ cli] [INFO]
[2016-08-30 21:36:34] [ cli] [INFO] Highest CP Pokemon:
[2016-08-30 21:36:34] [ cli] [INFO] Most Perfect Pokemon:
Traceback (most recent call last):
File "pokecli.py", line 768, in
main()
File "pokecli.py", line 119, in main
bot = start_bot(bot,config)
File "pokecli.py", line 86, in start_bot
bot.start()
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/init.py", line 127, in start
init_inventory(self)
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1273, in init_inventory
_inventory = Inventory(bot)
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1111, in init
self.refresh()
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1119, in refresh
i.refresh(inventory)
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 72, in refresh
self._data = self.retrieve_data(inventory)
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 68, in retrieve_data
ret[key] = self.parse(item)
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 343, in parse
return Pokemon(item)
File "/home/siwa/Poke/PokemonGo-Bot/pokemongo_bot/inventory.py", line 845, in init
assert max(int(self.cp_exact), 10) == self.cp
AssertionError

[2016-08-30 21:36:34] [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/)

Regrad

Mr. Siwa Runwat
Computer Enginer of Khonkaen University in Thailand

@mjmadsen
Copy link
Contributor

Is this account a fresh account (no exp) and the others not by any chance?

@SiRoCu1976
Copy link
Author

No. It's level 30 and 70k+ exp.
I use this bot since level 1 to now (level 30) utill I can't login bot today.

@gungoan
Copy link

gungoan commented Aug 30, 2016

Your account or IP banned from niantic

@SiRoCu1976
Copy link
Author

@gungoan
No. I am playing on the mobile client now.

@mjmadsen
I've just found a temporary fix for this. Just comment out some code of Pokemon class in inventory.py file.

=================== inventory.py =================
class Pokemon(object):
...
...
# Exact value of current CP (not rounded)
self.cp_exact = 0 <------ Add this line
##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

And now it can work. Lol
I'm waiting for the author to fix this.

@mjmadsen
Copy link
Contributor

@SiRoCu1976 I'm headed to bed. Hopefully one of the other devs and see a fix. I'm glad you got it going in the mean time.

@mjmadsen
Copy link
Contributor

mjmadsen commented Sep 4, 2016

@SiRoCu1976 Still having problems?

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

No branches or pull requests

4 participants