diff --git a/configs/config.json.cluster.example b/configs/config.json.cluster.example index 6d9d584985..7d1a02f87e 100644 --- a/configs/config.json.cluster.example +++ b/configs/config.json.cluster.example @@ -88,7 +88,9 @@ "config": { "enabled": false, "nickname_above_iv": 0.9, - "nickname_template": "{iv_pct}_{iv_ads}" + "nickname_template": "{iv_pct}_{iv_ads}", + "nickname_wait_min": 3, + "nickname_wait_max": 5 } }, { diff --git a/configs/config.json.example b/configs/config.json.example index 5cf9951642..2e3613efa6 100644 --- a/configs/config.json.example +++ b/configs/config.json.example @@ -113,7 +113,9 @@ "config": { "enabled": false, "nickname_above_iv": 0.9, - "nickname_template": "{iv_pct}_{iv_ads}" + "nickname_template": "{iv_pct}_{iv_ads}", + "nickname_wait_min": 3, + "nickname_wait_max": 5 } }, { @@ -285,7 +287,8 @@ "color": true, "show_datetime": true, "show_process_name": true, - "show_log_level": true + "show_log_level": true, + "show_thread_name": false }, "catch": { "any": {"candy_threshold" : 400 ,"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"}, diff --git a/configs/config.json.map.example b/configs/config.json.map.example index fc9ca4ae14..2dfe185307 100644 --- a/configs/config.json.map.example +++ b/configs/config.json.map.example @@ -88,7 +88,9 @@ "config": { "enabled": false, "nickname_above_iv": 0.9, - "nickname_template": "{iv_pct}_{iv_ads}" + "nickname_template": "{iv_pct}_{iv_ads}", + "nickname_wait_min": 3, + "nickname_wait_max": 5 } }, { @@ -189,8 +191,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/configs/config.json.optimizer.example b/configs/config.json.optimizer.example index c08bed77c2..75d25d18e1 100644 --- a/configs/config.json.optimizer.example +++ b/configs/config.json.optimizer.example @@ -14,6 +14,7 @@ "evolve_count_for_lucky_egg": 80, "may_use_lucky_egg": true, "upgrade": true, + "upgrade_level": 60, "groups": { "gym": ["Dragonite", "Snorlax", "Lapras", "Arcanine"] }, @@ -28,7 +29,7 @@ { "mode": "by_family", "top": 1, - "sort": [{"ncp": "0.9"}], + "sort": [{"ncp": 0.9}], "evolve": true, "upgrade": false }, @@ -43,7 +44,7 @@ "mode": "by_family", "names": ["gym"], "top": 3, - "sort": [{"iv": 0.9}, {"ncp": "0.9"}], + "sort": [{"iv": 0.9}, {"ncp": 0.9}], "evolve": true, "upgrade": true } diff --git a/configs/config.json.path.example b/configs/config.json.path.example index c1e56dcc20..8bc4ac0f89 100644 --- a/configs/config.json.path.example +++ b/configs/config.json.path.example @@ -88,7 +88,9 @@ "config": { "enabled": false, "nickname_above_iv": 0.9, - "nickname_template": "{iv_pct}_{iv_ads}" + "nickname_template": "{iv_pct}_{iv_ads}", + "nickname_wait_min": 3, + "nickname_wait_max": 5 } }, { diff --git a/configs/config.json.pokemon.example b/configs/config.json.pokemon.example index a86aa0ef97..010ba4e8dc 100644 --- a/configs/config.json.pokemon.example +++ b/configs/config.json.pokemon.example @@ -88,7 +88,9 @@ "config": { "enabled": false, "nickname_above_iv": 0.9, - "nickname_template": "{iv_pct}_{iv_ads}" + "nickname_template": "{iv_pct}_{iv_ads}", + "nickname_wait_min": 3, + "nickname_wait_max": 5 } }, { diff --git a/data/pokemon_upgrade_cost.json b/data/pokemon_upgrade_cost.json index 06860e57ae..df49c94223 100644 --- a/data/pokemon_upgrade_cost.json +++ b/data/pokemon_upgrade_cost.json @@ -43,7 +43,7 @@ [3, 3000], [3, 3000], [3, 3000], -[3, 3000], +[3, 3500], [3, 3500], [3, 3500], [3, 3500], diff --git a/docs/configuration_files.md b/docs/configuration_files.md index d6828229d4..1b3e491945 100644 --- a/docs/configuration_files.md +++ b/docs/configuration_files.md @@ -96,6 +96,7 @@ Document the configuration options of PokemonGo-Bot. 'logging'.'show_datetime' (default true) Show date and time in log 'logging'.'show_process_name' (default true) Show name of process generating output in log 'logging'.'show_log_level' (default true) Show level of log message in log (eg. "INFO") +'logging'.'show_thread_name' (default false) Show name of thread in log ## Configuring Tasks [[back to top](#table-of-contents)] @@ -606,13 +607,14 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i [[back to top](#table-of-contents)] * `Address` - Address of the webserver of PokemonGo-Map. ex: `http://localhost:5000` -* `Mode` - Which mode to run snipin on +* `Mode` - Which mode to run sniping on - `distance` - Will move to the nearest pokemon - `priority` - Will move to the pokemon with the highest priority assigned (tie breaking by distance) * `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 @@ -621,8 +623,14 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i * `snipe_high_prio_only` - Whether to snipe pokemon above a certain threshold. * `snipe_high_prio_threshold` - The threshold number corresponding with the `catch` dictionary. * - Any pokemon above this threshold value will be caught by teleporting to its location, and getting back to original location if `snipe` is `True`. -* - Any pokemon under this threshold value will make the bot walk to the Pokemon target wether `snipe` is `True` or `False`. +* - Any pokemon under this threshold value will make the bot walk to the Pokemon target whether `snipe` is `True` or `False`. * `max_extra_dist_fort` : Percentage of extra distance allowed to move to a fort on the way to the targeted Pokemon +* `debug` : Output additional debugging information +* `skip_rounds` : Try to snipe every X rounds +* `update_map_min_distance_meters` : Update map if more than X meters away +* `update_map_min_time_sec` : Update map if older than X seconds +* `snipe_sleep_sec` : Sleep for X seconds after snipes +* `snipe_max_in_chain` : Maximum snipes in chain #### Example [[back to top](#table-of-contents)] @@ -634,8 +642,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, diff --git a/docs/installation.md b/docs/installation.md index 3919924584..d2b34f00c2 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -29,7 +29,7 @@ for manual installation please refer to [here](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/manual_installation.md) # Windows -We do recommend Windows users to use [Docker](#docker) this will work much easier and smoother (also saver) +We do recommend Windows users to use [Docker](#docker) this will work much easier and smoother (also safer) ## Requirements @@ -58,15 +58,13 @@ Once you have Docker installed, simply create the various config files for your ``` cd PokemonGo-Bot -docker build --build-arg TIMEZONE=Europe/London -t pokemongo-bot . +docker build -t pokemongo-bot . ``` -Optionally you can set your timezone with the --build-arg option (default is Etc/UTC). You can find an exhaustive list of timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - By default our Dockerfile ensures that the "master" branch will be used for building the docker container, if you want to use the "dev" branch then you should build the container with below build command: ``` -docker build --build-arg TIMEZONE=Europe/London --build-arg BUILD_BRANCH=dev -t pokemongo-bot . +docker build --build-arg BUILD_BRANCH=dev -t pokemongo-bot . ``` @@ -83,6 +81,12 @@ To run the bot container with the PokemonGo-Bot Docker image you've created: docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot ``` +Optionally you can set your timezone with the -e option (default is Etc/UTC). You can find an exhaustive list of timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + +``` +docker run --name=bot1-pokego --rm -it -e TIMEZONE=Asia/Taipei -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot +``` + >In the case you configured authentification to be handled by auth.json file make sure you mount that file as a volume also >``` @@ -99,7 +103,7 @@ docker run --name=bot1-pokego --rm -it -v $(pwd)/configs:/usr/src/app/configs -v Run a second container provided with the OpenPoGoBotWeb view: ``` -docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer +docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/config/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer ``` The OpenPoGoWeb will be served on `http://:8000` @@ -118,7 +122,7 @@ docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/ap - Run the web container: ``` -docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer +docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/config/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer ``` - Retrieve your host address: diff --git a/docs/pokemon_optimizer.md b/docs/pokemon_optimizer.md index 0752cf1855..26feb8d7b9 100644 --- a/docs/pokemon_optimizer.md +++ b/docs/pokemon_optimizer.md @@ -14,6 +14,7 @@ - [evolve_count_for_lucky_egg](#evolve_count_for_lucky_egg) - [may_use_lucky_egg](#may_use_lucky_egg) - [upgrade](#upgrade) + - [upgrade_level](#upgrade_level) - [groups](#groups) - [keep](#keep) - [mode](#keep-mode) @@ -50,6 +51,7 @@ The Pokemon Optimizer manage transfer and evolution of your Pokemon. "evolve_count_for_lucky_egg": 80, "may_use_lucky_egg": true, "upgrade": true, + "upgrade_level": 60, "groups": { "gym": ["Dragonite", "Snorlax", "Lapras", "Arcanine"] }, @@ -64,7 +66,7 @@ The Pokemon Optimizer manage transfer and evolution of your Pokemon. { "mode": "by_family", "top": 1, - "sort": [{"ncp": "0.9"}], + "sort": [{"ncp": 0.9}], "evolve": true, "upgrade": false }, @@ -79,7 +81,7 @@ The Pokemon Optimizer manage transfer and evolution of your Pokemon. "mode": "by_family", "names": ["gym"], "top": 3, - "sort": [{"iv": 0.9}, {"ncp": "0.9"}], + "sort": [{"iv": 0.9}, {"ncp": 0.9}], "evolve": true, "upgrade": true } @@ -180,7 +182,7 @@ Better quality Pokemon have priority for evolution and the Pokemon Optimizer wil The below 2% rule help the Pokemon Optimizer to disregard rare Pokemon and focus on common Pokemon to evolve for xp. -#### 2% rule +###### 2% rule For each family of Pokemon, if, after evolving your best Pokemon, you have enough candies left to evolve 2% of your total bag capacity, the first rank of the family are eligible for xp evolution.
If you do not have enough candies or Pokemon to evolve these 2%, they will be transfered. @@ -234,6 +236,8 @@ Define whether you allow the Pokemon Optimizer to use a lucky egg before evolvin The `upgrade` parameter activate or deactivate the upgrade (power-up) of Pokemon. At `true`, you allow the Pokemon Optimizer to upgrade every Pokemon that are the best according to your own criteria. +
If `evolve` is also activated, evolution has priority over upgrade. +Which means that the Pokemon Optimizer is going to wait that a Pokemon is fully evolved before upgrading it.
At `false`, and regardless of other parameters, no Pokemon is ever going to be upgraded.
`upgrade` parameter can be deactivated separately for each rule (see [`upgrade`](#keep-upgrade)). @@ -245,6 +249,32 @@ It can help you rectify your configuration or guide you during manual power-up. [[back to top](#pokemon-optimizer)] +### upgrade_level +| Parameter | Possible values | Default | +|-----------------|-----------------|---------| +| `upgrade_level` | `[1-80]` | `60` | + +This the maximum level at which you want the Pokemon Optimizer to upgrade your Pokemon. +
Pokemon upgrade level cannot be higher than 2 times player level. The parameter value will be majored by `2 * player level`. + +Pokemon are either fully upgraded to the maximum possible level or not upgraded at all. +The higher the level is, the more costly in candies and stardust it becomes to upgrade a Pokemon. + +###### Cumulative upgrade cost (candy, stardust) + +| From - To | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | +|-----------|:---------:|:-----------:|:-----------:|:-----------:|:-----------:|:-------------:|:-------------:|:-------------:| +| 1 | 9
3000 | 19
11000 | 38
25500 | 58
47500 | 87
80000 | 126
125000 | 196
190000 | 319
280000 | +| 10 | | 10
8000 | 29
22500 | 49
44500 | 78
77000 | 117
122000 | 187
187000 | 310
277000 | +| 20 | | | 19
14500 | 39
36500 | 68
69000 | 107
114000 | 177
179000 | 300
269000 | +| 30 | | | | 20
22000 | 49
54500 | 88
99500 | 158
164500 | 281
254500 | +| 40 | | | | | 29
32500 | 68
77500 | 138
142500 | 261
232500 | +| 50 | | | | | | 39
45000 | 109
110000 | 232
200000 | +| 60 | | | | | | | 70
65000 | 193
155000 | +| 70 | | | | | | | | 123
90000 | + +[[back to top](#pokemon-optimizer)] + ### groups | Parameter | Possible values | Default | |-----------|-----------------|---------| @@ -368,6 +398,8 @@ Define according to which criteria you want to sort your Pokemon. | `iv_defense` | defense component of iv between 0 and 15 | | `iv_stamina` | stamina component of iv between 0 and 15 | | `dps` | raw dps based on the moves of the pokemon | +| `dps1` | raw dps of the fast attack | +| `dps2` | raw dps of the charge attack | | `dps_attack` | estimated average dps when attacking | | `attack_perfection` | ratio `dps_attack` / `best_dps_attack`. Return same order as `dps_attack` | | `dps_defense` | estimated average dps when defending | diff --git a/pokecli.py b/pokecli.py index e81cf239f6..3c32a1af61 100644 --- a/pokecli.py +++ b/pokecli.py @@ -57,6 +57,20 @@ if sys.version_info >= (2, 7, 9): ssl._create_default_https_context = ssl._create_unverified_context +try: + import pkg_resources + pgoapi_version = pkg_resources.get_distribution("pgoapi").version + if pgoapi_version < '1.1.8': + print "Run following command to get latest update: `pip install -r requirements.txt --upgrade`" + sys.exit(1) +except pkg_resources.DistributionNotFound: + print 'Seems you forgot to install python modules.' + print 'Run: `pip install -r requirements.txt`' + sys.exit(1) +except ImportError as e: + print e + pass + logging.basicConfig( level=logging.INFO, format='%(asctime)s [%(name)10s] [%(levelname)s] %(message)s') @@ -220,7 +234,7 @@ def get_commit_hash(): finally: # Cache here on SIGTERM, or Exception. Check data is available and worth caching. if bot: - if bot.recent_forts[-1] is not None and bot.config.forts_cache_recent_forts: + if len(bot.recent_forts) > 0 and bot.recent_forts[-1] is not None and bot.config.forts_cache_recent_forts: cached_forts_path = os.path.join( _base_dir, 'data', 'recent-forts-%s.json' % bot.config.username ) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 38e440ba59..e40a0e5718 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -633,6 +633,10 @@ def _register_events(self): 'player_data', parameters=('player_data', ) ) + self.event_manager.register_event( + 'forts_found', + parameters=('json') + ) def tick(self): self.health_record.heartbeat() @@ -737,6 +741,26 @@ def update_web_location(self, cells=[], lat=None, lng=None, alt=None): json.dump({'lat': lat, 'lng': lng, 'alt': alt, 'start_position': self.start_position}, outfile) except IOError as e: self.logger.info('[x] Error while opening location file: %s' % e) + def emit_forts_event(self,response_dict): + map_objects = response_dict.get( + 'responses', {} + ).get('GET_MAP_OBJECTS', {}) + status = map_objects.get('status', None) + + map_cells = [] + if status and status == 1: + map_cells = map_objects['map_cells'] + + if map_cells and len(map_cells): + for cell in map_cells: + if "forts" in cell and len(cell["forts"]): + self.event_manager.emit( + 'forts_found', + sender=self, + level='debug', + formatted='Found forts {json}', + data={'json': json.dumps(cell["forts"])} + ) def find_close_cells(self, lat, lng): cellid = get_cell_ids(lat, lng) @@ -782,6 +806,8 @@ def _setup_logging(self): logging_format = '[%(levelname)s] ' + logging_format if ('show_process_name' not in self.config.logging) or self.config.logging['show_process_name']: logging_format = '[%(name)10s] ' + logging_format + if ('show_thread_name' not in self.config.logging) or self.config.logging['show_thread_name']: + logging_format = '[%(threadName)s] ' + logging_format if ('show_datetime' not in self.config.logging) or self.config.logging['show_datetime']: logging_format = '[%(asctime)s] ' + logging_format logging_format_options = '%Y-%m-%d %H:%M:%S' @@ -1306,6 +1332,9 @@ def get_map_objects(self, lat, lng, timestamp, cellid): since_timestamp_ms=timestamp, cell_id=cellid ) + self.emit_forts_event(self.last_map_object) + #if self.last_map_object: + # print self.last_map_object self.last_time_map_object = time.time() return self.last_map_object diff --git a/pokemongo_bot/cell_workers/collect_level_up_reward.py b/pokemongo_bot/cell_workers/collect_level_up_reward.py index ff0c8c5af2..1696d99049 100644 --- a/pokemongo_bot/cell_workers/collect_level_up_reward.py +++ b/pokemongo_bot/cell_workers/collect_level_up_reward.py @@ -62,11 +62,11 @@ def _collect_level_reward(self): item['name'] = got_item count = 'item_count' in item and item['item_count'] or 0 inventory.items().get(item['item_id']).add(count) - self.emit_event( 'level_up_reward', formatted='Received level up reward: {items}', data={ - 'items': data + # [{'item_id': 3, 'name': u'Ultraball', 'item_count': 10}, {'item_id': 103, 'name': u'Hyper Potion', 'item_count': 10}] + 'items': ', '.join(["{}x {}".format(x['item_count'], x['name']) for x in data]) } ) diff --git a/pokemongo_bot/cell_workers/evolve_pokemon.py b/pokemongo_bot/cell_workers/evolve_pokemon.py index 7822f4379e..0b32215058 100644 --- a/pokemongo_bot/cell_workers/evolve_pokemon.py +++ b/pokemongo_bot/cell_workers/evolve_pokemon.py @@ -28,10 +28,10 @@ def initialize(self): def _validate_config(self): if isinstance(self.evolve_list, basestring): - self.evolve_list = [str(pokemon_name).strip() for pokemon_name in self.evolve_list.split(',')] + self.evolve_list = [str(pokemon_name).strip().lower() for pokemon_name in self.evolve_list.split(',')] if isinstance(self.donot_evolve_list, basestring): - self.donot_evolve_list = [str(pokemon_name).strip() for pokemon_name in self.donot_evolve_list.split(',')] + self.donot_evolve_list = [str(pokemon_name).strip().lower() for pokemon_name in self.donot_evolve_list.split(',')] if 'evolve_speed' in self.config: self.logger.warning("evolve_speed is deprecated, instead please use 'min_evolve_speed' and 'max_evolved_speed'.") @@ -46,10 +46,10 @@ def work(self): filtered_list = self._sort_and_filter() if (len(self.evolve_list) > 0) and self.evolve_list[0] != 'all': - filtered_list = filter(lambda x: x.name in self.evolve_list, filtered_list) + filtered_list = filter(lambda x: x.name.lower() in self.evolve_list, filtered_list) if (len(self.donot_evolve_list) > 0) and self.donot_evolve_list[0] != 'none': - filtered_list = filter(lambda pokemon: pokemon.name not in self.donot_evolve_list, filtered_list) + filtered_list = filter(lambda pokemon: pokemon.name.lower() not in self.donot_evolve_list, filtered_list) cache = {} for pokemon in filtered_list: @@ -142,6 +142,7 @@ def _execute_pokemon_evolve(self, pokemon, cache): inventory.pokemons().remove(pokemon.unique_id) new_pokemon = inventory.Pokemon(evolution) inventory.pokemons().add(new_pokemon) + inventory.player().exp += xp sleep(uniform(self.min_evolve_speed, self.max_evolve_speed)) evolve_result = True diff --git a/pokemongo_bot/cell_workers/incubate_eggs.py b/pokemongo_bot/cell_workers/incubate_eggs.py index 9cc570b51e..c034dcbd29 100644 --- a/pokemongo_bot/cell_workers/incubate_eggs.py +++ b/pokemongo_bot/cell_workers/incubate_eggs.py @@ -244,6 +244,8 @@ def _hatch_eggs(self): 'candy': candy[i], } ) + # hatching egg gets exp too! + inventory.player().exp += xp[i] def _print_eggs(self): if not self.used_incubators: diff --git a/pokemongo_bot/cell_workers/move_to_map_pokemon.py b/pokemongo_bot/cell_workers/move_to_map_pokemon.py index 65e536dc6b..4a4ece400a 100644 --- a/pokemongo_bot/cell_workers/move_to_map_pokemon.py +++ b/pokemongo_bot/cell_workers/move_to_map_pokemon.py @@ -138,10 +138,15 @@ def get_pokemon_from_social(self): pokemon['longitude'], ) - if pokemon['dist'] > self.config['max_distance'] and not self.config['snipe']: + # If distance to pokemon greater than the max_sniping_distance, then ignore regardless of "snipe" setting + if pokemon['dist'] > self.config.get('max_sniping_distance', 10000): + continue + + # If distance bigger than walking distance, ignore if sniping is not active + if pokemon['dist'] > self.config.get('max_walking_distance', 1000) and not self.config.get('snipe', False): continue - # pokemon not reachable with mean walking speed (by config) + # if pokemon not reachable with mean walking speed (by config) mean_walk_speed = (self.bot.config.walk_max + self.bot.config.walk_min) / 2 if pokemon['dist'] > ((pokemon['disappear_time'] - now) * mean_walk_speed) and not self.config['snipe']: continue @@ -192,7 +197,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) diff --git a/pokemongo_bot/cell_workers/nickname_pokemon.py b/pokemongo_bot/cell_workers/nickname_pokemon.py index 84a60c0b06..834347450b 100644 --- a/pokemongo_bot/cell_workers/nickname_pokemon.py +++ b/pokemongo_bot/cell_workers/nickname_pokemon.py @@ -4,7 +4,7 @@ import os import json from pokemongo_bot.base_task import BaseTask -from pokemongo_bot.human_behaviour import sleep +from pokemongo_bot.human_behaviour import sleep, action_delay from pokemongo_bot.inventory import pokemons, Pokemon, Attack import re @@ -13,6 +13,8 @@ DEFAULT_IGNORE_FAVORITES = False DEFAULT_GOOD_ATTACK_THRESHOLD = 0.7 DEFAULT_TEMPLATE = '{name}' +DEFAULT_NICKNAME_WAIT_MIN = 3 +DEFAULT_NICKNAME_WAIT_MAX = 3 MAXIMUM_NICKNAME_LENGTH = 12 @@ -187,14 +189,12 @@ class NicknamePokemon(BaseTask): # noinspection PyAttributeOutsideInit def initialize(self): - self.ignore_favorites = self.config.get( - 'dont_nickname_favorite', DEFAULT_IGNORE_FAVORITES) - self.good_attack_threshold = self.config.get( - 'good_attack_threshold', DEFAULT_GOOD_ATTACK_THRESHOLD) - self.template = self.config.get( - 'nickname_template', DEFAULT_TEMPLATE) - self.nickname_above_iv = self.config.get( - 'nickname_above_iv', 0) + self.ignore_favorites = self.config.get('dont_nickname_favorite', DEFAULT_IGNORE_FAVORITES) + self.good_attack_threshold = self.config.get('good_attack_threshold', DEFAULT_GOOD_ATTACK_THRESHOLD) + self.template = self.config.get('nickname_template', DEFAULT_TEMPLATE) + self.nickname_above_iv = self.config.get('nickname_above_iv', 0) + self.nickname_wait_min = self.config.get('nickname_wait_min', DEFAULT_NICKNAME_WAIT_MIN) + self.nickname_wait_max = self.config.get('nickname_wait_max', DEFAULT_NICKNAME_WAIT_MAX) self.translate = None locale = self.config.get('locale', 'en') @@ -210,7 +210,9 @@ def work(self): for pokemon in pokemons().all(): # type: Pokemon if not pokemon.is_favorite or not self.ignore_favorites: if pokemon.iv >= self.nickname_above_iv: - self._nickname_pokemon(pokemon) + if self._nickname_pokemon(pokemon): + # Make the bot appears more human + action_delay(self.nickname_wait_min, self.nickname_wait_max) def _localize(self, string): if self.translate and string in self.translate: @@ -219,7 +221,8 @@ def _localize(self, string): return string def _nickname_pokemon(self, pokemon): - # type: (Pokemon) -> None + # type: (Pokemon) -> bool + # returns False if no wait needed (no API calls tried before return), True if wait is needed """ Nicknaming process """ @@ -231,7 +234,7 @@ def _nickname_pokemon(self, pokemon): 'api_error', formatted='Failed to get pokemon name, will not rename.' ) - return + return False # Generate new nickname old_nickname = pokemon.nickname @@ -243,11 +246,11 @@ def _nickname_pokemon(self, pokemon): formatted="Unable to nickname {} due to bad template ({})" .format(old_nickname, bad_key) ) - return + return False # Skip if pokemon is already well named if pokemon.nickname_raw == new_nickname: - return + return False # Send request response = self.bot.api.nickname_pokemon( @@ -263,7 +266,7 @@ def _nickname_pokemon(self, pokemon): 'api_error', formatted='Attempt to nickname received bad response from server.' ) - return + return True # Nickname unset if result == 0: @@ -292,6 +295,7 @@ def _nickname_pokemon(self, pokemon): formatted='Attempt to nickname received unexpected result' ' from server ({}).'.format(result) ) + return True def _generate_new_nickname(self, pokemon, template): # type: (Pokemon, string) -> string diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index 73aa62dee8..a22f3a2c1e 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -526,7 +526,9 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False): try: inventory.pokemons().add(pokemon) - exp_gain = sum(response_dict['responses']['CATCH_POKEMON']['capture_award']['xp']) + exp_gain = sum(response_dict['responses']['CATCH_POKEMON']['capture_award']['xp']) + # update player's exp + inventory.player().exp += exp_gain self.emit_event( 'pokemon_caught', diff --git a/pokemongo_bot/cell_workers/pokemon_optimizer.py b/pokemongo_bot/cell_workers/pokemon_optimizer.py index d2062ba80d..07b9b16b4d 100644 --- a/pokemongo_bot/cell_workers/pokemon_optimizer.py +++ b/pokemongo_bot/cell_workers/pokemon_optimizer.py @@ -47,6 +47,7 @@ def initialize(self): self.config_evolve_count_for_lucky_egg = self.config.get("evolve_count_for_lucky_egg", 80) self.config_may_use_lucky_egg = self.config.get("may_use_lucky_egg", False) self.config_upgrade = self.config.get("upgrade", False) + self.config_upgrade_level = self.config.get("upgrade_level", 60) self.config_groups = self.config.get("groups", {"gym": ["Dragonite", "Snorlax", "Lapras", "Arcanine"]}) self.config_keep = self.config.get("keep", [{"mode": "by_family", "top": 1, "sort": [{"iv": 0.9}], "evolve": True, "upgrade": False}, {"mode": "by_family", "top": 1, "sort": [{"ncp": 0.9}], "evolve": True, "upgrade": False}, @@ -154,7 +155,6 @@ def work(self): xp_all += xp self.apply_optimization(transfer_all, evolve_all, upgrade_all, xp_all) - inventory.update_web_inventory() return WorkerResult.SUCCESS @@ -162,6 +162,8 @@ def open_inventory(self): for pokemon in inventory.pokemons().all(): setattr(pokemon, "ncp", pokemon.cp_percent) setattr(pokemon, "dps", pokemon.moveset.dps) + setattr(pokemon, "dps1", pokemon.fast_attack.dps) + setattr(pokemon, "dps2", pokemon.charged_attack.dps) setattr(pokemon, "dps_attack", pokemon.moveset.dps_attack) setattr(pokemon, "dps_defense", pokemon.moveset.dps_defense) @@ -241,13 +243,13 @@ def get_best_pokemon_for_rule(self, pokemon_list, rule): if len(sorted_pokemon) == 0: return ([], [], []) - top = max(rule.get("top", 1), 0) + top = max(rule.get("top", 0), 0) index = int(math.ceil(top)) - 1 if 0 < top < 1: worst = object() - for a in rule.get("sort"): + for a in rule.get("sort", []): best_attribute = getattr(sorted_pokemon[0], a) setattr(worst, a, best_attribute * (1 - top)) elif 0 <= index < len(sorted_pokemon): @@ -323,7 +325,7 @@ def get_score(self, pokemon, rule): rule.get("evolve", True)) may_try_upgrade = rule.get("upgrade", False) - for a in rule.get("sort"): + for a in rule.get("sort", []): if (type(a) is str) or (type(a) is unicode): value = getattr(pokemon, a, 0) score.append(value) @@ -368,17 +370,18 @@ def get_evolution_plan(self, family_id, family_list, try_evolve, try_upgrade, ke evolve.append(pokemon) upgrade = [] + upgrade_level = min(self.config_upgrade_level, inventory.player().level * 2) for pokemon in try_upgrade: level = int(pokemon.level * 2) - 1 - if level >= 80: + if level >= upgrade_level: continue full_upgrade_candy_cost = 0 full_upgrade_stardust_cost = 0 - for i in range(level, 80): + for i in range(level, upgrade_level): upgrade_cost = self.pokemon_upgrade_cost[i - 1] full_upgrade_candy_cost += upgrade_cost[0] full_upgrade_stardust_cost += upgrade_cost[1] @@ -556,6 +559,7 @@ def evolve_pokemon(self, pokemon): if self.config_evolve and (not self.bot.config.test): candy.consume(pokemon.evolution_cost - candy_awarded) + inventory.player().exp += xp self.emit_event("pokemon_evolved", formatted="Evolved {pokemon} [IV {iv}] [CP {cp}] [{candy} candies] [+{xp} xp]", @@ -586,9 +590,10 @@ def evolve_pokemon(self, pokemon): def upgrade_pokemon(self, pokemon): level = int(pokemon.level * 2) - 1 + upgrade_level = min(self.config_upgrade_level, inventory.player().level * 2) candy = inventory.candies().get(pokemon.pokemon_id) - for i in range(level, 80): + for i in range(level, upgrade_level): upgrade_cost = self.pokemon_upgrade_cost[i - 1] upgrade_candy_cost = upgrade_cost[0] upgrade_stardust_cost = upgrade_cost[1] diff --git a/pokemongo_bot/cell_workers/spin_fort.py b/pokemongo_bot/cell_workers/spin_fort.py index c4a73aec4d..6c5632fc98 100644 --- a/pokemongo_bot/cell_workers/spin_fort.py +++ b/pokemongo_bot/cell_workers/spin_fort.py @@ -80,7 +80,7 @@ def work(self): data={ 'pokestop': fort_name, 'exp': experience_awarded, - 'items': items_awarded + 'items': ', '.join(["{}x {}".format(items_awarded[x], x) for x in items_awarded]) } ) else: @@ -202,6 +202,9 @@ def get_forts_in_range(self): return forts def get_items_awarded_from_fort_spinned(self, response_dict): + experience_awarded = response_dict['responses']['FORT_SEARCH'].get('experience_awarded', 0) + inventory.player().exp += experience_awarded + items_awarded = response_dict['responses']['FORT_SEARCH'].get('items_awarded', {}) if items_awarded: tmp_count_items = {} diff --git a/pokemongo_bot/cell_workers/update_web_inventory.py b/pokemongo_bot/cell_workers/update_web_inventory.py index 34c5186981..7db26d7946 100644 --- a/pokemongo_bot/cell_workers/update_web_inventory.py +++ b/pokemongo_bot/cell_workers/update_web_inventory.py @@ -1,15 +1,12 @@ -import json -import os -from pokemongo_bot.base_task import BaseTask from pokemongo_bot import inventory -from pokemongo_bot.base_dir import _base_dir +from pokemongo_bot.base_task import BaseTask +from pokemongo_bot.worker_result import WorkerResult class UpdateWebInventory(BaseTask): SUPPORTED_TASK_API_VERSION = 1 - def initialize(self): - pass - def work(self): - inventory.update_web_inventory() \ No newline at end of file + inventory.update_web_inventory() + + return WorkerResult.SUCCESS diff --git a/pokemongo_bot/event_handlers/social_handler.py b/pokemongo_bot/event_handlers/social_handler.py index bcb9aa6e43..e51f1578de 100644 --- a/pokemongo_bot/event_handlers/social_handler.py +++ b/pokemongo_bot/event_handlers/social_handler.py @@ -16,22 +16,25 @@ def __init__(self, bot, clientid=None): self.bot.mqtt_pokemon_list = [] self._mqttc = None def mqtt_on_connect(self, mqttc, obj, flags, rc): + if rc is 0: + self._mqttc.subscribe("pgo/#", 1) if DEBUG_ON: print "rc: "+str(rc) def mqtt_on_message(self, mqttc, obj, msg): #msg.topic+" "+str(msg.qos)+" "+str(msg.payload)] - pokemon = json.loads(msg.payload) if DEBUG_ON: - print 'on message: {}'.format(pokemon) + print 'on message: {}'.format(msg.payload) + pokemon = json.loads(msg.payload) if pokemon and 'encounter_id' in pokemon: new_list = [x for x in self.bot.mqtt_pokemon_list if x['encounter_id'] is pokemon['encounter_id']] if not (new_list and len(new_list) > 0): self.bot.mqtt_pokemon_list.append(pokemon) def on_disconnect(self,client, userdata, rc): + self._mqttc.unsubscribe("pgo/#") if DEBUG_ON: print 'on_disconnect' if rc != 0: - print("Unexpected disconnection.") + print "Unexpected disconnection." def mqtt_on_publish(self, mqttc, obj, mid): if DEBUG_ON: print "mid: "+str(mid) @@ -48,17 +51,15 @@ def connect_to_mqtt(self): if DEBUG_ON: print 'connect again' self._mqttc = mqtt.Client(None) - if self._mqttc: - self._mqttc.on_message = self.mqtt_on_message - self._mqttc.on_connect = self.mqtt_on_connect - self._mqttc.on_subscribe = self.mqtt_on_subscribe - self._mqttc.on_publish = self.mqtt_on_publish - self._mqttc.on_disconnect = self.on_disconnect + self._mqttc.on_message = self.mqtt_on_message + self._mqttc.on_connect = self.mqtt_on_connect + self._mqttc.on_subscribe = self.mqtt_on_subscribe + self._mqttc.on_publish = self.mqtt_on_publish + self._mqttc.on_disconnect = self.on_disconnect - self._mqttc.connect("broker.pikabot.org", 1883, 60) - # Enable this line if you are doing the snip code, off stress - self._mqttc.subscribe("pgo/#", 1) - # self._mqttc.loop_start() + self._mqttc.connect("broker.pikabot.org", 1883, 60) + # Enable this line if you are doing the snip code, off stress + # self._mqttc.loop_start() except TypeError: print 'Connect to mqtter error' return diff --git a/pokemongo_bot/event_handlers/telegram_handler.py b/pokemongo_bot/event_handlers/telegram_handler.py index ac343525d0..165521c062 100755 --- a/pokemongo_bot/event_handlers/telegram_handler.py +++ b/pokemongo_bot/event_handlers/telegram_handler.py @@ -44,10 +44,30 @@ def _get_player_stats(self): except: raise FileIOException("Unexpected error reading from {}".format(web_inventory)) return next((x["inventory_item_data"]["player_stats"] - for x in json_inventory - if x.get("inventory_item_data", {}).get("player_stats", {})), - None) - + for x in json_inventory + if x.get("inventory_item_data", {}).get("player_stats", {})), + None) + def send_player_stats_to_chat(self, chat_id): + stats = self._get_player_stats() + if stats: + with self.bot.database as conn: + cur = conn.cursor() + cur.execute("SELECT DISTINCT COUNT(encounter_id) FROM catch_log WHERE dated >= datetime('now','-1 day')") + catch_day = cur.fetchone()[0] + cur.execute("SELECT DISTINCT COUNT(pokestop) FROM pokestop_log WHERE dated >= datetime('now','-1 day')") + ps_day = cur.fetchone()[0] + res = ( + "*"+self.bot.config.username+"*", + "_Level:_ "+str(stats["level"]), + "_XP:_ "+str(stats["experience"])+"/"+str(stats["next_level_xp"]), + "_Pokemons Captured:_ "+str(stats["pokemons_captured"])+" ("+str(catch_day)+" _last 24h_)", + "_Poke Stop Visits:_ "+str(stats["poke_stop_visits"])+" ("+str(ps_day)+" _last 24h_)", + "_KM Walked:_ "+str("%.2f" % stats["km_walked"]) + ) + self._tbot.sendMessage(chat_id=chat_id, parse_mode='Markdown', text="\n".join(res)) + self._tbot.send_location(chat_id=chat_id, latitude=self.bot.api._position_lat, longitude=self.bot.api._position_lng) + else: + self._tbot.sendMessage(chat_id=chat_id, parse_mode='Markdown', text="Stats not loaded yet\n") def run(self): time.sleep(1) while True: @@ -59,26 +79,7 @@ def run(self): if self.master and self.master not in [update.message.from_user.id, "@{}".format(update.message.from_user.username)]: continue if update.message.text == "/info": - stats = self._get_player_stats() - if stats: - with self.bot.database as conn: - cur = conn.cursor() - cur.execute("SELECT DISTINCT COUNT(encounter_id) FROM catch_log WHERE dated >= datetime('now','-1 day')") - catch_day = cur.fetchone()[0] - cur.execute("SELECT DISTINCT COUNT(pokestop) FROM pokestop_log WHERE dated >= datetime('now','-1 day')") - ps_day = cur.fetchone()[0] - res = ( - "*"+self.bot.config.username+"*", - "_Level:_ "+str(stats["level"]), - "_XP:_ "+str(stats["experience"])+"/"+str(stats["next_level_xp"]), - "_Pokemons Captured:_ "+str(stats["pokemons_captured"])+" ("+str(catch_day)+" _last 24h_)", - "_Poke Stop Visits:_ "+str(stats["poke_stop_visits"])+" ("+str(ps_day)+" _last 24h_)", - "_KM Walked:_ "+str("%.2f" % stats["km_walked"]) - ) - self._tbot.sendMessage(chat_id=update.message.chat_id, parse_mode='Markdown', text="\n".join(res)) - self._tbot.send_location(chat_id=update.message.chat_id, latitude=self.bot.api._position_lat, longitude=self.bot.api._position_lng) - else: - self._tbot.sendMessage(chat_id=update.message.chat_id, parse_mode='Markdown', text="Stats not loaded yet\n") + self.send_player_stats_to_chat(update.message.chat_id) elif update.message.text == "/start" or update.message.text == "/help": res = ( "Commands: ", @@ -130,8 +131,9 @@ def handle_event(self, event, sender, level, formatted_msg, data): msg = "Caught {} CP: {}, IV: {}".format(data["pokemon"], data["cp"], data["iv"]) else: return + elif event == 'catch_limit': + self.tbot.send_player_stats_to_chat(master) + msg = "*You have reached your daily catch limit, quitting.*" else: return self.tbot.sendMessage(chat_id=master, parse_mode='Markdown', text=msg) - - diff --git a/pokemongo_bot/inventory.py b/pokemongo_bot/inventory.py index 7ac6f600c2..862e1999ec 100644 --- a/pokemongo_bot/inventory.py +++ b/pokemongo_bot/inventory.py @@ -94,7 +94,6 @@ def __init__(self, bot, ttl=3): self.next_level_xp = None self.pokemons_captured = None self.poke_stop_visits = None - self.last_lvl_up_reward = time.time() # ts of last lvl_up_reward api call self.player_stats = None super(_BaseInventoryComponent, self).__init__() @@ -104,11 +103,6 @@ def level(self): @level.setter def level(self, value): - if self._level != value: - now = time.time() - if now - self.last_lvl_up_reward > self.ttl: - self.bot.api.level_up_rewards(level=self.level) - self._level = value @property @@ -117,10 +111,12 @@ def exp(self): @exp.setter def exp(self, value): - if self._exp != value: - now = time.time() - if now - self.last_lvl_up_reward > self.ttl: - self.bot.api.level_up_rewards(level=self.level) + # if new exp is larger than or equal to next_level_xp + if value >= self.next_level_xp: + self.level = self._level + 1 + # increase next_level_xp to a big amount + # will be fix on the next heartbeat + self.next_level_xp += 10000000 self._exp = value @@ -131,9 +127,9 @@ def parse(self, item): if not item: item = {} + self.next_level_xp = item.get('next_level_xp', 0) self.exp = item.get('experience', 0) self.level = item.get('level', 0) - self.next_level_xp = item.get('next_level_xp', 0) self.pokemons_captured = item.get('pokemons_captured', 0) self.poke_stop_visits = item.get('poke_stop_visits', 0) diff --git a/pokemongo_bot/walkers/polyline_generator.py b/pokemongo_bot/walkers/polyline_generator.py index 394134ec07..2068bcc5ed 100644 --- a/pokemongo_bot/walkers/polyline_generator.py +++ b/pokemongo_bot/walkers/polyline_generator.py @@ -59,28 +59,22 @@ def __init__(self, origin, destination, speed): self.directions_response = requests.get(self.DIRECTIONS_URL).json() try: - # Polyline walker starts teleporting after reaching api query limit. - # throw error here atm, catch it at factory and return StepWalker - # - # In case of API limit reached we get back we get a status 200 code with an empty routes [] - # - # {u'error_message': u'You have exceeded your rate-limit for this API.', - # u'routes': [], - # u'status': u'OVER_QUERY_LIMIT' - # } - self.polyline_points = [x['polyline']['points'] for x in self.directions_response['routes'][0]['legs'][0]['steps']] - # This handles both cases: - # a) the above API Quota reached self.directions_response['routes'] = [] - # b) ZERO_RESULTS { - # "geocoded_waypoints" : [ {}, {} ], - # "routes" : [], - # "status" : "ZERO_RESULTS" - # } except IndexError: + # This handles both cases: + # a) In case of API limit reached we get back we get a status 200 code with an empty routes [] + # {u'error_message': u'You have exceeded your rate-limit for this API.', + # u'routes': [], + # u'status': u'OVER_QUERY_LIMIT' + # } + # b) In case that google does not have any directions proposals we get: + # ZERO_RESULTS { + # "geocoded_waypoints" : [ {}, {} ], + # "routes" : [], + # "status" : "ZERO_RESULTS" + # } self.polyline_points = self.directions_response['routes'] - raise # catch at factory atm... self.points = [self.origin] + self.get_points(self.polyline_points) + [self.destination] self.speed = float(speed) self.lat, self.long = self.points[0][0], self.points[0][1] diff --git a/pokemongo_bot/walkers/polyline_walker.py b/pokemongo_bot/walkers/polyline_walker.py index 16bbd4a98f..883eb10863 100644 --- a/pokemongo_bot/walkers/polyline_walker.py +++ b/pokemongo_bot/walkers/polyline_walker.py @@ -8,10 +8,6 @@ from pokemongo_bot.constants import Constants class PolylineWalker(StepWalker): - ''' - Heavy multi-botting can cause issues, since the directions API has limits. - StepWalker is generated by the factory in the case. - ''' def __init__(self, bot, dest_lat, dest_lng): super(PolylineWalker, self).__init__(bot, dest_lat, dest_lng) diff --git a/pokemongo_bot/walkers/walker_factory.py b/pokemongo_bot/walkers/walker_factory.py index 2124592f1c..03a2f4e8c7 100644 --- a/pokemongo_bot/walkers/walker_factory.py +++ b/pokemongo_bot/walkers/walker_factory.py @@ -8,8 +8,5 @@ def walker_factory(name, bot, dest_lat, dest_lng, dest_alt=None, *args, **kwargs if 'StepWalker' == name: ret = StepWalker(bot, dest_lat, dest_lng, dest_alt) elif 'PolylineWalker' == name: - try: - ret = PolylineWalker(bot, dest_lat, dest_lng) - except: - ret = StepWalker(bot, dest_lat, dest_lng, dest_alt) + ret = PolylineWalker(bot, dest_lat, dest_lng) return ret diff --git a/windows_bat/PokemonGo-Bot-Configurator.bat b/windows_bat/PokemonGo-Bot-Configurator.bat index aff0acacb9..0cf24192af 100644 --- a/windows_bat/PokemonGo-Bot-Configurator.bat +++ b/windows_bat/PokemonGo-Bot-Configurator.bat @@ -50,11 +50,15 @@ ECHO. ECHO.--------------------PokemonGo-Bot Configurator-------------------- ECHO. ECHO. -ECHO. The PokemonGo-Bot Configurator creates the needed %AuthPath%auth.json and %UserDataPath%userdata.js +ECHO. The PokemonGo-Bot Configurator creates +ECHO. +ECHO. %AuthPath%auth.json +ECHO. +ECHO. and %UserDataPath%userdata.js ECHO. ECHO. It only configures the needed info to login with the PokemonGo-Bot. ECHO. -ECHO. Choose one of the %AuthPath%config.json.examples and rename it to %AuthPath%config.json +ECHO. Choose one of the %AuthPath%config.json.examples ECHO. ECHO. To fine tune your %AuthPath%config.json you will have to edit the file. ECHO. @@ -73,7 +77,9 @@ ECHO. ECHO. ECHO.============================================================================= ECHO.= = -ECHO.= WARNING - Your existing auth.json and/or userdata.js will be overwriten = +ECHO.= WARNING - Your existing auth.json, userdata.js and = +ECHO.= = +ECHO.= config.json will be overwriten. = ECHO.= = ECHO.= Press Enter to abort in next screen or make a choice to continue = ECHO.= = @@ -90,12 +96,21 @@ ECHO. ECHO. ECHO.--------------------PokemonGo-Bot Auth/Userdata Creator-------------------- ECHO. -ECHO. First create your %AuthPath%auth.json and then your %UserDataPath%userdata.js. ECHO. ECHO. 1 - %AuthPath%auth.json ECHO. ECHO. 2 - %UserDataPath%userdata.js ECHO. +ECHO. 3 - Choose a config.json +ECHO. +ECHO. +ECHO. +ECHO. First create your %AuthPath%auth.json +ECHO. +ECHO. then your %UserDataPath%userdata.js +ECHO. +ECHO. after that choose 3 to choose your config.json. +ECHO. ECHO. :_choice @@ -103,6 +118,7 @@ SET _ok= SET /p _ok= Make your choice or press Enter to close: ||goto:eof IF "%_ok%" == "1" SET CHOICE=Auth&GOTO :Auth IF "%_ok%" == "2" SET CHOICE=UserData&GOTO :UserData +IF "%_ok%" == "3" SET CHOICE=Menu2&GOTO :Menu2 GOTO :_choice :Auth @@ -182,20 +198,54 @@ ECHO. gMapsAPIKey: "%API%",>>%UserData% ECHO. botPath: true,>>%UserData% ECHO. actionsEnabled: false>>%UserData% ECHO.};>>%UserData% -call:EndUserData -goto:eof +goto:menu + +:Menu2 +cls +ECHO. +ECHO. +ECHO.--------------------PokemonGo-Bot config.json chooser-------------------- +ECHO. +ECHO. +ECHO. 1 - config.json.example +ECHO. +ECHO. 2 - config.json.cluster.example +ECHO. +ECHO. 3 - config.json.map.example +ECHO. +ECHO. 4 - config.json.optimizer.example +ECHO. +ECHO. 5 - config.json.path.example +ECHO. +ECHO. 6 - config.json.pokemon.example +ECHO. +ECHO. Choose the config you want to use with your bot, +ECHO. +ECHO. to customize it you will have to edit %AuthPath%config.json. +ECHO. +ECHO. +:_choice2 +SET _ok2= +SET /p _ok2= Make your choice or press Enter to close: ||goto:eof +IF "%_ok2%" == "1" copy %AuthPath%config.json.example %AuthPath%config.json +IF "%_ok2%" == "2" copy %AuthPath%config.json.cluster.example %AuthPath%config.json +IF "%_ok2%" == "3" copy %AuthPath%config.json.map.example %AuthPath%config.json +IF "%_ok2%" == "4" copy %AuthPath%config.json.optimizer.example %AuthPath%config.json +IF "%_ok2%" == "5" copy %AuthPath%config.json.path.example %AuthPath%config.json +IF "%_ok2%" == "6" copy %AuthPath%config.json.pokemon.example %AuthPath%config.json +GOTO :EndUserData :EndUserData cls ECHO. ECHO. -ECHO.Your %auth% and %UserData% has been made. +ECHO. Your %auth% and %UserData% have been made. ECHO. -ECHO.Choose one of the %AuthPath%config.json.examples and rename it to %AuthPath%config.json +ECHO. %AuthPath%config.json needs to be customized ECHO. -ECHO.If you want to customize your %AuthPath%config.json then you have to edit him. +ECHO. or you can run the bot with the default values. ECHO. -ECHO.After that you are ready to start the bot. +ECHO. After that you are ready to start the bot. ECHO. ECHO. timeout /t 10