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

unsupported operand type(s) for -: 'NoneType' and 'NoneType' #2863

Closed
mooseknuckleking opened this issue Aug 7, 2016 · 3 comments
Closed

Comments

@mooseknuckleking
Copy link

It seems like whenever the bot tries to complete an action, like spinning a pokestop, it runs into this error. My bot only runs for about 8-11 seconds total each time.

016-08-07 10:19:24,084 [PokemonGoBot] [INFO]
2016-08-07 10:19:24,084 [PokemonGoBot] [INFO]
2016-08-07 10:19:31,577 [ cli] [INFO]
2016-08-07 10:19:31,577 [ cli] [INFO] Ran for 0:00:11
Traceback (most recent call last):
File "pokecli.py", line 493, in
main()
File "pokecli.py", line 127, in main
report_summary(bot)
File "pokecli.py", line 139, in report_summary
logger.info('Total XP Earned: {} Average: {:.2f}/h'.format(metrics.xp_earned(), metrics.xp_per_hour()))
File "/Users/trevor/PokemonGo-Bot/pokemongo_bot/metrics.py", line 28, in xp_earned
return self.xp['latest'] - self.xp['start']
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

@ti0ma
Copy link

ti0ma commented Aug 8, 2016

I fixed it by putting some type checks: https://gist.github.com/ti0ma/2e906029ebe39d4f246f7d5f0596fd5c

and commented the line 145 at pokecli.py

I also had this error: "The EvolveAll task has been renamed to EvolvePokemon" after fixing the above errors, so I changed the task in my config file.

All this is a quick fix, while waiting for a fix :)

@k4n30
Copy link
Contributor

k4n30 commented Aug 12, 2016

@fence1247 can you update to the latest version and indicate if this is still an issue

@k4n30
Copy link
Contributor

k4n30 commented Aug 13, 2016

Duplicate of #2596

@k4n30 k4n30 closed this as completed Aug 13, 2016
hoanghuynh pushed a commit to hoanghuynh/PokemonGo-Bot that referenced this issue Sep 28, 2016
* Re-enable the w1202 check

* Use log() interpolation instead of format()

* Fix indentation level

* Remove overly verbose logging

* W1202 rule fixup

* Trailing whitespace removal

* Remove overly verbose debugs in translation module; format if in double lines

* Fix log format to fit better and be more matching

* Log connection attempt before doing so; makes error flow clearer

* Log lines are not english prose, remove tailing periods

* "clearing database" should have an info level logline

* Quote mark consistency

* Bad quote inversion
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

3 participants