From 8ff373a5dfea56585f06caac5d032dd914e41297 Mon Sep 17 00:00:00 2001 From: jasper Date: Wed, 31 Aug 2016 04:01:21 +0200 Subject: [PATCH 1/2] Split max_distance into max_sniping_distance and max_walking_distance --- configs/config.json.map.example | 6 ++++-- pokemongo_bot/cell_workers/move_to_map_pokemon.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configs/config.json.map.example b/configs/config.json.map.example index 050dc332de..1197020ee3 100644 --- a/configs/config.json.map.example +++ b/configs/config.json.map.example @@ -189,8 +189,10 @@ "config": { "enabled": true, "address": "http://localhost:5000", - "//NOTE: Change the max_distance to adjust the max sniping range (km)": {}, - "max_distance": 500, + "//NOTE: Change the max_sniping_distance to adjust the max sniping range (m)": {}, + "max_sniping distance": 10000, + "//NOTE: Change the max_walking_distance to adjust the max walking range when snipe is off (m)": {}, + "max__walking_distance": 500, "min_ball": 50, "prioritize_vips": true, "snipe": true, diff --git a/pokemongo_bot/cell_workers/move_to_map_pokemon.py b/pokemongo_bot/cell_workers/move_to_map_pokemon.py index 65e536dc6b..64ec72d8a2 100644 --- a/pokemongo_bot/cell_workers/move_to_map_pokemon.py +++ b/pokemongo_bot/cell_workers/move_to_map_pokemon.py @@ -138,7 +138,10 @@ def get_pokemon_from_social(self): pokemon['longitude'], ) - if pokemon['dist'] > self.config['max_distance'] and not self.config['snipe']: + if pokemon['dist'] > self.config['max_sniping_distance'] and self.config['snipe']: + continue + + if pokemon['dist'] > self.config['max_walking_distance'] and not self.config['snipe']: continue # pokemon not reachable with mean walking speed (by config) @@ -192,7 +195,10 @@ def get_pokemon_from_map(self): pokemon['longitude'], ) - if pokemon['dist'] > self.config['max_distance'] and not self.config['snipe']: + if pokemon['dist'] > self.config['max_sniping_distance'] and self.config['snipe']: + continue + + if pokemon['dist'] > self.config['max_walking_distance'] and not self.config['snipe']: continue # pokemon not reachable with mean walking speed (by config) From df66a2351e95bc5b5513c514ae951cc165c000a2 Mon Sep 17 00:00:00 2001 From: jasper Date: Wed, 31 Aug 2016 04:08:20 +0200 Subject: [PATCH 2/2] Update configuration_filse.md --- docs/configuration_files.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/configuration_files.md b/docs/configuration_files.md index d6828229d4..8e7fe979ae 100644 --- a/docs/configuration_files.md +++ b/docs/configuration_files.md @@ -612,7 +612,8 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i * `prioritize_vips` - Will prioritize vips in distance and priority mode above all normal pokemon if set to true * `min_time` - Minimum time the pokemon has to be available before despawn * `min_ball` - Minimum amount of balls required to run task -* `max_distance` - Maximum distance the pokemon is allowed to be when sniping. (km) +* `max_sniping_distance` - Maximum distance the pokemon is allowed to be caught when sniping. (m) +* `max_walking_distance` - Maximum distance the pokemon is allowed to be caught when sniping is turned off. (m) * `snipe`: - `True` - Will teleport to target pokemon, encounter it, teleport back then catch it - `False` - Will walk normally to the pokemon @@ -634,8 +635,10 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i "type": "MoveToMapPokemon", "config": { "address": "http://localhost:5000", - "//NOTE: Change the max_distance to adjust the max sniping range (km)": {}, - "max_distance": 500, + "//NOTE: Change the max_sniping_distance to adjust the max sniping range (m)": {}, + "max_sniping distance": 10000, + "//NOTE: Change the max_walking_distance to adjust the max walking range when snipe is off (m)": {}, + "max__walking_distance": 500, "min_time": 60, "min_ball": 50, "prioritize_vips": true,