Skip to content

Commit

Permalink
Bring together CatchVisiblePokemon & CatchLuredPokemon in config (#3966)
Browse files Browse the repository at this point in the history
* CatchPokemon calls CatchLuredPokemon and CatchVisiblePokemon methods.

Config now only needs one catch related worker.  All catch related config including option to catch lured and/or visible can be kept with the task.

* example config

* indentation

* defaults for catch_lured/visible_pokemon

* deprecated command line options for throw parameters

* catch_throw_parameters defaults match config.json.example

* added deprecation functionality for CatchVisiblePokemon and CatchLuredPokemon

* min_ultraball_to_keep default reflects example config

* tree_config_builder_test uses CatchPokemon instead of CatchLuredPokemon

* deprecation warning message

* catchsim config moved to CatchPokemon

* updated example configs

* updated docs
  • Loading branch information
Quantra authored and solderzzc committed Aug 17, 2016
1 parent e98b52c commit 805930d
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 182 deletions.
34 changes: 25 additions & 9 deletions configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,31 @@
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "CatchPokemon",
"config": {
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
}
},
{
"type": "SpinFort"
},
Expand All @@ -99,9 +118,6 @@
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"min_ultraball_to_keep": 10,
"logging_color": true,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
Expand Down
51 changes: 25 additions & 26 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,31 @@
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "CatchPokemon",
"config": {
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
}
},
{
"type": "SpinFort"
},
Expand Down Expand Up @@ -120,32 +139,12 @@
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"min_ultraball_to_keep": 10,
"logging_color": true,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
"// Example of always catching Rattata:": {},
"// Rattata": { "always_catch" : true }
},
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
"release": {
"any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
"// Example of always releasing Rattata:": {},
Expand Down
44 changes: 25 additions & 19 deletions configs/config.json.map.example
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,31 @@
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "CatchPokemon",
"config": {
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
}
},
{
"type": "SpinFort"
},
Expand Down Expand Up @@ -341,19 +360,6 @@
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"min_ultraball_to_keep": 10,
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
"logging_color": true,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
Expand Down
42 changes: 25 additions & 17 deletions configs/config.json.optimizer.example
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,31 @@
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "CatchPokemon",
"config": {
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
}
},
{
"type": "SpinFort",
"config": {
Expand All @@ -143,23 +162,12 @@
"walk_min": 2.16,
"action_wait_min": 1,
"action_wait_max": 4,
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
"debug": false,
"test": false,
"health_record": false,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"min_ultraball_to_keep": 10,
"logging_color": true,
"catch": {
"any": {
Expand Down
31 changes: 25 additions & 6 deletions configs/config.json.path.example
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,31 @@
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "CatchPokemon",
"config": {
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
}
},
{
"type": "SpinFort"
},
Expand Down
37 changes: 25 additions & 12 deletions configs/config.json.pokemon.example
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,31 @@
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "CatchPokemon",
"config": {
"catch_visible_pokemon": true,
"catch_lured_pokemon": true,
"min_ultraball_to_keep": 5,
"catch_throw_parameters": {
"excellent_rate": 0.1,
"great_rate": 0.5,
"nice_rate": 0.3,
"normal_rate": 0.1,
"spin_success_rate" : 0.6
},
"catch_simulation": {
"flee_count": 3,
"flee_duration": 2,
"catch_wait_min": 2,
"catch_wait_max": 6,
"berry_wait_min": 2,
"berry_wait_max": 3,
"changeball_wait_min": 2,
"changeball_wait_max": 3
},
}
},
{
"type": "SpinFort"
},
Expand Down Expand Up @@ -102,18 +121,12 @@
"walk_min": 2.16,
"action_wait_min": 1,
"action_wait_max": 4,
"catch_wait_min": 1,
"catch_wait_max": 4,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"randomize_flee_duration": true,
"min_ultraball_to_keep": 10,
"logging_color": true,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or" },
Expand Down
12 changes: 4 additions & 8 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
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).

### Task Options:
* CatchLuredPokemon
* CatchVisiblePokemon
* CatchPokemon
* EvolvePokemon
* `evolve_all`: Default `NONE` | Set to `"all"` to evolve Pokémon if possible when the bot starts. Can also be set to individual Pokémon as well as multiple separated by a comma. e.g "Pidgey,Rattata,Weedle,Zubat"
* `evolve_speed`: Default `20`
Expand Down Expand Up @@ -69,10 +68,7 @@ The following configuration tells the bot to transfer all the Pokemon that match
"type": "RecycleItems"
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
"type": "CatchPokemon"
},
{
"type": "SpinFort"
Expand Down Expand Up @@ -290,9 +286,9 @@ Key | Info
}
```

## `catch_simulation` Settings
## CatchPokemon `catch_simulation` Settings

These settings determine how the bot will simulate the app by adding pauses to throw the ball and navigate menus. All times are in seconds.
These settings determine how the bot will simulate the app by adding pauses to throw the ball and navigate menus. All times are in seconds. To configure these settings add them to the config in the CatchPokemon task.

### Default Settings
The default settings are 'safe' settings intended to simulate human and app behaviour.
Expand Down
Loading

0 comments on commit 805930d

Please sign in to comment.