AttributeError: 'PokemonGoBot' object has no attribute 'position'
Expected Behavior
Bot runs
Actual Behavior
[2016-07-30 17:53:40] [x] PokemonGO Bot v1.0
[2016-07-30 17:53:40] [x] Configuration initialized
[2016-07-30 17:53:40] [x] The location given using -l could not be parsed. Checking for a cached location.
[2016-07-30 17:53:44] [#] x
[2016-07-30 17:53:44] [#] x
[2016-07-30 17:53:45] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#] x
[2016-07-30 17:53:46] [#]
Traceback (most recent call last):
File "pokecli.py", line 220, in
My Configuration
{ "auth_service": "google", "username": "x", "password": "x", "location": "40.762723, 14.025207", "gmapkey": "xxx", "max_steps": 5, "mode": "all", "walk": 10, "catch_pokemon": true, "debug": false, "test": false, "initial_transfer": 0, "location_cache": true, "distance_unit": "km", "item_filter": "101,102,103,104", "evolve_all": "NONE", "softban_fix": true }
Steps to Reproduce
Running it on my server.
Other Information
OS: Arch Linux // GNOME 3 Git Commit: 55390cfd7fcedace99c2c3d372b3790ef5b7cfd7
changing "location": "40.762723, 14.025207", to "location": "40.762723,14.025207", (removing the space) might fix this
I have the same error with the latest master branch .
The error is inpokemongo_bot/__init__.py. The code to parse a lat/lon is incorrectly hard set to 6/7 decimal places, bombing if you have any less or more. The below code changes it to 4-7 places, which if you search for a location in Google, it reports only 4 significant figures of decimal degrees. In reality, it should be set to any number with an optional decimal.
diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py
index 6dc13bb..f5eb002 100644
--- a/pokemongo_bot/__init__.py
+++ b/pokemongo_bot/__init__.py
@@ -333,7 +333,7 @@ class PokemonGoBot(object):
def _get_pos_by_name(self, location_name):
# Check if the given location is already a coordinate.
if ',' in location_name:
- possibleCoordinates = re.findall("[-]?\d{1,3}[.]\d{6,7}", location_name)
+ possibleCoordinates = re.findall("[-]?\d{1,3}[.]\d{4,7}", location_name)
if len(possibleCoordinates) == 2:
# 2 matches, this must be a coordinate. We'll bypass the Google geocode so we keep the exact location.
logger.log(
go to the slack chatroom then in #help someone will help you setup the bot correctly closed: NOT A BUG
@gregtampa, I disagree. There is no requirement that lat/lons have any specific number of decimal degrees, which the regexp requires. There are no comments or documentation that state this 6/7 decimal degrees requirement, and Google returns 4 decimal places which means you will have many reported bugs with this.
It should match with or without decimal degrees with no requirement of min/max, and, in addition, bug #1854 means that this input and regexp should be changed to allow altitude anyway. Please reconsider this bugs status.
Recommend a fix for an embedded json for location which has: location name, and lat/lon/altitude, documenting which one is prioritized.