Skip to content

Commit

Permalink
get last release from dev
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/dev' into dev
  • Loading branch information
Gurzeh committed Aug 16, 2016
2 parents 26c4b01 + e68c2e8 commit aaaa480
Show file tree
Hide file tree
Showing 29 changed files with 522 additions and 146 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@
* Quantra
* pmquan
* net8q
* SyncX
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Disclaimer
©2016 Niantic, Inc. ©2016 Pokémon. ©1995–2016 Nintendo / Creatures Inc. / GAME FREAK inc. © 2016 Pokémon/Nintendo Pokémon and Pokémon character names are trademarks of Nintendo. The Google Maps Pin is a trademark of Google Inc. and the trade dress in the product design is a trademark of Google Inc. under license to The Pokémon Company. Other trademarks are the property of their respective owners.
[Privacy Policy](http://www.pokemon.com/us/privacy-policy/)

[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is intended for academic purposes and should not be used to play the game *PokemonGo* as it violates the TOS and is unfair to the community. Use the bot **at your own risk**.

[PokemonGoF](https://github.com/PokemonGoF) does not support the use of 3rd party apps or apps that violate the TOS.

# PokemonGo-Bot
PokemonGo bot is a project created by the [PokemonGoF](https://github.com/PokemonGoF) team.

Expand Down
3 changes: 2 additions & 1 deletion configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"max_circle_size": 50
},
"websocket_server": false,
"walk": 4.16,
"walk_max": 4.16,
"walk_min": 2.16,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
Expand Down
20 changes: 18 additions & 2 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"location": "SOME_LOCATION",
"gmapkey": "GOOGLE_MAPS_API_KEY",
"encrypt_location": "",
"websocket_server": false,
"heartbeat_threshold": 10,
"tasks": [
{
"type": "HandleSoftBan"
Expand Down Expand Up @@ -64,6 +66,10 @@
"type": "RecycleItems",
"config": {
"min_empty_space": 15,
"max_balls_keep": 150,
"max_potions_keep": 50,
"max_berries_keep": 70,
"max_revives_keep": 70,
"item_filter": {
"Pokeball": { "keep" : 100 },
"Potion": { "keep" : 10 },
Expand Down Expand Up @@ -104,8 +110,8 @@
"max_circle_size": 50,
"cache_recent_forts": true
},
"websocket_server": false,
"walk": 4.16,
"walk_max": 4.16,
"walk_min": 2.16,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
Expand All @@ -130,6 +136,16 @@
"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
15 changes: 13 additions & 2 deletions configs/config.json.map.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"location": "SOME_LOCATION",
"gmapkey": "GOOGLE_MAPS_API_KEY",
"encrypt_location": "",
"heartbeat_threshold": 10,
"tasks": [
{
"type": "HandleSoftBan"
Expand Down Expand Up @@ -78,7 +79,6 @@
"config": {
"address": "http://localhost:5000",
"max_distance": 500,
"min_time": 60,
"min_ball": 50,
"prioritize_vips": true,
"snipe": true,
Expand Down Expand Up @@ -331,7 +331,8 @@
"max_circle_size": 50
},
"websocket_server": false,
"walk": 4.16,
"walk_max": 4.16,
"walk_min": 2.16,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
Expand All @@ -343,6 +344,16 @@
"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
31 changes: 22 additions & 9 deletions configs/config.json.optimizer.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,25 @@
"// at false, you will still get the log information of what the": {},
"// optimizer would have evolved if the parameter was true": {},
"evolve": true,
"// the 'use_candies_for_xp' parameter let you choose if you want the optimizer": {},
"// Time in seconds to wait between two evolve": {},
"evolve_time": 20,
"// the 'evolve_for_xp' parameter let you choose if you want the optimizer": {},
"// to use your candies to evolve low quality pokemons in order to maximize your xp": {},
"// at false, the optimizer will still use candies to evolve your best Pokemons": {},
"use_candies_for_xp": true,
"// the 'use_lucky_egg' parameter let you choose if you want the optimizer": {},
"// to use a lucky egg right before evolving Pokemons. At false; the optimizer": {},
"// is free to evolve Pokemons even if you do not have any lucky egg.": {},
"use_lucky_egg": true,
"evolve_for_xp": true,
"// the 'evolve_only_with_lucky_egg' parameter let you choose if you want the optimizer": {},
"// to only Evolve Pokemons when a lucky egg is available": {},
"evolve_only_with_lucky_egg": true,
"// the 'minimum_evolve_for_lucky_egg' parameter let you define the minimum": {},
"// the 'evolve_count_for_lucky_egg' parameter let you define the minimum": {},
"// number of Pokemons that must evolve before using a lucky egg": {},
"// If that number is not reached, and evolve_only_with_lucky_egg is true, evolution will be skipped": {},
"// If that number is not reached, and evolve_only_with_lucky_egg is false,": {},
"// evolution will be performed without using a lucky egg": {},
"minimum_evolve_for_lucky_egg": 90,
"evolve_count_for_lucky_egg": 90,
"// the 'may_use_lucky_egg' parameter let you choose if you want the optimizer": {},
"// to use a lucky egg right before evolving Pokemons. At false; the optimizer": {},
"// is free to evolve Pokemons even if you do not have any lucky egg.": {},
"may_use_lucky_egg": true,
"// the 'keep' parameter let you define what pokemons you consider are the 'best'. These Pokemons": {},
"// will be keep and evolved. Note that Pokemons are evaluated inside their whole family": {},
"// Multiple way of ranking can be defined. Following configuration let you keep the best iv,": {},
Expand Down Expand Up @@ -137,9 +139,20 @@
"max_circle_size": 50
},
"websocket_server": true,
"walk": 4.16,
"walk_max": 4.16,
"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,
Expand Down
13 changes: 12 additions & 1 deletion configs/config.json.path.example
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"max_circle_size": 50
},
"websocket_server": false,
"walk": 4.16,
"walk_max": 4.16,
"walk_min": 2.16,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
Expand All @@ -102,6 +103,16 @@
"reconnecting_timeout": 15,
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"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
},
"min_ultraball_to_keep": 10,
"logging_color": true,
"catch": {
Expand Down
7 changes: 6 additions & 1 deletion configs/config.json.pokemon.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"location": "SOME_LOCATION",
"gmapkey": "GOOGLE_MAPS_API_KEY",
"encrypt_location": "",
"heartbeat_threshold": 10,
"tasks": [
{
"type": "HandleSoftBan"
Expand Down Expand Up @@ -97,9 +98,12 @@
"max_circle_size": 50
},
"websocket_server": false,
"walk": 4.16,
"walk_max": 4.16,
"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,
Expand All @@ -108,6 +112,7 @@
"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": {
Expand Down
61 changes: 59 additions & 2 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
| `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 |
| `walk` | 4.16 | Set the walking speed in kilometers per hour. (14 km/h is the maximum speed for egg hatching) |
| `walk_max` | 4.16 | Set the maximum walking speed (1 is about 1.5km/hr)
| `walk_min` | 2.16 | Set the minimum walking speed (1 is about 1.5km/hr)
| `action_wait_min` | 1 | Set the minimum time setting for anti-ban time randomizer
| `action_wait_max` | 4 | Set the maximum time setting for anti-ban time randomizer
| `debug` | false | Let the default value here except if you are developer |
Expand Down Expand Up @@ -45,8 +46,12 @@ The behaviors of the bot are configured via the `tasks` key in the `config.json`
* RecycleItems

> **NOTE:** It's highly recommended to put this task before MoveToFort and SpinFort tasks. This way you'll most likely be able to loot.
* `item_filter`: Pass a list of unwanted [items (using their JSON codes or names)](https://github.com/PokemonGoF/PokemonGo-Bot/wiki/Item-ID's) to recycle.
* `min_empty_space`: Default `6` | Minimum empty space to keep in inventory. Once the inventory has less empty space than that amount, the recycling process is triggered. Set it to the inventory size to trigger it at every tick.
* `item_filter`: Pass a list of unwanted [items (using their JSON codes or names)](https://github.com/PokemonGoF/PokemonGo-Bot/wiki/Item-ID's) to recycle.
* `max_balls_keep`: Default `None` | Maximum amount of balls to keep in inventory
* `max_potions_keep`: Default `None` | Maximum amount of potions to keep in inventory
* `max_berries_keep`: Default `None` | Maximum amount of berries to keep in inventory
* `max_revives_keep`: Default `None` | Maximum amount of revives to keep in inventory
* SpinFort
* TransferPokemon

Expand Down Expand Up @@ -285,6 +290,58 @@ Key | Info
}
```

## `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.

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

```
"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
}
```

### Settings Description

Setting | Description
---- | ----
`flee_count` | The maximum number of times catching animation will play before the pokemon breaks free
`flee_duration` | The length of time for each animation
`catch_wait_min`| The minimum amount of time to throw the ball
`catch_wait_max`| The maximum amount of time to throw the ball
`berry_wait_min`| The minimum amount of time to use a berry
`berry_wait_max`| The maximum amount of time to use a berry
`changeball_wait_min`| The minimum amount of time to change ball
`changeball_wait_max`| The maximum amount of time to change ball

### `flee_count` and `flee_duration`
This part is app simulation and the default settings are advised. When we hit a pokemon in the app the animation will play randomly 1, 2 or 3 times for roughly 2 seconds each time. So we pause for a random number of animations up to `flee_count` of duration `flee_duration`

### Previous Behaviour
If you want to make your bot behave as it did prior to this update please use the following settings.

```
"catch_simulation": {
"flee_count": 1,
"flee_duration": 2,
"catch_wait_min": 0,
"catch_wait_max": 0,
"berry_wait_min": 0,
"berry_wait_max": 0,
"changeball_wait_min": 0,
"changeball_wait_max": 0
}
```

## Sniping _(MoveToLocation)_

### Description
Expand Down
41 changes: 36 additions & 5 deletions pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,20 @@ def _json_loader(filename):
add_config(
parser,
load,
short_flag="-w",
long_flag="--walk",
short_flag="-wmax",
long_flag="--walk_max",
help=
"Walk instead of teleport with given speed (meters per second, e.g. 2.5)",
"Walk instead of teleport with given speed",
type=float,
default=2.5
)
add_config(
parser,
load,
short_flag="-wmin",
long_flag="--walk_min",
help=
"Walk instead of teleport with given speed",
type=float,
default=2.5
)
Expand Down Expand Up @@ -482,7 +492,14 @@ def _json_loader(filename):
type=float,
default=1
)

add_config(
parser,
load,
long_flag="--heartbeat_threshold",
help="A threshold between each heartbeat sending to server",
type=int,
default=10
)
# Start to parse other attrs
config = parser.parse_args()
if not config.username and 'username' not in load:
Expand All @@ -499,6 +516,16 @@ def _json_loader(filename):
config.raw_tasks = load.get('tasks', [])
config.min_ultraball_to_keep = load.get('min_ultraball_to_keep', None)

catchsim_config = load.get('catch_simulation', {})
config.catchsim_catch_wait_min = catchsim_config.get('catch_wait_min', 2)
config.catchsim_catch_wait_max = catchsim_config.get('catch_wait_max', 6)
config.catchsim_flee_count = int(catchsim_config.get('flee_count', 3))
config.catchsim_flee_duration = catchsim_config.get('flee_duration', 2)
config.catchsim_berry_wait_min = catchsim_config.get('berry_wait_min', 2)
config.catchsim_berry_wait_max = catchsim_config.get('berry_wait_max', 3)
config.catchsim_changeball_wait_min = catchsim_config.get('changeball_wait_min', 2)
config.catchsim_changeball_wait_max = catchsim_config.get('changeball_wait_max', 3)

config.vips = load.get('vips', {})

if config.map_object_cache_time < 0.0:
Expand All @@ -521,7 +548,8 @@ def task_configuration_error(flag_name):
""".format(flag_name))

old_flags = ['mode', 'catch_pokemon', 'spin_forts', 'forts_spin', 'hatch_eggs', 'release_pokemon', 'softban_fix',
'longer_eggs_first', 'evolve_speed', 'use_lucky_egg', 'item_filter', 'evolve_all', 'evolve_cp_min', 'max_steps']
'longer_eggs_first', 'evolve_speed', 'use_lucky_egg', 'item_filter', 'evolve_all', 'evolve_cp_min',
'max_steps']
for flag in old_flags:
if flag in load:
task_configuration_error(flag)
Expand All @@ -536,6 +564,9 @@ def task_configuration_error(flag_name):
if "evolve_captured" in load:
logger.warning('The evolve_captured argument is no longer supported. Please use the EvolvePokemon task instead')

if "walk" in load:
logger.warning('The walk argument is no longer supported. Please use the walk_max and walk_min variables instead')

if not (config.location or config.location_cache):
parser.error("Needs either --use-location-cache or --location.")
return None
Expand Down
Loading

0 comments on commit aaaa480

Please sign in to comment.