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

object has no attribute 'position' #1102

Closed
banksymate opened this issue Jul 27, 2016 · 15 comments
Closed

object has no attribute 'position' #1102

banksymate opened this issue Jul 27, 2016 · 15 comments

Comments

@banksymate
Copy link

banksymate commented Jul 27, 2016

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: 8934837

@banksymate
Copy link
Author

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

@DimaVIII
Copy link

DimaVIII commented Jul 27, 2016

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

@banksymate
Copy link
Author

banksymate commented Jul 27, 2016

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

@banksymate
Copy link
Author

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.

@DimaVIII
Copy link

@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

@banksymate
Copy link
Author

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

@klvs
Copy link

klvs commented Jul 27, 2016

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

@DimaVIII
Copy link

@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": ""

@banksymate
Copy link
Author

banksymate commented Jul 27, 2016

@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
Copy link
Author

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
Copy link
Author

        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.

@DimaVIII
Copy link

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.

@banksymate
Copy link
Author

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

@argo2445
Copy link

I can confirm this issue for current master branch.

@argo2445
Copy link

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

hoanghuynh pushed a commit to hoanghuynh/PokemonGo-Bot that referenced this issue Sep 28, 2016
* Add ability to show scanned area's on the map

* Only send scans from the last 15 minutes to the map

* Hide Scanned Location Info Window

* Fix broken parse_map arguments from rebase

* Fix broken parse_map arguments from rebase

* Fix flashing circles bug and remove circles after 15 mins
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

5 participants