Skip to content

Commit de8de50

Browse files
authored
Merge pull request #6097 from PokemonGoF/dev
Dev merge to master
2 parents c07fd94 + 825eba4 commit de8de50

File tree

16 files changed

+1295
-59
lines changed

16 files changed

+1295
-59
lines changed

Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,24 @@ RUN apk -U --no-cache add python py-pip tzdata \
2626
&& rm -rf /var/cache/apk/* \
2727
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f
2828

29-
ADD http://pgoapi.com/pgoencrypt.tar.gz /tmp/pgoencrypt.tar.gz
3029
ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt .
31-
RUN apk -U --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git \
32-
&& tar zxf /tmp/pgoencrypt.tar.gz -C /tmp \
33-
&& make -C /tmp/pgoencrypt/src \
34-
&& cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so \
35-
&& ln -s locale.h /usr/include/xlocale.h \
36-
&& pip install --no-cache-dir -r requirements.txt \
37-
&& apk del .build-dependencies \
38-
&& rm -rf /var/cache/apk/* /tmp/pgoencrypt* /usr/include/xlocale.h \
39-
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f
30+
31+
#Need to load cert for WGET
32+
RUN apk update
33+
RUN apk add ca-certificates wget
34+
RUN update-ca-certificates
35+
RUN wget -P /tmp/ http://pgoapi.com/pgoencrypt.tar.gz
36+
37+
RUN apk -U --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git
38+
RUN tar xvzf /tmp/pgoencrypt.tar.gz -C /tmp
39+
RUN make -C /tmp/pgoencrypt/src
40+
RUN cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so
41+
RUN ln -s locale.h /usr/include/xlocale.h
42+
RUN pip install --no-cache-dir -r requirements.txt
43+
RUN apk del .build-dependencies
44+
RUN rm -rf /var/cache/apk/* /tmp/pgoencrypt* /usr/include/xlocale.h
45+
RUN find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f
46+
4047

4148
ADD https://api.github.com/repos/$BUILD_REPO/commits/$BUILD_BRANCH /tmp/pgobot-version
4249
RUN apk -U --no-cache add --virtual .pgobot-dependencies wget ca-certificates tar jq \

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you need any help please don't create an issue as we have a great community o
3131
- #dev channel in slack
3232

3333
## Discord
34-
- [Click here to join discord server](https://discord.gg/n3g5puF)
34+
- [Click here to join discord server](https://discord.gg/n3g5puF) ---->RECOMENDED<----
3535

3636
### [Bugs / Issues](https://github.com/PokemonGoF/PokemonGo-Bot/issues?q=is%3Aissue+sort%3Aupdated-desc)
3737
If you discover a bug in the bot, please [search our issue tracker](https://github.com/PokemonGoF/PokemonGo-Bot/issues?q=is%3Aissue+sort%3Aupdated-desc) first. If it hasn't been reported, please [create a new issue](https://github.com/PokemonGoF/PokemonGo-Bot/issues/new) and ensure you follow the template guide so that our team can assist you as quickly as possible.
@@ -53,27 +53,25 @@ If this is your first time making a PR or aren't sure of the standard practice o
5353
- [x] Search Pokestops
5454
- [x] Catch Pokemon
5555
- [x] Determine which pokeball to use (uses Razz Berry if the catch percentage is low!)
56-
- [x] Exchange Pokemon as per configuration
57-
- [x] Evolve Pokemon as per configuration
56+
- [x] Exchange, evolve and catch Pokemon as per configuration
57+
- [x] Transfer Pokemon in bulk
5858
- [x] Auto switch mode (Inventory Checks - switches between catch/farming items)
5959
- [x] Limit the step to farm specific area for pokestops
60-
- [x] Rudimentary IV Functionality filter
61-
- [x] Ignore certain pokemon filter
60+
- [x] Limit Pokestops/catch Pokemons per day
61+
- [x] IV Functionality filter
6262
- [x] Adjust delay between Pokemon capture & Transfer as per configuration
6363
- [x] Hatch eggs
6464
- [x] Incubate eggs
65-
- [x] Crowd Sourced Map Prototype
66-
- [ ] [Standalone Desktop Application] (https://github.com/PokemonGoF/PokemonGo-Bot-Desktop)
6765
- [x] Use candy
66+
- [x] Set family ID as VIP and priorice bot to catch it!
67+
- [x] Spin Gyms pokestops
68+
- [x] Transfer red slashed pokemons
69+
- [x] Set shiny pokemons as VIP
70+
- [x] Deploy a pokemon in Gym if slot available
71+
- [x] Docker support
72+
- [x] Auto heal Pokemons
73+
- [x] Information about PGoAPI bot version is rather Bossland endpoint, expiration key date and RPM used
6874

69-
## Analytics
70-
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is very popular and has a vibrant community. Because of that, it has become very difficult for us to know how the bot is used and what errors people hit. By capturing small amounts of data, we can prioritize our work better such as fixing errors that happen to a large percentage of our user base, not just a vocal minority.
71-
72-
Our goal is to help inform our decisions by capturing data that helps us get aggregate usage and error reports, not personal information. To view the code that handles analytics in our master branch, you can use this [search link](https://github.com/PokemonGoF/PokemonGo-Bot/search?utf8=%E2%9C%93&q=BotEvent).
73-
74-
If there are any concerns with this policy or you believe we are tracking something we shouldn't, please open a ticket in the tracker. The contributors always intend to do the right thing for our users, and we want to make sure we are held to that path.
75-
76-
If you do not want any data to be gathered, you can turn off this feature by setting `health_record` to `false` in your `config.json`.
7775

7876
## Credits
7977
- [tejado](https://github.com/tejado) many thanks for the API
@@ -167,6 +165,14 @@ If you do not want any data to be gathered, you can turn off this feature by set
167165
* Gobberwart
168166
* javajohnHub
169167
* kolinkorr839
168+
* lepeli
169+
* davidakachaos
170+
* MerlionRock
171+
* walaoaaa1234
172+
* pogarek
173+
* goedzo
174+
* solderzzc aka BIG BOSS
175+
170176

171177
## Disclaimer
172178
©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.

configs/config.json.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,16 @@
464464
"enabled": true
465465
}
466466
},
467+
{
468+
"type": "GymPokemon",
469+
"config": {
470+
"enabled": false,
471+
"order_by": "cp",
472+
"min_interval":360,
473+
"min_recheck":30,
474+
"max_recheck":120
475+
}
476+
},
467477
{
468478
"type": "MoveToFort",
469479
"config": {
@@ -482,6 +492,7 @@
482492
"step_size": 70
483493
}
484494
}
495+
485496
],
486497
"map_object_cache_time": 5,
487498
"forts": {

docs/configuration_files.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
- [BuddyPokemon](#buddypokemon)
6464
- [PokemonHunter](#pokemonhunter)
6565
- [BadPokemon](#badpokemon)
66+
- [HealPokemon](#healpokemon)
6667

6768
# Configuration files
6869

@@ -1486,3 +1487,32 @@ If you have any Pokemon that Niantic has marked as bad (red slashes) this will n
14861487
}
14871488
}
14881489
```
1490+
1491+
## HealPokemon
1492+
[[back to top](#table-of-contents)]
1493+
1494+
### Description
1495+
[[back to top](#table-of-contents)]
1496+
1497+
If you have any Pokemon that are dead or need healing, this task will try to do that.
1498+
1499+
### Options
1500+
[[back to top](#table-of-contents)]
1501+
1502+
* `heal`: `Default: True`. Should Pokemon be healed?
1503+
* `revive`: `Default: True`. Should dead Pokemon be revived?
1504+
1505+
1506+
### Sample configuration
1507+
[[back to top](#table-of-contents)]
1508+
```json
1509+
{
1510+
"type": "BadPokemon",
1511+
"config": {
1512+
"enabled": true,
1513+
"heal": true,
1514+
"revive": true
1515+
}
1516+
}
1517+
```
1518+

pokemongo_bot/__init__.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,21 +372,23 @@ def _register_events(self):
372372
'moving_to_fort',
373373
parameters=(
374374
'fort_name',
375+
'target_type',
375376
'distance'
376377
)
377378
)
378379
self.event_manager.register_event(
379380
'moving_to_lured_fort',
380381
parameters=(
381382
'fort_name',
383+
'target_type',
382384
'distance',
383385
'lure_distance'
384386
)
385387
)
386388
self.event_manager.register_event(
387389
'spun_pokestop',
388390
parameters=(
389-
'pokestop', 'exp', 'items'
391+
'pokestop', 'exp', 'items', 'stop_kind', 'spin_amount_now'
390392
)
391393
)
392394
self.event_manager.register_event(
@@ -559,6 +561,8 @@ def _register_events(self):
559561
self.event_manager.register_event('catch_limit')
560562
self.event_manager.register_event('spin_limit')
561563
self.event_manager.register_event('show_best_pokemon', parameters=('pokemons'))
564+
self.event_manager.register_event('revived_pokemon')
565+
self.event_manager.register_event('healing_pokemon')
562566

563567
# level up stuff
564568
self.event_manager.register_event(
@@ -1725,6 +1729,25 @@ def get_forts(self, order_by_distance=False):
17251729
))
17261730

17271731
return forts
1732+
1733+
def get_gyms(self, order_by_distance=False):
1734+
forts = [fort
1735+
for fort in self.cell['forts']
1736+
if 'latitude' in fort and 'type' not in fort]
1737+
# Need to filter out disabled gyms!
1738+
forts = filter(lambda x: x["enabled"] is True, forts)
1739+
forts = filter(lambda x: 'closed' not in fort, forts)
1740+
# forts = filter(lambda x: 'type' not in fort, forts)
1741+
1742+
if order_by_distance:
1743+
forts.sort(key=lambda x: distance(
1744+
self.position[0],
1745+
self.position[1],
1746+
x['latitude'],
1747+
x['longitude']
1748+
))
1749+
1750+
return forts
17281751

17291752
def get_map_objects(self, lat, lng, timestamp, cellid):
17301753
if time.time() - self.last_time_map_object < self.config.map_object_cache_time:

pokemongo_bot/cell_workers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@
3434
from .catch_limiter import CatchLimiter
3535
from .update_hash_stats import UpdateHashStats
3636
from .bad_pokemon import BadPokemon
37+
from .heal_pokemon import HealPokemon
38+
from .gym_pokemon import GymPokemon

0 commit comments

Comments
 (0)