Skip to content

Commit

Permalink
Merge pull request #4782 from PokemonGoF/dev
Browse files Browse the repository at this point in the history
Dev merge to master
  • Loading branch information
solderzzc authored Aug 26, 2016
2 parents ae314b6 + 3f2e744 commit ed09593
Show file tree
Hide file tree
Showing 40 changed files with 2,101 additions and 656 deletions.
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
.idea
.git*
**/*config.json
**/*userdata.js
**/*userdata.js
data/caught-*.json
data/cells-*.json
data/deviceid-*.txt
data/last-location-*.json
data/*.db
web/catchable-*.json
web/inventory-*.json
web/location-*.json
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ data/last-location*.json
data/cells-*.json
data/map-caught-*.json
data/recent-forts-*.json
data/caught-*.json
data/deviceid-*.txt
user_web_catchable

# Multiple config
Expand Down
53 changes: 22 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,34 @@
#
# docker build --build-arg BUILD_REPO=YourFork/PokemonGo-Bot --build-arg BUILD_BRANCH=6a4580f .

FROM python:2.7.12-alpine
FROM alpine

RUN apk add --update --no-cache alpine-sdk git

ARG BUILD_BRANCH
ENV BUILD_BRANCH ${BUILD_BRANCH:-master}

ARG BUILD_REPO
ENV BUILD_REPO ${BUILD_REPO:-PokemonGoF/PokemonGo-Bot}
ARG BUILD_REPO=PokemonGoF/PokemonGo-Bot
ARG BUILD_BRANCH=master
ARG TIMEZONE=Etc/UTC

LABEL build_repo=$BUILD_REPO build_branch=$BUILD_BRANCH

ADD https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz .
RUN tar -zxvf $BUILD_BRANCH.tar.gz && mv PokemonGo-Bot-* /usr/src/app && rm $BUILD_BRANCH.tar.gz

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

ARG timezone=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#setup the bot
ADD http://pgoapi.com/pgoencrypt.tar.gz /tmp/
RUN cd /tmp && tar zxvf pgoencrypt.tar.gz \
&& cd pgoencrypt/src \
&& make \
&& cp libencrypt.so /usr/src/app/encrypt.so \
&& cd /tmp \
&& rm -rf /tmp/pgoencrypt*

ENV LD_LIBRARY_PATH /usr/src/app

RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install --no-cache-dir -r requirements.txt

#remove unused stuff
RUN apk del alpine-sdk\
&& rm -rf /var/cache/apk/*
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 \
&& cp -fa /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
&& echo $TIMEZONE > /etc/timezone \
&& wget -q -O- http://pgoapi.com/pgoencrypt.tar.gz | tar zxf - -C /tmp \
&& make -C /tmp/pgoencrypt/src \
&& cp /tmp/pgoencrypt/src/libencrypt.so /usr/src/app/encrypt.so \
&& 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' -exec rm -f {} \;

RUN apk -U --no-cache add --virtual .install-dependencies wget ca-certificates tar \
&& wget -q -O- https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz | tar zxf - --strip-components=1 -C /usr/src/app \
&& apk del .install-dependencies \
&& rm -rf /var/cache/apk/*

ENTRYPOINT ["python", "pokecli.py"]
60 changes: 47 additions & 13 deletions configs/config.json.cluster.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"location": "SOME_LOCATION",
"favorite_locations":[
{"name": "Milan", "coords": "45.472849,9.177567"}
],
"gmapkey": "GOOGLE_MAPS_API_KEY",
"encrypt_location": "",
"websocket_server": false,
"heartbeat_threshold": 10,
"enable_social": true,
"live_config_update": {
"enabled": false,
"tasks_only": false
},
"tasks": [
{
"//NOTE: This task MUST be placed on the top of task list": {},
Expand All @@ -23,16 +30,6 @@
{
"type": "HandleSoftBan"
},
{
"type": "SleepSchedule",
"config": {
"enabled": false,
"time": "22:54",
"duration":"7:46",
"time_random_offset": "00:24",
"duration_random_offset": "00:43"
}
},
{
"type": "CompleteTutorial",
"config": {
Expand Down Expand Up @@ -75,6 +72,16 @@
"items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ultraballs", "razzberries", "luckyegg"]
}
},
{
"type": "ShowBestPokemon",
"config": {
"enabled": true,
"min_interval": 60,
"amount": 5,
"order_by": "cp",
"info_to_show": ["cp", "ivcp", "dps", "hp"]
}
},
{
"type": "TransferPokemon",
"config": {
Expand Down Expand Up @@ -124,7 +131,10 @@
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 3,
"recycle_wait_max": 5
"recycle_wait_max": 5,
"recycle_force": true,
"recycle_force_min": "00:01:00",
"recycle_force_max": "00:05:00"
}
},
{
Expand All @@ -151,7 +161,9 @@
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
"changeball_wait_max": 5,
"newtodex_wait_min": 20,
"newtodex_wait_max": 30
}
}
},
Expand All @@ -163,6 +175,11 @@
"spin_wait_max": 5
}
},
{ "type": "UpdateWebInventory",
"config": {
"enabled": true
}
},
{
"type": "FollowCluster",
"config": {
Expand Down Expand Up @@ -193,8 +210,25 @@
"walk_min": 2.16,
"alt_min": 500,
"alt_max": 1000,
"sleep_schedule": [
{
"time": "12:00",
"duration": "5:30",
"time_random_offset": "00:30",
"duration_random_offset": "00:30",
"wake_up_at_location": ""
},
{
"time": "17:45",
"duration": "3:00",
"time_random_offset": "01:00",
"duration_random_offset": "00:30",
"wake_up_at_location": ""
}
],
"debug": false,
"test": false,
"walker_limit_output": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
Expand Down Expand Up @@ -222,7 +256,7 @@
"// Zubat": {"keep_best_cp": 2, "keep_best_iv": 3}
},
"vips" : {
"Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
"Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate": {},
"any": {"catch_above_cp": 1200, "catch_above_iv": 0.9, "logic": "or" },
"Lapras": {},
"Moltres": {},
Expand Down
63 changes: 48 additions & 15 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"location": "SOME_LOCATION",
"favorite_locations":[
{"name": "Milan", "coords": "45.472849,9.177567"}
],
"gmapkey": "GOOGLE_MAPS_API_KEY",
"encrypt_location": "",
"websocket_server": false,
"heartbeat_threshold": 10,
"enable_social": true,
"live_config_update": {
"enabled": false,
"tasks_only": false
},
"tasks": [
{
"//NOTE: This task MUST be placed on the top of task list": {},
Expand All @@ -23,17 +30,6 @@
{
"type": "HandleSoftBan"
},
{
"type": "SleepSchedule",
"config": {
"enabled": false,
"time": "22:54",
"duration":"7:46",
"time_random_offset": "00:24",
"duration_random_offset": "00:43",
"wake_up_at_location": ""
}
},
{
"type": "RandomPause",
"config": {
Expand Down Expand Up @@ -88,6 +84,16 @@
"items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ultraballs", "razzberries", "luckyegg"]
}
},
{
"type": "ShowBestPokemon",
"config": {
"enabled": true,
"min_interval": 60,
"amount": 5,
"order_by": "cp",
"info_to_show": ["cp", "ivcp", "dps", "hp"]
}
},
{
"type": "TransferPokemon",
"config": {
Expand Down Expand Up @@ -137,7 +143,10 @@
"Razz Berry": { "keep" : 100 }
},
"recycle_wait_min": 3,
"recycle_wait_max": 5
"recycle_wait_max": 5,
"recycle_force": true,
"recycle_force_min": "00:01:00",
"recycle_force_max": "00:05:00"
}
},
{
Expand Down Expand Up @@ -166,7 +175,9 @@
"berry_wait_min": 3,
"berry_wait_max": 5,
"changeball_wait_min": 3,
"changeball_wait_max": 5
"changeball_wait_max": 5,
"newtodex_wait_min": 20,
"newtodex_wait_max": 30
}
}
},
Expand All @@ -178,6 +189,11 @@
"spin_wait_max": 5
}
},
{ "type": "UpdateWebInventory",
"config": {
"enabled": true
}
},
{
"type": "MoveToFort",
"config": {
Expand Down Expand Up @@ -218,21 +234,38 @@
"walk_min": 2.16,
"alt_min": 500,
"alt_max": 1000,
"sleep_schedule": [
{
"time": "12:00",
"duration": "5:30",
"time_random_offset": "00:30",
"duration_random_offset": "00:30",
"wake_up_at_location": ""
},
{
"time": "17:45",
"duration": "3:00",
"time_random_offset": "01:00",
"duration_random_offset": "00:30",
"wake_up_at_location": ""
}
],
"gps_default_altitude": 8.0,
"replicate_gps_xy_noise": false,
"replicate_gps_z_noise": false,
"gps_xy_noise_range": 0.000125,
"gps_z_noise_range": 12.5,
"debug": false,
"test": false,
"walker_limit_output": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"logging_color": true,
"daily_catch_limit": 800,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
"any": {"candy_threshold" : 400 ,"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
"// Example of always catching Rattata:": {},
"// Rattata": { "always_catch" : true }
},
Expand All @@ -254,7 +287,7 @@
"// Zubat": {"keep_best_custom": "iv, cp, hp_max", "amount":2}
},
"vips" : {
"Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
"Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate": {},
"any": {"catch_above_cp": 1200, "catch_above_iv": 0.9, "logic": "or" },
"Lapras": {},
"Moltres": {},
Expand Down
Loading

0 comments on commit ed09593

Please sign in to comment.