Skip to content

Commit

Permalink
Merge pull request #5958 from PokemonGoF/dev
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
pogarek authored Mar 7, 2017
2 parents f39aaa3 + 41cf5dd commit 10b8895
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"config": {
"enabled": true,
"infinite_longer_eggs_first": false,
"infinite_random_eggs": false,
"breakable_longer_eggs_first": true,
"min_interval": 120,
"infinite": [
Expand Down
23 changes: 12 additions & 11 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ The behaviors of the bot are configured via the `tasks` key in the `config.json`
* IncubateEggs
* `enable`: Disable or enable this task.
* `longer_eggs_first`: Depreciated
* `infinite_longer_eggs_first`: Default `true` | Prioritize longer eggs in perminent incubators.
* `breakable_longer_eggs_first`: Default `false` | Prioritize longer eggs in breakable incubators.
* `infinite_longer_eggs_first`: Default `false` | Prioritize longer eggs in perminent incubators.
* `infinite_random_eggs`: Default `false` | Put a random egg in perminent incubators.
* `breakable_longer_eggs_first`: Default `true` | Prioritize longer eggs in breakable incubators.
* `min_interval`: Default `120` | Minimum number of seconds between incubation updates.
* `infinite`: Default `[2,5,10]` | Types of eggs to be incubated in permanent incubators.
* `breakable`: Default `[2,5,10]` | Types of eggs to be incubated in breakable incubators.
Expand Down Expand Up @@ -775,7 +776,7 @@ This task is an upgrade version of the MoveToMapPokemon task. It will fetch poke
* `mode` - The mode on which the sniper will fetch the informations. (default: social)
- `social` - Information will come from the social network.
- `url` - Information will come from one or multiple urls.
- `telegram` - Manual snipping through telegram. In telegram, use "/snipe <PokemonName> <Lat> <Lng>" to snipe. Subscript to "/sub sniper_log" and "/sub pokemon_vip_caught" to retrieve snipping results through telegram.
- `telegram` - Manual snipping through telegram. In telegram, use "/snipe <PokemonName> <Lat> <Lng>" to snipe. Subscript to "/sub sniper_log" and "/sub pokemon_vip_caught" to retrieve snipping results through telegram.
* `bullets` - Each bullet corresponds to an **ATTEMPT** of catching a pokemon. (default: 1)
* `homing_shots` - This will ensure that each bullet **will catch** a target. If disabled, a target might not exist and thus it wont be caught. When enabled, this will jump to the next target (if any) and try again to catch it. This will be repeated untill you've spent all the bullets. (default: true)
* `special_iv` - This will skip the catch list if the value is greater than or equal to the target's IV. This currently does not work with `social` mode and only works if the given `url` has this information. (default: 100)
Expand Down Expand Up @@ -886,11 +887,11 @@ This task is an upgrade version of the MoveToMapPokemon task. It will fetch poke
### Description
[[back to top](#table-of-contents)]

Walk to the specified locations loaded from .gpx or .json file. It is highly
recommended to use website such as [GPSies](http://www.gpsies.com) which allow
you to export your created track in JSON file. Note that you'll have to first
convert its JSON file into the format that the bot can understand. See [Example
of pier39.json] below for the content. I had created a simple python script to
Walk to the specified locations loaded from .gpx or .json file. It is highly
recommended to use website such as [GPSies](http://www.gpsies.com) which allow
you to export your created track in JSON file. Note that you'll have to first
convert its JSON file into the format that the bot can understand. See [Example
of pier39.json] below for the content. I had created a simple python script to
do the conversion.

The `location` fields in the `.json` file can also contain a street address. In
Expand All @@ -903,9 +904,9 @@ MoveToFort task. This allows the bot to walk around the waypoint looking for
forts for a limited time.

The `loiter` field, also optional for each point in the json file, works
similarly to the `wander` field. The difference is that with `loiter` the
next `Task` in the configuration file is /not/ executed, meaning the bot
will wait, without moving, at the point in the json file with the `loiter`
similarly to the `wander` field. The difference is that with `loiter` the
next `Task` in the configuration file is /not/ executed, meaning the bot
will wait, without moving, at the point in the json file with the `loiter`
option.

### Options
Expand Down
4 changes: 4 additions & 0 deletions pokemongo_bot/cell_workers/incubate_eggs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import Counter
from datetime import datetime, timedelta
import random

from pokemongo_bot import inventory
from pokemongo_bot.human_behaviour import sleep
Expand Down Expand Up @@ -29,6 +30,7 @@ def initialize(self):

def _process_config(self):
self.infinite_longer_eggs_first = self.config.get("infinite_longer_eggs_first", False)
self.infinite_random_eggs = self.config.get("infinite_random_eggs", False)
self.breakable_longer_eggs_first = self.config.get("breakable_longer_eggs_first", True)
self.min_interval = self.config.get('min_interval', 120)
self.breakable_incubator = self.config.get("breakable", [2,5,10])
Expand Down Expand Up @@ -59,6 +61,8 @@ def work(self):
# get available eggs
eggs = self._filter_sort_eggs(self.infinite_incubator,
self.infinite_longer_eggs_first)
if self.infinite_random_eggs:
eggs = random.shuffle(eggs)
self._apply_incubators(eggs, self.ready_infinite_incubators)
if self.ready_breakable_incubators:
# get available eggs
Expand Down
2 changes: 1 addition & 1 deletion web
Submodule web updated 105 files

0 comments on commit 10b8895

Please sign in to comment.