PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

object has no attribute 'position'

Open banksymate opened this issue 10 years ago • 15 comments

Expected Behavior

Bot runs

Actual Behavior

Crashes, LOG: [2016-07-26 21:10:56] [x] PokemonGO Bot v1.0 [2016-07-26 21:10:56] [x] Configuration initialized [2016-07-26 21:10:57] [x] The location given using -l could not be parsed. Checking for a cached location. [2016-07-26 21:11:13] [#] Username: x [2016-07-26 21:11:13] [#] Acccount Creation: x [2016-07-26 21:11:13] [#] Bag Storage: x [2016-07-26 21:11:13] [#] Pokemon Storage: x [2016-07-26 21:11:13] [#] Stardust: x [2016-07-26 21:11:13] [#] Pokecoins: 0 [2016-07-26 21:11:13] [#] PokeBalls: 10 [2016-07-26 21:11:13] [#] GreatBalls: x [2016-07-26 21:11:13] [#] UltraBalls: x [2016-07-26 21:11:13] [#] -- Level: x [2016-07-26 21:11:13] [#] -- Experience: x [2016-07-26 21:11:13] [#] -- Experience until next level: x [2016-07-26 21:11:13] [#] -- Pokemon Captured: x [2016-07-26 21:11:13] [#] -- Pokestops Visited: x [2016-07-26 21:11:13] [#] Traceback (most recent call last): File "pokecli.py", line 220, in main() File "pokecli.py", line 206, in main bot.start() File "/root/pgo/PokemonGo-Bot/pokemongo_bot/init.py", line 32, in start self.stepper = Stepper(self) File "/root/pgo/PokemonGo-Bot/pokemongo_bot/stepper.py", line 32, in init self.origin_lat = self.bot.position[0] AttributeError: 'PokemonGoBot' object has no attribute 'position'

Config: { "auth_service": "ptc", "username": "x", "password": "x", "location": "45.5231,-122.6765", // PORTLAND, OR "gmapkey": "x", "max_steps": 5, "mode": "all", "walk": 4.16, "debug": false, "test": false, "initial_transfer": 0, "location_cache": true, "distance_unit": "km", "item_filter": "101,102,103,104", "evolve_all": "NONE" }

Console Args: python pokecli.py

Steps to Reproduce

Running it on my server.

Other Information

OS: Ubuntu Server 14.04 Git Commit: 893483778366075aa9f3b80e090b448088439b93

banksymate avatar Jul 27 '16 02:07 banksymate

Replaced sensitive info with 'x' to prevent being banned.

banksymate avatar Jul 27 '16 02:07 banksymate

same issue.

EDIT: I found out that this issue appears if I'm using "minus" coordinates (45.5231,-122.6765)

OS: OSX 10.11.5

DimaVIII avatar Jul 27 '16 02:07 DimaVIII

Happened to me with both positive and negative coordinates. @DimaVIII

banksymate avatar Jul 27 '16 02:07 banksymate

Same position with dev build returns: [21:49:37] [x] The location given using -l could not be parsed. Checking for a cached location. [21:49:37] [x] Parsing cached location... No cached Location. Please specify initial location.

banksymate avatar Jul 27 '16 02:07 banksymate

@banksymate If I add a positive location the script is not crashing but it stuck here: [2016-07-27 05:10:30] [x] Starting PokemonGo Bot.... [2016-07-27 05:10:30] [#] Scanning area for objects (1 / 25) [2016-07-27 04:49:34] [#] Walking from (2.6e-322, 5e-323) to (53.551472, 10.002872) for approx. 1448531.00 seconds

DimaVIII avatar Jul 27 '16 03:07 DimaVIII

@DimaVIII What location are you using in your config, I want to see if it works for me.

banksymate avatar Jul 27 '16 03:07 banksymate

Getting this too. 37.7915833,-122.3921887 crashes, but 37.7915833,122.3921887 does not. I'm happy to take a peak.

klvs avatar Jul 27 '16 03:07 klvs

@banksymate MY Config:

"location": "53.551472,10.002872", "gmapkey": "", "max_steps": 5, "mode": "all", "walk": 4.16, "debug": false, "test": false, "initial_transfer": 0, "location_cache": true, "distance_unit": "km", "item_filter": "101,102,103,104", "evolve_all": ""

DimaVIII avatar Jul 27 '16 03:07 DimaVIII

@klvs @DimaVIII both of your coordinates work fine for me in the dev branch, so confirming it's if you have a negative coordinate.

edit: both your positive coordinates that is

banksymate avatar Jul 27 '16 03:07 banksymate

Removed the try \ catch so I could get a error, this is what I got.

Traceback (most recent call last): File "pokecli.py", line 283, in main() File "pokecli.py", line 243, in main bot.start() File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/init.py", line 39, in start self._setup_api() File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/init.py", line 284, in _setup_api self._set_starting_position() File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/init.py", line 450, in _set_starting_position location = (self._get_pos_by_name(location_str.replace(" ", ""))) File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/init.py", line 502, in _get_pos_by_name loc = geolocator.geocode(location_name, timeout=10) File "/usr/local/lib/python2.7/dist-packages/geopy/geocoders/googlev3.py", line 217, in geocode self._call_geocoder(url, timeout=timeout), exactly_one File "/usr/local/lib/python2.7/dist-packages/geopy/geocoders/googlev3.py", line 338, in _parse_json self._check_status(page.get('status')) File "/usr/local/lib/python2.7/dist-packages/geopy/geocoders/googlev3.py", line 369, in _check_status 'Your request was denied.' geopy.exc.GeocoderQueryError: Your request was denied.

banksymate avatar Jul 27 '16 03:07 banksymate

        possibleCoordinates = re.findall("[-]?\d{1,3}[.]\d{6,7}", location_name)

Maybe this regex isn't finding the coordinates with negatives correctly? It shouldn't be using googles Geocoder otherwise.

banksymate avatar Jul 27 '16 03:07 banksymate

Yes I can confirm this too, the issue is coming from the negative coordinates. I just installed the dev branch, here it works for me with negative coordinates.

DimaVIII avatar Jul 27 '16 03:07 DimaVIII

Dev branch doesn't work with negative coordinates for me.

banksymate avatar Jul 27 '16 03:07 banksymate

I can confirm this issue for current master branch.

argo2445 avatar Jul 27 '16 05:07 argo2445

Found out the issue was a entered 'ß' in location in master branch. This was no problem in older builds.

argo2445 avatar Jul 27 '16 05:07 argo2445