Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev merge to master #5060

Merged
merged 64 commits into from
Sep 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
88b4006
Update merge (#1)
DBa2016 Aug 30, 2016
8e8b4ab
Update merge (#2)
DBa2016 Aug 30, 2016
55e208a
Merge pull request #3 from PokemonGoF/master
DBa2016 Aug 30, 2016
6e8fddc
Merge pull request #4 from PokemonGoF/dev
DBa2016 Aug 30, 2016
1bdfc1b
Updated docs for MoveToMap
DBa2016 Aug 30, 2016
8ff373a
Split max_distance into max_sniping_distance and max_walking_distance
Jasperrr91 Aug 31, 2016
df66a23
Update configuration_filse.md
Jasperrr91 Aug 31, 2016
4cce548
Merge pull request #4978 from Jasperrr91/dev
solderzzc Aug 31, 2016
eada9c7
more debugging
askovpen Aug 31, 2016
b2abba0
more debugging config
askovpen Aug 31, 2016
285e84e
more debugging doc
askovpen Aug 31, 2016
755be7e
Add upgrade_level parameter
julienlavergne Aug 31, 2016
4b460a0
Merge branch 'dev' into dev
DBa2016 Aug 31, 2016
a44235b
Merge pull request #4969 from DBa2016/dev
Jasperrr91 Aug 31, 2016
7384da3
Merge pull request #5 from PokemonGoF/dev
DBa2016 Aug 31, 2016
612c9a6
Merge pull request #6 from Anakin5/po
DBa2016 Aug 31, 2016
50320ec
Merge pull request #4982 from Anakin5/po
solderzzc Aug 31, 2016
2bafce1
Merge pull request #4988 from askovpen/dev
solderzzc Aug 31, 2016
75c1739
Update installation.md
walkerlee Aug 31, 2016
a674b26
Merge pull request #4998 from walkerlee/dev
solderzzc Aug 31, 2016
6b2bd26
Merge pull request #7 from PokemonGoF/dev
DBa2016 Aug 31, 2016
99bdd37
recent_forts sanity check
rawgni Aug 31, 2016
30b8f16
Merge pull request #5005 from rawgni/p1
solderzzc Aug 31, 2016
f9875b6
Update config.json.map.example
BreezeRo Aug 31, 2016
9390e14
pretty print awarded item (#5016)
rawgni Aug 31, 2016
a7fb0ed
Update config.json.map.example (#5015)
sohje Aug 31, 2016
99c6380
Nickname delay
Aug 31, 2016
0e02ee9
fix inventory, only call level_up_reward api when needed, up-to-date …
rawgni Aug 31, 2016
6c6ec2f
fix self._level
rawgni Aug 31, 2016
6676182
Added debug event 'forts_found'
solderzzc Aug 31, 2016
16e80ad
Added quitting notify to telegram.
solderzzc Aug 31, 2016
ab56f49
Merge pull request #5022 from PokemonGoF/catch_limit_notify_to_telegram
solderzzc Aug 31, 2016
f870584
Merge pull request #5018 from alexyaoyang/dev
solderzzc Aug 31, 2016
f168e91
Merge pull request #5013 from rawgni/p2
solderzzc Aug 31, 2016
130e323
Update installation.md
flavioheleno Aug 31, 2016
b539a5f
Merge pull request #8 from PokemonGoF/dev
DBa2016 Aug 31, 2016
3cd30b6
Merge pull request #5023 from flavioheleno/patch-1
solderzzc Aug 31, 2016
9989632
Provided a default for max_walking_distance and max_sniping_distance in
DBa2016 Aug 31, 2016
a761780
Added protection from exception:
solderzzc Aug 31, 2016
f73455c
Merge branch 'dev' of https://github.com/PokemonGoF/PokemonGo-Bot int…
solderzzc Aug 31, 2016
53785ca
handle IndexError in Polyline do not raise
th3w4y Sep 1, 2016
624235e
Fixed spelling error in installation.md
gabewert Sep 1, 2016
643c745
Fix nickname (#5031)
DBa2016 Sep 1, 2016
b2041fa
hatch egg update player exp
rawgni Sep 1, 2016
2efc899
fix #5019
rawgni Sep 1, 2016
897a274
Merge pull request #5026 from th3w4y/issue#5020
solderzzc Sep 1, 2016
da47ad8
Merge pull request #5027 from DBa2016/fix_distance
solderzzc Sep 1, 2016
a6f1f72
Merge pull request #5030 from gabewert/patch-2
solderzzc Sep 1, 2016
1c27516
Merge pull request #5034 from rawgni/hatching_egg_get_xp_too
solderzzc Sep 1, 2016
7c6393b
Merge pull request #5036 from rawgni/lvl_up_pretty_print_bug
solderzzc Sep 1, 2016
2e6bddc
Changed level of log to debug.
solderzzc Sep 1, 2016
bace0b4
Merge branch 'dev' into add_forts_event
solderzzc Sep 1, 2016
d5059ed
Merge pull request #5040 from PokemonGoF/add_forts_event
oralunal Sep 1, 2016
4b0ad4f
PokemonGo-Bot-Configurator update
LuckyMe4Evers Sep 1, 2016
23772ba
Add xp earned to player xp
julienlavergne Sep 1, 2016
6f4a7e0
Default empty sorting
julienlavergne Sep 1, 2016
83a1584
Update pokecli.py
sohje Sep 1, 2016
6202733
Make all pokemon names lowercase strings to be able to compare
DeXtroTip Sep 1, 2016
41f1a91
Merge pull request #5044 from LuckyMe4Evers/dev
solderzzc Sep 1, 2016
6d84d89
Merge pull request #5048 from Anakin5/po
solderzzc Sep 1, 2016
e30b359
Merge pull request #5049 from sohje/patch-4
solderzzc Sep 1, 2016
79469dc
Merge pull request #5055 from DeXtroTip/fix_evolve_pokemon
solderzzc Sep 1, 2016
67c3b85
Move subscribe into on_connect.
solderzzc Sep 1, 2016
7f53d65
Merge pull request #5059 from PokemonGoF/change_subscribe_to_on_conne…
solderzzc Sep 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
"config": {
"enabled": false,
"nickname_above_iv": 0.9,
"nickname_template": "{iv_pct}_{iv_ads}"
"nickname_template": "{iv_pct}_{iv_ads}",
"nickname_wait_min": 3,
"nickname_wait_max": 5
}
},
{
Expand Down
7 changes: 5 additions & 2 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
"config": {
"enabled": false,
"nickname_above_iv": 0.9,
"nickname_template": "{iv_pct}_{iv_ads}"
"nickname_template": "{iv_pct}_{iv_ads}",
"nickname_wait_min": 3,
"nickname_wait_max": 5
}
},
{
Expand Down Expand Up @@ -285,7 +287,8 @@
"color": true,
"show_datetime": true,
"show_process_name": true,
"show_log_level": true
"show_log_level": true,
"show_thread_name": false
},
"catch": {
"any": {"candy_threshold" : 400 ,"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
Expand Down
10 changes: 7 additions & 3 deletions configs/config.json.map.example
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
"config": {
"enabled": false,
"nickname_above_iv": 0.9,
"nickname_template": "{iv_pct}_{iv_ads}"
"nickname_template": "{iv_pct}_{iv_ads}",
"nickname_wait_min": 3,
"nickname_wait_max": 5
}
},
{
Expand Down Expand Up @@ -189,8 +191,10 @@
"config": {
"enabled": true,
"address": "http://localhost:5000",
"//NOTE: Change the max_distance to adjust the max sniping range (km)": {},
"max_distance": 500,
"//NOTE: Change the max_sniping_distance to adjust the max sniping range (m)": {},
"max_sniping_distance": 10000,
"//NOTE: Change the max_walking_distance to adjust the max walking range when snipe is off (m)": {},
"max_walking_distance": 500,
"min_ball": 50,
"prioritize_vips": true,
"snipe": true,
Expand Down
5 changes: 3 additions & 2 deletions configs/config.json.optimizer.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"evolve_count_for_lucky_egg": 80,
"may_use_lucky_egg": true,
"upgrade": true,
"upgrade_level": 60,
"groups": {
"gym": ["Dragonite", "Snorlax", "Lapras", "Arcanine"]
},
Expand All @@ -28,7 +29,7 @@
{
"mode": "by_family",
"top": 1,
"sort": [{"ncp": "0.9"}],
"sort": [{"ncp": 0.9}],
"evolve": true,
"upgrade": false
},
Expand All @@ -43,7 +44,7 @@
"mode": "by_family",
"names": ["gym"],
"top": 3,
"sort": [{"iv": 0.9}, {"ncp": "0.9"}],
"sort": [{"iv": 0.9}, {"ncp": 0.9}],
"evolve": true,
"upgrade": true
}
Expand Down
4 changes: 3 additions & 1 deletion configs/config.json.path.example
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
"config": {
"enabled": false,
"nickname_above_iv": 0.9,
"nickname_template": "{iv_pct}_{iv_ads}"
"nickname_template": "{iv_pct}_{iv_ads}",
"nickname_wait_min": 3,
"nickname_wait_max": 5
}
},
{
Expand Down
4 changes: 3 additions & 1 deletion configs/config.json.pokemon.example
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
"config": {
"enabled": false,
"nickname_above_iv": 0.9,
"nickname_template": "{iv_pct}_{iv_ads}"
"nickname_template": "{iv_pct}_{iv_ads}",
"nickname_wait_min": 3,
"nickname_wait_max": 5
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/pokemon_upgrade_cost.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
[3, 3000],
[3, 3000],
[3, 3000],
[3, 3000],
[3, 3500],
[3, 3500],
[3, 3500],
[3, 3500],
Expand Down
20 changes: 15 additions & 5 deletions docs/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Document the configuration options of PokemonGo-Bot.
'logging'.'show_datetime' (default true) Show date and time in log
'logging'.'show_process_name' (default true) Show name of process generating output in log
'logging'.'show_log_level' (default true) Show level of log message in log (eg. "INFO")
'logging'.'show_thread_name' (default false) Show name of thread in log

## Configuring Tasks
[[back to top](#table-of-contents)]
Expand Down Expand Up @@ -606,13 +607,14 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i
[[back to top](#table-of-contents)]

* `Address` - Address of the webserver of PokemonGo-Map. ex: `http://localhost:5000`
* `Mode` - Which mode to run snipin on
* `Mode` - Which mode to run sniping on
- `distance` - Will move to the nearest pokemon
- `priority` - Will move to the pokemon with the highest priority assigned (tie breaking by distance)
* `prioritize_vips` - Will prioritize vips in distance and priority mode above all normal pokemon if set to true
* `min_time` - Minimum time the pokemon has to be available before despawn
* `min_ball` - Minimum amount of balls required to run task
* `max_distance` - Maximum distance the pokemon is allowed to be when sniping. (km)
* `max_sniping_distance` - Maximum distance the pokemon is allowed to be caught when sniping. (m)
* `max_walking_distance` - Maximum distance the pokemon is allowed to be caught when sniping is turned off. (m)
* `snipe`:
- `True` - Will teleport to target pokemon, encounter it, teleport back then catch it
- `False` - Will walk normally to the pokemon
Expand All @@ -621,8 +623,14 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i
* `snipe_high_prio_only` - Whether to snipe pokemon above a certain threshold.
* `snipe_high_prio_threshold` - The threshold number corresponding with the `catch` dictionary.
* - Any pokemon above this threshold value will be caught by teleporting to its location, and getting back to original location if `snipe` is `True`.
* - Any pokemon under this threshold value will make the bot walk to the Pokemon target wether `snipe` is `True` or `False`.
* - Any pokemon under this threshold value will make the bot walk to the Pokemon target whether `snipe` is `True` or `False`.
* `max_extra_dist_fort` : Percentage of extra distance allowed to move to a fort on the way to the targeted Pokemon
* `debug` : Output additional debugging information
* `skip_rounds` : Try to snipe every X rounds
* `update_map_min_distance_meters` : Update map if more than X meters away
* `update_map_min_time_sec` : Update map if older than X seconds
* `snipe_sleep_sec` : Sleep for X seconds after snipes
* `snipe_max_in_chain` : Maximum snipes in chain

#### Example
[[back to top](#table-of-contents)]
Expand All @@ -634,8 +642,10 @@ This task will fetch current pokemon spawns from /raw_data of an PokemonGo-Map i
"type": "MoveToMapPokemon",
"config": {
"address": "http://localhost:5000",
"//NOTE: Change the max_distance to adjust the max sniping range (km)": {},
"max_distance": 500,
"//NOTE: Change the max_sniping_distance to adjust the max sniping range (m)": {},
"max_sniping distance": 10000,
"//NOTE: Change the max_walking_distance to adjust the max walking range when snipe is off (m)": {},
"max__walking_distance": 500,
"min_time": 60,
"min_ball": 50,
"prioritize_vips": true,
Expand Down
18 changes: 11 additions & 7 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
for manual installation please refer to [here](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/manual_installation.md)

# Windows
We do recommend Windows users to use [Docker](#docker) this will work much easier and smoother (also saver)
We do recommend Windows users to use [Docker](#docker) this will work much easier and smoother (also safer)

## Requirements

Expand Down Expand Up @@ -58,15 +58,13 @@ Once you have Docker installed, simply create the various config files for your

```
cd PokemonGo-Bot
docker build --build-arg TIMEZONE=Europe/London -t pokemongo-bot .
docker build -t pokemongo-bot .
```

Optionally you can set your timezone with the --build-arg option (default is Etc/UTC). You can find an exhaustive list of timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

By default our Dockerfile ensures that the "master" branch will be used for building the docker container, if you want to use the "dev" branch then you should build the container with below build command:

```
docker build --build-arg TIMEZONE=Europe/London --build-arg BUILD_BRANCH=dev -t pokemongo-bot .
docker build --build-arg BUILD_BRANCH=dev -t pokemongo-bot .
```


Expand All @@ -83,6 +81,12 @@ To run the bot container with the PokemonGo-Bot Docker image you've created:
docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
```

Optionally you can set your timezone with the -e option (default is Etc/UTC). You can find an exhaustive list of timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

```
docker run --name=bot1-pokego --rm -it -e TIMEZONE=Asia/Taipei -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
```

>In the case you configured authentification to be handled by auth.json file make sure you mount that file as a volume also

>```
Expand All @@ -99,7 +103,7 @@ docker run --name=bot1-pokego --rm -it -v $(pwd)/configs:/usr/src/app/configs -v
Run a second container provided with the OpenPoGoBotWeb view:

```
docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer
docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/config/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer
```
The OpenPoGoWeb will be served on `http://<your host>:8000`

Expand All @@ -118,7 +122,7 @@ docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/ap
- Run the web container:

```
docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer
docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/config/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer
```

- Retrieve your host address:
Expand Down
38 changes: 35 additions & 3 deletions docs/pokemon_optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [evolve_count_for_lucky_egg](#evolve_count_for_lucky_egg)
- [may_use_lucky_egg](#may_use_lucky_egg)
- [upgrade](#upgrade)
- [upgrade_level](#upgrade_level)
- [groups](#groups)
- [keep](#keep)
- [mode](#keep-mode)
Expand Down Expand Up @@ -50,6 +51,7 @@ The Pokemon Optimizer manage transfer and evolution of your Pokemon.
"evolve_count_for_lucky_egg": 80,
"may_use_lucky_egg": true,
"upgrade": true,
"upgrade_level": 60,
"groups": {
"gym": ["Dragonite", "Snorlax", "Lapras", "Arcanine"]
},
Expand All @@ -64,7 +66,7 @@ The Pokemon Optimizer manage transfer and evolution of your Pokemon.
{
"mode": "by_family",
"top": 1,
"sort": [{"ncp": "0.9"}],
"sort": [{"ncp": 0.9}],
"evolve": true,
"upgrade": false
},
Expand All @@ -79,7 +81,7 @@ The Pokemon Optimizer manage transfer and evolution of your Pokemon.
"mode": "by_family",
"names": ["gym"],
"top": 3,
"sort": [{"iv": 0.9}, {"ncp": "0.9"}],
"sort": [{"iv": 0.9}, {"ncp": 0.9}],
"evolve": true,
"upgrade": true
}
Expand Down Expand Up @@ -180,7 +182,7 @@ Better quality Pokemon have priority for evolution and the Pokemon Optimizer wil

The below 2% rule help the Pokemon Optimizer to disregard rare Pokemon and focus on common Pokemon to evolve for xp.

#### 2% rule
###### 2% rule
For each family of Pokemon, if, after evolving your best Pokemon, you have enough candies left to evolve 2% of your total bag capacity, the first rank of the family are eligible for xp evolution.
<br>If you do not have enough candies or Pokemon to evolve these 2%, they will be transfered.

Expand Down Expand Up @@ -234,6 +236,8 @@ Define whether you allow the Pokemon Optimizer to use a lucky egg before evolvin
The `upgrade` parameter activate or deactivate the upgrade (power-up) of Pokemon.

At `true`, you allow the Pokemon Optimizer to upgrade every Pokemon that are the best according to your own criteria.
<br>If `evolve` is also activated, evolution has priority over upgrade.
Which means that the Pokemon Optimizer is going to wait that a Pokemon is fully evolved before upgrading it.
<br>At `false`, and regardless of other parameters, no Pokemon is ever going to be upgraded.
<br>`upgrade` parameter can be deactivated separately for each rule (see [`upgrade`](#keep-upgrade)).

Expand All @@ -245,6 +249,32 @@ It can help you rectify your configuration or guide you during manual power-up.

[[back to top](#pokemon-optimizer)]

### upgrade_level
| Parameter | Possible values | Default |
|-----------------|-----------------|---------|
| `upgrade_level` | `[1-80]` | `60` |

This the maximum level at which you want the Pokemon Optimizer to upgrade your Pokemon.
<br>Pokemon upgrade level cannot be higher than 2 times player level. The parameter value will be majored by `2 * player level`.

Pokemon are either fully upgraded to the maximum possible level or not upgraded at all.
The higher the level is, the more costly in candies and stardust it becomes to upgrade a Pokemon.

###### Cumulative upgrade cost (candy, stardust)

| From - To | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 |
|-----------|:---------:|:-----------:|:-----------:|:-----------:|:-----------:|:-------------:|:-------------:|:-------------:|
| 1 | 9<br>3000 | 19<br>11000 | 38<br>25500 | 58<br>47500 | 87<br>80000 | 126<br>125000 | 196<br>190000 | 319<br>280000 |
| 10 | | 10<br>8000 | 29<br>22500 | 49<br>44500 | 78<br>77000 | 117<br>122000 | 187<br>187000 | 310<br>277000 |
| 20 | | | 19<br>14500 | 39<br>36500 | 68<br>69000 | 107<br>114000 | 177<br>179000 | 300<br>269000 |
| 30 | | | | 20<br>22000 | 49<br>54500 | 88<br>99500 | 158<br>164500 | 281<br>254500 |
| 40 | | | | | 29<br>32500 | 68<br>77500 | 138<br>142500 | 261<br>232500 |
| 50 | | | | | | 39<br>45000 | 109<br>110000 | 232<br>200000 |
| 60 | | | | | | | 70<br>65000 | 193<br>155000 |
| 70 | | | | | | | | 123<br>90000 |

[[back to top](#pokemon-optimizer)]

### groups
| Parameter | Possible values | Default |
|-----------|-----------------|---------|
Expand Down Expand Up @@ -368,6 +398,8 @@ Define according to which criteria you want to sort your Pokemon.
| `iv_defense` | defense component of iv between 0 and 15 |
| `iv_stamina` | stamina component of iv between 0 and 15 |
| `dps` | raw dps based on the moves of the pokemon |
| `dps1` | raw dps of the fast attack |
| `dps2` | raw dps of the charge attack |
| `dps_attack` | estimated average dps when attacking |
| `attack_perfection` | ratio `dps_attack` / `best_dps_attack`. Return same order as `dps_attack` |
| `dps_defense` | estimated average dps when defending |
Expand Down
16 changes: 15 additions & 1 deletion pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@
if sys.version_info >= (2, 7, 9):
ssl._create_default_https_context = ssl._create_unverified_context

try:
import pkg_resources
pgoapi_version = pkg_resources.get_distribution("pgoapi").version
if pgoapi_version < '1.1.8':
print "Run following command to get latest update: `pip install -r requirements.txt --upgrade`"
sys.exit(1)
except pkg_resources.DistributionNotFound:
print 'Seems you forgot to install python modules.'
print 'Run: `pip install -r requirements.txt`'
sys.exit(1)
except ImportError as e:
print e
pass

logging.basicConfig(
level=logging.INFO,
format='%(asctime)s [%(name)10s] [%(levelname)s] %(message)s')
Expand Down Expand Up @@ -220,7 +234,7 @@ def get_commit_hash():
finally:
# Cache here on SIGTERM, or Exception. Check data is available and worth caching.
if bot:
if bot.recent_forts[-1] is not None and bot.config.forts_cache_recent_forts:
if len(bot.recent_forts) > 0 and bot.recent_forts[-1] is not None and bot.config.forts_cache_recent_forts:
cached_forts_path = os.path.join(
_base_dir, 'data', 'recent-forts-%s.json' % bot.config.username
)
Expand Down
Loading