Skip to content

Commit

Permalink
Update merge (#1)
Browse files Browse the repository at this point in the history
* Expand simple logging options (PokemonGoF#4832)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Changed ) to } (PokemonGoF#4845)

Fixed an faulty character

* fix incubator logic (PokemonGoF#4848)

* corrected logic to respect snipe = true

* Update configuration_files.md (PokemonGoF#4854)

* corrected logic to respect snipe = true (PokemonGoF#4855)

* Revert "corrected logic to respect snipe = true" (PokemonGoF#4857)

* dont forget to update the docs when adding config changes... (PokemonGoF#4856)

* dont forget to update the docs when adding config changes...

* reflect config changes....

* please keep this as is (PokemonGoF#4859)

Add stuff in the right order.

* Clarify Max_distance for Sniping (PokemonGoF#4858)

* Clarify Max_distance

* Added distance unit and updated configuration_files.md

* - debug improvements for MoveToMap (PokemonGoF#4860)

- fix for Telegram to accept "@username" as "master", too, along with numeric  IDs

* Fixes catch rates. (PokemonGoF#4863)

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Add exceptions to json file read/writes (PokemonGoF#4877)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Incubate eggs fix (PokemonGoF#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* add some sanitycheck (PokemonGoF#4891)

* execute setup.sh -u if there is a need to (PokemonGoF#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (PokemonGoF#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* Improvements to evolve + config md updates (PokemonGoF#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* 2000 pokestop in 24h limit (PokemonGoF#4906)

* 2000 pokestop in 24h limit

* 2000 pokestop in 24h limit

* add config variable

* config update

* Update readme.md + Improve FollowPath & SleepSchedule messages (PokemonGoF#4911)

* Use logger for follow path loiter message

* Update readme.md

* Improve sleep message

* Allow follow_path to use config's distance unit

* Allow follow_path to use config's distance unit

* Reduce API calls (PokemonGoF#4916)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Update player data in web from metrics

Uses existing metrics instead of waiting on liveupdate

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Improvements to evolve + config md updates (PokemonGoF#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* Incubate eggs fix (PokemonGoF#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* add some sanitycheck (PokemonGoF#4891)

* execute setup.sh -u if there is a need to (PokemonGoF#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (PokemonGoF#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Refactoring to share inventory and reduce api calls

Modifications to share cached inventory and reduce overall required api
calls from 4 to 1. Only remaining api call comes from heartbeat which
updates the cached inventory for sanity reasons.

* Remove import of UpdateWebPlayerdata

Decided there was a better way to go with this, since both
UpdateWebInventory and UpdateWebPlayerdata share the same inventory
input/output, just different sections. Combined into UpdateWebInventory.

* Fixed conflict

* Import inventory added to metrics

Allows metrics to use the cached inventory to retrieve player stats
instead of making another api call

* Removed api call from incubate_eggs

Cached inventory should be accurate enough for this

* Swap auth and config position (PokemonGoF#4909)

* add telegram check messages interval (PokemonGoF#4919)

* add telegram check messages interval

* config changed

* fix config

* telegram doc update

* Add documentation (PokemonGoF#4921)

See documentation for full list of new features

* documented docker for the auth.json use case (PokemonGoF#4922)

add instructions for the docker run command for the multiple config files use case.

* Fix for PokemonGoF#4718 (PokemonGoF#4924)

* Add except variable

* Add except variable

* Fix filter (PokemonGoF#4925)

* improve docker pull speed (PokemonGoF#4899)

* Update inventory.py (PokemonGoF#4928)

FIX: PokemonGoF#4926

* fixed a runtime error caused by incorrect imports (PokemonGoF#4931)

* Catch exception telegram.error.NetworkError.
Fixs some pylint complain.

* More config parameters for MoveToMap (PokemonGoF#4937)

* fixed a runtime error caused by incorrect imports

* Moving module-level constants (snipe parameters) into config file

* Add experimental pokemon upgrade (power-up) logic (PokemonGoF#4938)

Add upgrade cost data file
Add last pokemon level.

* Set default value of skip_rounds to 30 since many people just use the default value.
30 will behave close to human.

* Add exception handling for cached forts (PokemonGoF#4943)

* Add exception handling for cached forts

* whitespace fix

* telegram to thread

* config update

* doc update

* update web repo to have better web ui contribute.

* Using $TIMEZONE environment variable to set timezone

* fix errors

* fix errors

* Fixing clean run issues.

* During startup, no bot object.

* Added option PokemonGo-Bot-Configurator

Smoothed some things up
Added option to run PokemonGo-Bot-Configurator at the end of the
installation.

* Hotfix for EvolvePokemon (PokemonGoF#4960)

* Compatiable with old protocol define in map-chat.
  • Loading branch information
DBa2016 authored Aug 30, 2016
1 parent 56339fb commit 88b4006
Show file tree
Hide file tree
Showing 41 changed files with 1,741 additions and 1,000 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ data/map-caught-*.json
data/recent-forts-*.json
data/caught-*.json
data/deviceid-*.txt
data/mqtt_client_id.*
user_web_catchable
version

# Multiple config
configs/*
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "web"]
path = web
url = https://github.com/OpenPoGo/OpenPoGoWeb.git
url = https://github.com/PokemonGoF/PokemonGo-Web
53 changes: 30 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,43 @@ FROM alpine

ARG BUILD_REPO=PokemonGoF/PokemonGo-Bot
ARG BUILD_BRANCH=master
ARG TIMEZONE=Etc/UTC

LABEL build_repo=$BUILD_REPO build_branch=$BUILD_BRANCH

WORKDIR /usr/src/app
VOLUME ["/usr/src/app/configs", "/usr/src/app/web"]

ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt .
RUN apk -U --no-cache add python py-pip \
&& apk --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git tzdata tar \
&& cp -fa /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
&& echo $TIMEZONE > /etc/timezone \
&& ln -s locale.h /usr/include/xlocale.h \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del .build-dependencies \
&& rm -rf /var/cache/apk/* /usr/include/xlocale.h \
&& find / -name '*.pyc' -o -name '*.pyo' -exec rm -f {} \;
RUN apk -U --no-cache add python py-pip tzdata \
&& rm -rf /var/cache/apk/* \
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f

ADD http://pgoapi.com/pgoencrypt.tar.gz /tmp/pgoencrypt.tar.gz
RUN apk --no-cache add --virtual .pgoencrypt-dependencies gcc make musl-dev tar \
&& cat /tmp/pgoencrypt.tar.gz | tar xzf - -C /tmp \
ADD https://raw.githubusercontent.com/$BUILD_REPO/$BUILD_BRANCH/requirements.txt .
RUN apk -U --no-cache add --virtual .build-dependencies python-dev gcc make musl-dev git \
&& tar zxf /tmp/pgoencrypt.tar.gz -C /tmp \
&& make -C /tmp/pgoencrypt/src \
&& cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so \
&& apk del .pgoencrypt-dependencies \
&& rm -rf /var/cache/apk/* /tmp/pgoencrypt /tmp/pgoencrypt.tar.gz

ADD https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz /tmp
RUN apk -U --no-cache add --virtual .tar-deps tar \
&& cat /tmp/$BUILD_BRANCH.tar.gz | tar -zxf - --strip-components=1 -C /usr/src/app \
&& apk del .tar-deps \
&& rm /tmp/$BUILD_BRANCH.tar.gz

ENTRYPOINT ["python", "pokecli.py"]
&& ln -s locale.h /usr/include/xlocale.h \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del .build-dependencies \
&& rm -rf /var/cache/apk/* /tmp/pgoencrypt* /usr/include/xlocale.h \
&& find / -name '*.pyc' -o -name '*.pyo' | xargs -rn1 rm -f

ADD https://api.github.com/repos/$BUILD_REPO/commits/$BUILD_BRANCH /tmp/pgobot-version
RUN apk -U --no-cache add --virtual .pgobot-dependencies wget ca-certificates tar jq \
&& wget -q -O- https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz | tar zxf - --strip-components=1 -C /usr/src/app \
&& jq -r .sha /tmp/pgobot-version > /usr/src/app/version \
&& apk del .pgobot-dependencies \
&& rm -rf /var/cache/apk/* /tmp/pgobot-version

RUN printf "#!/bin/sh\n\
\n\
TIMEZONE=\${TIMEZONE:-Etc/UTC}\n\
\n\
ln -sfn /usr/share/zoneinfo/\$TIMEZONE /etc/localtime\n\
echo \$TIMEZONE > /etc/timezone\n\
\n\
python pokecli.py \$@\n" > /entrypoint.sh \
&& chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# PokemonGo-Bot
PokemonGo bot is a project created by the [PokemonGoF](https://github.com/PokemonGoF) team.
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is a project created by the [PokemonGoF](https://github.com/PokemonGoF) team.

## Table of Contents
- [Installation](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/installation.md)
- [Documentation](https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/)
- [Support](#support)
- [help](#configuration-issueshelp)
- [bugs](#bugs--issues)
- [Feature request](#feature-requests)
- [Help](#configuration-issueshelp)
- [Bugs](#bugs--issues)
- [Feature Requests](#feature-requests)
- [Pull Requests](#pull-requests)
- [Features](#features)
- [Credits](#credits)

The project is currently setup in two main branches.
- `dev` also known as `beta` - This is where the latest features are, but you may also experience some issues with stability/crashes
- `master` also known as `stable` - The bot 'should' be stable on this branch, and is generally well tested
The project is currently setup in two main branches:
- `dev` also known as `beta` - This is where the latest features are, but you may also experience some issues with stability/crashes.
- `master` also known as `stable` - The bot 'should' be stable on this branch, and is generally well tested.

## Support
### Configuration issues/help
If you need any help please don't create an issue as we have a great community on Slack. You can count on the community in [#help](https://pokemongo-bot.slack.com/messages/help/) channel.
- [Click here to signup (first time only)](https://pokemongo-bot.herokuapp.com)
- [Join if you're already a member](https://pokemongo-bot.slack.com/messages/general/).
- [Click here to signup (first time only)](https://pokemongo-bot.herokuapp.com)
- [Join here if you're already a member](https://pokemongo-bot.slack.com/messages/general/)

###[Bugs / Issues](https://github.com/PokemonGoF/PokemonGo-Bot/issues?q=is%3Aissue+sort%3Aupdated-desc)
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.
Expand Down Expand Up @@ -51,10 +51,10 @@ If you'd like to make your own changes, make sure you follow the pull request te
- [ ] Use candy

## Gym Battles
This bot takes a strong stance against automating gym battles. Botting gyms will have a negative effect on most players and thus the game as a whole. We will thus never accept contributions or changes containing code specific for gym battles.
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) takes a strong stance against automating gym battles. Botting gyms will have a negative effect on most players and thus the game as a whole. We will thus never accept contributions or changes containing code specific for gym battles.

## Analytics
This 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.
[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.

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).

Expand Down
15 changes: 12 additions & 3 deletions configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,18 @@
"type": "EvolvePokemon",
"config": {
"enabled": false,
"//evolve all except Zubat and Rattata": "",
"//evolve_all": "-Zubat,-Rattata",
"evolve_all": "none",

"// evolve only pidgey and drowzee": "",
"// evolve_list": "pidgey, drowzee",
"// donot_evolve_list": "none",

"// evolve all but pidgey and drowzee": "",
"// evolve_list": "all",
"// donot_evolve_list": "pidgey, drowzee",

"evolve_list": "all",
"donot_evolve_list": "none",

"first_evolve_by": "cp",
"evolve_above_cp": 500,
"evolve_above_iv": 0.8,
Expand Down
28 changes: 19 additions & 9 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"enabled": false,
"master": null,
"// old syntax, still supported: alert_catch": ["all"],
"// new syntax:": {},
"alert_catch": {
"all": {"operator": "and", "cp": 1300, "iv": 0.95},
"Snorlax": {"operator": "or", "cp": 900, "iv": 0.9}
}
"// new syntax:": {},
"alert_catch": {
"all": {"operator": "and", "cp": 1300, "iv": 0.95},
"Snorlax": {"operator": "or", "cp": 900, "iv": 0.9}
}
}
},
{
Expand Down Expand Up @@ -120,9 +120,18 @@
"type": "EvolvePokemon",
"config": {
"enabled": false,
"//evolve all except Zubat and Rattata": "",
"//evolve_all": "-Zubat,-Rattata",
"evolve_all": "none",

"// evolve only pidgey and drowzee": "",
"// evolve_list": "pidgey, drowzee",
"// donot_evolve_list": "none",

"// evolve all but pidgey and drowzee": "",
"// evolve_list": "all",
"// donot_evolve_list": "pidgey, drowzee",

"evolve_list": "all",
"donot_evolve_list": "none",

"first_evolve_by": "cp",
"evolve_above_cp": 500,
"evolve_above_iv": 0.8,
Expand Down Expand Up @@ -194,7 +203,8 @@
"config": {
"enabled": true,
"spin_wait_min": 3,
"spin_wait_max": 5
"spin_wait_max": 5,
"daily_spin_limit": 1900
}
},
{ "type": "UpdateWebInventory",
Expand Down
21 changes: 18 additions & 3 deletions configs/config.json.map.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,18 @@
"type": "EvolvePokemon",
"config": {
"enabled": false,
"//evolve all except Zubat and Rattata": "",
"//evolve_all": "-Zubat,-Rattata",
"evolve_all": "none",

"// evolve only pidgey and drowzee": "",
"// evolve_list": "pidgey, drowzee",
"// donot_evolve_list": "none",

"// evolve all but pidgey and drowzee": "",
"// evolve_list": "all",
"// donot_evolve_list": "pidgey, drowzee",

"evolve_list": "all",
"donot_evolve_list": "none",

"first_evolve_by": "cp",
"evolve_above_cp": 500,
"evolve_above_iv": 0.8,
Expand Down Expand Up @@ -192,6 +201,12 @@
"map_path": "raw_data",
"walker": "StepWalker",
"max_extra_dist_fort": 10,
"skip_rounds": 5,
"update_map_min_distance_meters": 500,
"update_map_min_time_sec": 120,
"snipe_sleep_sec": 2,
"snipe_max_in_chain": 2,
"debug": false,
"catch": {
"==========Legendaries==========": 0,
"Aerodactyl": 1000,
Expand Down
Loading

0 comments on commit 88b4006

Please sign in to comment.