Skip to content

Commit

Permalink
Merge pull request #6054 from PokemonGoF/dev
Browse files Browse the repository at this point in the history
Merge Dev to Master
  • Loading branch information
solderzzc authored Jun 28, 2017
2 parents 1f2b1cf + 98ac9d6 commit cb9837c
Show file tree
Hide file tree
Showing 26 changed files with 709 additions and 182 deletions.
3 changes: 2 additions & 1 deletion configs/auth.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"hashkey" : "YOUR_PURCHASED_HASH_KEY",
"encrypt_location": "",
"telegram_token": "",
"discord_token": ""
"discord_token": "",
"2captcha_token": ""
}
4 changes: 3 additions & 1 deletion configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"heartbeat_threshold": 10,
"enable_social": false,
"check_niantic_api": false,
"solve_captcha": false,
"live_config_update": {
"enabled": false,
"tasks_only": false
Expand Down Expand Up @@ -453,7 +454,8 @@
"enabled": true,
"spin_wait_min": 3,
"spin_wait_max": 5,
"daily_spin_limit": 1900
"daily_spin_limit": 1900,
"use_lure": false
}
},
{
Expand Down
14 changes: 12 additions & 2 deletions data/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"2": "Greatball",
"3": "Ultraball",
"4": "Masterball",
"5": "Premier Ball",
"101": "Potion",
"102": "Super Potion",
"103": "Hyper Potion",
Expand All @@ -24,6 +25,9 @@
"703": "Nanab Berry",
"704": "Wepar Berry",
"705": "Pinap Berry",
"706": "Golden Razz Berry",
"707": "Golden Nanab Berry",
"708": "Golden Pinap Berry",
"801": "Special Camera",
"901": "Incubator Basic Unlimited",
"902": "Incubator Basic",
Expand All @@ -33,5 +37,11 @@
"1102": "Kings Rock",
"1103": "Metal Coat",
"1104": "Dragon Scale",
"1105": "Upgrade"
}
"1105": "Upgrade",
"1201": "Reroll Fast Attack",
"1202": "Reroll Special Attack",
"1301": "Rare Candy",
"1401": "Free Raid Ticket",
"1402": "Paid Raid Ticket",
"1403": "Legendart Raid Ticket"
}
18 changes: 17 additions & 1 deletion docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Document the configuration options of PokemonGo-Bot.
| Parameter | Default | Description |
|------------------|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tasks` | [] | The behaviors you want the bot to do. Read [how to configure tasks](#configuring-tasks).
| `solve_captcha` | False | True: Allow bot to solve captcha when enabled. Either using automatic (2Captcha service, token to be specify in auth.json) or manual solving [more information](https://github.com/PokemonGoF/PokemonGo-Bot/pull/6050)
| `max_steps` | 5 | The steps around your initial location (DEFAULT 5 mean 25 cells around your location) that will be explored
| `forts.avoid_circles` | False | Set whether the bot should avoid circles |
| `forts.max_circle_size` | 10 | How many forts to keep in ignore list |
Expand Down Expand Up @@ -276,6 +277,7 @@ The behaviors of the bot are configured via the `tasks` key in the `config.json`
* `enabled`: Default true | Enable for disable this task
* `spin_wait_min`: Defaut 3 | Minimum wait after spinning a fort
* `spin_wait_max`: Default 5 | Maximum wait after spinning a fort
* `use_lure`: Default `False` | Enable to depoly lure (if available) at fort
* TransferPokemon
* `enable`: Disable or enable this task.
* `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.
Expand Down Expand Up @@ -1406,13 +1408,23 @@ Hunts down nearby Pokemon. Searches for Pokemon to complete the Pokedex, or if a
[[back to top](#table-of-contents)]

* `max_distance`: `Default: 2000`. Maxium of meters for the "nearby" part.
* `enable_cooldown`: `Default: true`. After a hunt (succesful or not) have a cool down (stops hunting for a bit)
* `hunt_all`: `Default: false`. Should we hunt for ALL nearby Pokemon?
* `hunt_vip`: `Default: true`. Should we hunt for VIP Pokemon?
* `hunt_pokedex`: `Default: true`. Should we hunt for Pokemon we need to complete the Pokedex (make family complete)
* `lock_on_target`: `Default: false`. Should we ignore all other Pokemon while hunting?
* `lock_vip_only`: `Default: true`. Is the above only used for real VIPs? (Not to complete the Pokedex)
* `disabled_while_camping`: `Default: true`. Should we stop hunting for nearby Pokemon while sitting at lures?
* `hunt_closest_first`: `Default: false`. Prioritize by distance instead of number of candy?
* `treat_unseen_as_vip`: `Default: true`. Should we treat unseen Pokemons as VIPs?
* `target_family_of_vip`: `Default: true`. Should we treat family of a VIP as a valid target?
* `treat_family_of_vip_as_vip`: `Default: false`. Should we see family of an VIP as a VIP (locking onto it if enabled)
* `hunt_for_trash_to_fill_bag`: `Default: false`. Should we try to fill the bag with trash if a set amount of slots is left?
* `trash_hunt_open_slots`: `Default: 25`. The amount of slots for the previous setting

### Hunting for trash
If enabled the hunter will start hunting down Pidgeys, Weedles and Caterpies when a set amount of slots (defaults to 25) are left in the bag to fill. The idea is simple; we are about to start evolving Pokemon. So the priority of the hunter shiftes. BUT when a VIP Pokemon is nearby, the Hunter will always start chasing that VIP first.
Also hunting for trash does NOT lock the target, catching all Pokemon it find on the way to the target.

### Sample configuration
[[back to top](#table-of-contents)]
Expand All @@ -1421,14 +1433,18 @@ Hunts down nearby Pokemon. Searches for Pokemon to complete the Pokedex, or if a
"type": "PokemonHunter",
"config": {
"enabled": true,
"enable_cooldown": false,
"max_distance": 1500,
"hunt_all": false,
"hunt_vip": true,
"hunt_pokedex": true,
"lock_on_target": false,
"lock_vip_only": true,
"disabled_while_camping": true,
"treat_unseen_as_vip": true
"hunt_closest_first": true,
"treat_unseen_as_vip": true,
"hunt_for_trash_to_fill_bag": true,
"trash_hunt_open_slots": 30
}
}
```
14 changes: 12 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
### Do I need hashing key ?
Without hashing key, the bot will use API in version 0.45, which is not used in legit game any longer. Learn more about - [hashing key here](http://hashing.pogodev.org).
### Do I need hashing key?
The bot will not run without a vaild hashing key. Learn more about - [hashing key here](http://hashing.pogodev.org).

### Does the bot support 2Captcha service?
Yes. Please include your 2Captcha token in auth.json
```
"2captcha_token": "YOUR_KEY_HERE"
```

### Does the bot support manual Captcha solving?
Yes. Please download chrome driver for your os plaform and place it into the root directory of the bot.
More information on [chrome driver here](https://sites.google.com/a/chromium.org/chromedriver/).

### How do I start the application?
After [installing] (https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/installation.md), in the root folder run the following command:
Expand Down
22 changes: 21 additions & 1 deletion pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,17 @@ def report_summary(bot):
return # Bot didn't actually start, no metrics to show.

metrics = bot.metrics
metrics.capture_stats()
try:
metrics.capture_stats()
except NotLoggedInException:
bot.event_manager.emit(
'api_error',
sender=bot,
level='info',
formatted='Not logged in, reconnecting in {:d} seconds'.format(5)
)
time.sleep(5)
return
logger.info('')
logger.info('Ran for {}'.format(metrics.runtime()))
logger.info('Total XP Earned: {} Average: {:.2f}/h'.format(metrics.xp_earned(), metrics.xp_per_hour()))
Expand Down Expand Up @@ -415,6 +425,15 @@ def _json_loader(filename):
type=bool,
default=True
)
add_config(
parser,
load,
short_flag="-sc",
long_flag="--solve_captcha",
help="Enable manual or automatic captcha solving",
type=bool,
default=False
)
add_config(
parser,
load,
Expand Down Expand Up @@ -739,6 +758,7 @@ def _json_loader(filename):
config.encrypt_location = load.get('encrypt_location', '')
config.telegram_token = load.get('telegram_token', '')
config.discord_token = load.get('discord_token', '')
config.twocaptcha_token = load.get('2captcha_token', '')
config.catch = load.get('catch', {})
config.release = load.get('release', {})
config.plugins = load.get('plugins', [])
Expand Down
Loading

0 comments on commit cb9837c

Please sign in to comment.