tehp / OpenPoGoBot

A PokemonGo Python bot - NO LONGER MAINTAINED
MIT License
123 stars 53 forks source link

Location in config.yml file throws error. #321

Closed ch333 closed 8 years ago

ch333 commented 8 years ago

Expected Behavior

Start at passed in location.

Actual Behavior

Traceback (most recent call last): File "pokecli.py", line 93, in main() File "pokecli.py", line 81, in main bot.start() File "/Users/challstrom/Desktop/POGO/OpenPoGoBot/pokemongo_bot/init.py", line 73, in start self._setup_api() File "/Users/challstrom/Desktop/POGO/OpenPoGoBot/pokemongo_bot/init.py", line 158, in _setup_api self._set_starting_position() File "/Users/challstrom/Desktop/POGO/OpenPoGoBot/pokemongo_bot/init.py", line 272, in _set_starting_position self._read_config_location() File "/Users/challstrom/Desktop/POGO/OpenPoGoBot/pokemongo_bot/init.py", line 278, in _read_config_location self.position = self._get_pos_by_name(self.config["mapping"]["location_cache"]) File "/Users/challstrom/Desktop/POGO/OpenPoGoBot/pokemongo_bot/init.py", line 285, in _get_pos_by_name if location_name.count(',') == 1: AttributeError: 'bool' object has no attribute 'count'

Steps to Reproduce

Run bot with passed in location and cached_location: false

Other Information

OS: OSX Git Commit: Master - latest

ch333 commented 8 years ago

Changing "location_cache" to "location" in lines 287 and 281 of OpenPoGoBot/pokemongo_bot/init.py fixes this.

The correct code. def _read_config_location(self): self.position = self._get_pos_by_name(self.config["mapping"]["location"]) self.api_wrapper.set_position(*self.position) logger.log('') logger.log(u'[x] Address found: {}'.format(self.config["mapping"]["location"]))