Altitude still hardcoded to 8.0
Hi,
I noticed that the altitude parameter is still hardcoded to 8.0. I've set "gps_default_altitude": 209.3, and turned on Debug mode and look for
latitude: xx.xxxxxx longitude: yy.yyyyyy altitude: 8
--> It's always using 8 (or is the debug output wrong ?) The settings seems to be hardcoded from the api here: "./pgoapi/pgoapi/rpc_api.py: request.altitude = 8 # not as suspicious as 0"
I've been a bit curious if changes dealing with altitude were being applied to API requests. From conversations with the pgoapi folks, it accepts and sends altitude, rather than using a static value.
It is quite likely we have output errors. I'll stick this as a bug and hopefully we can find something.
@NatNew0 Can you try changing this line? https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/pokecli.py#L553
I think this is the only 8 we have (in PokemonGo-Bot source code)
@kanemasa1987 We have to have some value in there as a default. It's only used to initialize our self.alt, which is later generated at random or pulled from somewhere (geocoder, etc).
I was wondering if the value we set in the config.json is really used. I changed the default value in pokecli.py to 188.3: add_config( parser, load, long_flag="--gps_default_altitude", help="Initial altitude (default=8.0)", type=float, default=188.0
in the config.json there's a value of 180.3 set. then the debug startup looks like:
2016-08-21 13:33:00,458 [pgoapi.pgoapi] [DEBUG] Set Position - Lat: xx1.xxxxxxxxxx Long: yy1.yyyyyyyyy Alt: 152.151282236 2016-08-21 13:33:00,459 [PokemonGoBot] [INFO] [login_started] [97mLogin procedure started.[0m 2016-08-21 13:33:00,459 [pgoapi.pgoapi] [DEBUG] Set Position - Lat: xx1.xxxxxxxxx Long: yy1.yyyyyyyyyy Alt: 180.3 2016-08-21 13:33:00,459 [pgoapi.pgoapi] [DEBUG] Auth provider: ptc
After this the requests look like: requests { request_type: DOWNLOAD_SETTINGS request_message: "\n(54b359c97e46900f87211ef6e6dd0b7f2a3ea1f5" } latitude: xx1.xxxxxxxxx longitude: yy1.yyyyyyyyy altitude: 8 auth_info { provider: "ptc" token { contents: "TGT-dddddddddddd-xxxxxxxxxxxxxxxxxxxx-sso.pokemon.com" unknown2: xx } } Conclusion: The cached position has seems to have an altitude that will be overwritten from the value in config.json (Bug 1 IMHO). The value from the altitude will be overwritten from the apicalls to always 8.0 (Bug2)
IMHO, it's not the point here if the value is used in the game. We are sending these POST-Requests to the servers and they can read in the logs and separate bot behaviour.
This is because ofpgoapi we are using uses hardcoded altitude of 8. The file isn't in this repo, but in pgoapi repo, which we use extensively.
https://github.com/joelgreen/pgoapi/blob/master/pgoapi/rpc_api.py#L180.
I will submit a PR for it.
Thx to @alexyaoyang! Altitude is now sent with the new api commit.
Bug1 remains though :dizzy_face:
No problem, try the altitude in a bit. This repo still needs to use the latest pgoapi.
i've noticed since this was pushed to master that the gps alt range changes too quickly between calls. with the default example config of 500 to 1000. and starting alt of 500 it will start at a 500 and then 3 calls later be at 957. Most phone will narrow the range down to 40-100 meters and may drift but not at that rate in less than 3 seconds. For now i've tuned my alt to be only between 45 and 200 with default of 45.
btw does the alt work in meters. so 45 is 45m.