Skip to content

Commit

Permalink
Minor fixes and added updates to Configuration file (#4396)
Browse files Browse the repository at this point in the history
* Minor update/fix
 * Fixed bad function call at update_live_inventory.py
 * Fixed 'Total eggs' only show not incubating eggs

* Updated configuration file

* Small fix

* Small fix

* Minor fix

* Fixed typo mistake
  • Loading branch information
DeXtroTip authored and solderzzc committed Aug 20, 2016
1 parent 9ee2515 commit f5ec241
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
54 changes: 54 additions & 0 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
| `distance_unit` | km | Set the unit to display distance in (km for kilometers, mi for miles, ft for feet) |
| `evolve_cp_min` | 300 | Min. CP for evolve_all function
|`daily_catch_llimit` | 800 | Limit the amount of pokemon caught in a 24 hour period.
|`pokemon_bag.show_at_start` | false | At start, bot will show all pokemon in the bag.
|`pokemon_bag.show_count` | false | Show amount of each pokemon.
|`pokemon_bag.pokemon_info` | [] | Check any config example file to see available settings.

## Configuring Tasks
The behaviors of the bot are configured via the `tasks` key in the `config.json`. This enables you to list what you want the bot to do and change the priority of those tasks by reordering them in the list. This list of tasks is run repeatedly and in order. For more information on why we are moving config to this format, check out the [original proposal](https://github.com/PokemonGoF/PokemonGo-Bot/issues/142).
Expand Down Expand Up @@ -56,6 +59,7 @@ The behaviors of the bot are configured via the `tasks` key in the `config.json`
* TransferPokemon
* `min_free_slot`: Default `5` | Once the pokebag has less empty slots than this amount, the transfer process is triggered. | Big values (i.e 9999) will trigger the transfer process after each catch.
* UpdateLiveStats
* [UpdateLiveInventory](#updateliveinventory-settings)

### Example configuration:
The following configuration tells the bot to transfer all the Pokemon that match the transfer configuration rules, then recycle the items that match its configuration, then catch the pokemon that it can, so on, so forth. Note the last two tasks, MoveToFort and FollowSpiral. When a task is still in progress, it won't run the next things in the list. So it will move towards the fort, on each step running through the list of tasks again. Only when it arrives at the fort and there are no other stops available for it to move towards will it continue to the next step and follow the spiral.
Expand Down Expand Up @@ -514,3 +518,53 @@ Example console output
```
2016-08-20 23:55:48,513 [UpdateLiveStats] [INFO] [log_stats] USERNAME | Uptime : 0:17:17 | Level 26 (192,995 / 390,000, 49%) | Earned 900 Stardust | +2,810 XP | 9,753 XP/h | Visited 23 stops | 0.80km walked | Caught 9 pokemon
```

## UpdateLiveInventory Settings
### Description
Periodically displays the user inventory in the terminal.

### Options
* `min_interval` : The minimum interval at which the stats are displayed, in seconds (defaults to 120 seconds). The update interval cannot be accurate as workers run synchronously.
* `show_all_multiple_lines` : Logs all items on inventory using multiple lines. Ignores configuration of 'items'
* `items` : An array of items to display and their display order (implicitly), see available items below (defaults to []).

Available `items` :
```
- 'pokemon_bag' : pokemon in inventory (i.e. 'Pokemon Bag: 100/250')
- 'space_info': not an item but shows inventory bag space (i.e. 'Items: 140/350')
- 'pokeballs'
- 'greatballs'
- 'ultraballs'
- 'masterballs'
- 'razzberries'
- 'blukberries'
- 'nanabberries'
- 'luckyegg'
- 'incubator'
- 'troydisk'
- 'potion'
- 'superpotion'
- 'hyperpotion'
- 'maxpotion'
- 'incense'
- 'incensespicy'
- 'incensecool'
- 'revive'
- 'maxrevive'
```

### Sample configuration
```json
{
"type": "UpdateLiveInventory",
"config": {
"enabled": true,
"min_interval": 120,
"show_all_multiple_lines": false,
"items": ["space_info", "pokeballs", "greatballs", "ultraballs", "razzberries", "luckyegg"]
```

### Example console output
```
2016-08-20 18:56:22,754 [UpdateLiveInventory] [INFO] [show_inventory] Items: 335/350 | Pokeballs: 8 | GreatBalls: 186 | UltraBalls: 0 | RazzBerries: 51 | LuckyEggs: 3
```
2 changes: 1 addition & 1 deletion pokemongo_bot/cell_workers/incubate_eggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def work(self):
else:
self.emit_event(
'next_egg_incubates',
formatted='Next egg ({km_needed} km) incubates in {distance_in_km:.2f} km (Total eggs: {eggs}, Incubating: {eggs_inc})',
formatted='Next egg ({km_needed} km) incubates in {distance_in_km:.2f} km (Eggs left: {eggs}, Incubating: {eggs_inc})',
data={
'km_needed': self.used_incubators[0]['km_needed'],
'distance_in_km': km_left,
Expand Down
2 changes: 1 addition & 1 deletion pokemongo_bot/cell_workers/update_live_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def print_all(self):
self.logger.info(
'Items: {}/{}'.format(
self.inventory.get_space_used(),
self.inventory.get_space_used() + self.inventory.get_space_left()
inventory.get_item_inventory_size()
)
)

Expand Down

0 comments on commit f5ec241

Please sign in to comment.