Skip to content

Commit

Permalink
Added "install.sh" and "run.sh" as well as a config.json bug fix in p…
Browse files Browse the repository at this point in the history
…okecly.py (PokemonGoF#912)

* Fixed a bug where the bot crashed if 'catch' or 'release' wasn't specified in config.json

* Added install.sh and run.sh
  • Loading branch information
Grace authored and MFizz committed Jul 29, 2016
1 parent 11c9035 commit 1f0b560
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
19 changes: 19 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# Setup Python virtualenv
echo "Setting up Python virtualenv..."
eval "virtualenv ."
eval "source bin/activate"
echo "Python virtualenv setup successfully."

# Install pip requirements
echo "Installing pip requirements..."
eval "pip install -r requirements.txt"
echo "Installed pip requirements."
echo "Installing and updating git submodules..."

# Install git submodules
eval "cd ./web && git submodule init && cd .."
eval "git submodule update"
echo "Done."
echo "Please create and setup configs/config.json. Then, run 'python pokecli.py --config ./configs/config.json' or './run.sh' on Mac/Linux"
8 changes: 6 additions & 2 deletions pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,12 @@ def init_config():
for key in config.__dict__:
if key in load:
config.__dict__[key] = load[key]
config.catch = load['catch']
config.release = load['release']

if 'catch' in load:
config.catch = load['catch']

if 'release' in load:
config.release = load['release']

if config.auth_service not in ['ptc', 'google']:
logging.error("Invalid Auth service specified! ('ptc' or 'google')")
Expand Down
5 changes: 5 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

# Assumes the config file is created and named config.json
# Starts PokemonGo-Bot
eval "python pokecli.py --config ./configs/config.json"

0 comments on commit 1f0b560

Please sign in to comment.