Skip to content

Commit

Permalink
Merge pull request #10 from PokemonGoF/dev
Browse files Browse the repository at this point in the history
Rebase from Main
  • Loading branch information
MerlionRock authored Jul 25, 2017
2 parents 73cd18b + e90526e commit b4a561e
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 25 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# PokemonGo-Bot
[PokemonGo-Bot](https://github.com/PokemonGoF/PokemonGo-Bot) is a project created by the [PokemonGoF](https://github.com/PokemonGoF) team. Since no public API available for now, a patch to use HASH-Server was applied. PokemonGoF is not part of HASH-Server dev team and has no connection with it.

[![Bot Map and Terminal](https://i.imgur.com/EWCEDxe.jpg)](https://i.imgur.com/Mrg9aRw.jpg)

# Donation

Bitcoin: 1PJMCx9NNQRasQYaa4MMff9yyNFffhHgLu
Expand Down
48 changes: 34 additions & 14 deletions docs/manual_installation.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,84 @@
# Manual installation
Consider purchase of [hashing key](http://hashing.pogodev.org) - if you want use latest API, not the old, 0.45

The bot now requires a hashing key from pogodev/Bossland [hashing key](http://hashing.pogodev.org)

## Table of Contents

- [Linux and Mac Installation](#linux-and-mac)
- [Windows](#windows)

### Linux and Mac

Ubuntu will be used for the Linux Example

#### First install required packages

##### Linux - Ubuntu

```bash
sudo apt-get install build-essential autoconf libtool pkg-config make python2.7-dev wget git
```

##### Linux - Centos 7

```bash
sudo yum install -y epel-release
sudo yum install -y git wget python python-pip
sudo yum groupinstall -y "Development Tools"
```

####

if you are on a different Linux OS you maybe have to adapt things like:

- package manager (for example yum instead of apt-get)
- package names

##### Mac

```bash
brew install autoconf libtool pkg-config wget git
brew install autoconf libtool pkg-config wget git
```

#### Mac + Linux installation
make sure you installed everything above

Make sure you installed everything above before proceeding.

- get pip for python2.7
```bash
wget https://bootstrap.pypa.io/get-pip.py
python2.7 get-pip.py
rm -f get-pip.py
```

- switch to the location where you want to install it
- get git Repository and switch into the downloaded Folder

(Please keep in mind that master is not always up-to-date whereas 'dev' is. In the installation note below change `master` to `dev` if you want to get and use the latest version.)
(Please keep in mind that `master` is stable and tested but `dev` is bleeding edge. In the installation note below change `master` to `dev` if you want to get and use the latest version.)
```bash
git clone --recursive -b master https://github.com/PokemonGoF/PokemonGo-Bot
cd PokemonGo-Bot
```

####
- install virtualenv and activate it

- install `virtualenv` and activate it
```bash
pip install virtualenv
virtualenv .
source bin/activate
```
####
- install the requirements

####

- install the requirements
```bash
pip install -r requirements.txt
make
cd ../../
```

####

- copy and edit the config
(after copying it you can use any editor you like if you don't like `vi`)
```bash
Expand All @@ -73,19 +87,25 @@ vi configs/config.json
cp configs/auth.json.example configs/auth.json
vi configs/auth.json
```

####

- make sure your git repo is up to date
(make sure you are in the bot folder and activated virtualenv)
```bash
git pull
pip install -r requirements.txt
```

####

- finally start the bot
```bash
./run.sh
```

####

- after reboot or closing the terminal at every new start go into the folder of the PokemonGo-Bot by going into the folder where you started installing it and then
```bash
cd PokemonGo-Bot
Expand All @@ -99,7 +119,8 @@ source bin/activate

##### Requirements

- [Python 2.7.x](http://docs.python-guide.org/en/latest/starting/installation/) *Be sure to tick "Add python.exe to Path" during install*
- [Python 2.7.x](http://docs.python-guide.org/en/latest/starting/installation/)
- *Be sure to tick "Add python.exe to Path" during as seen here:* ![Add Python To Path](http://i.imgur.com/RhYnhg0.jpg)
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Microsoft Visual C++ Compiler for Python 2.7](http://www.microsoft.com/en-us/download/details.aspx?id=44266)

Expand All @@ -108,17 +129,16 @@ source bin/activate

```
cd C:\Python27\
pip2 install --upgrade pip
pip2 install --upgrade virtualenv
pip install --upgrade pip
pip install --upgrade virtualenv
git clone --recursive -b dev https://github.com/PokemonGoF/PokemonGo-Bot
pip2 install --upgrade -r C:/Python27/PokemonGo-Bot/requirements.txt
pip install --upgrade -r C:/Python27/PokemonGo-Bot/requirements.txt
cd C:/Python27/PokemonGo-Bot/
virtualenv .
call C:\Python27\PokemonGo-Bot\Scripts\activate.bat
pip2 install --upgrade -r C:/Python27/PokemonGo-Bot/requirements.txt
pip install --upgrade -r C:/Python27/PokemonGo-Bot/requirements.txt
```


##### Update

*Run the following commands in the Command Prompt with Administrator Privileges*
Expand Down
7 changes: 5 additions & 2 deletions pokemongo_bot/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ def __init__(self, event, sender=None, level='info', formatted='', data={}):
self.sender = str(sender).encode('ascii', 'xmlcharrefreplace')

self.level = str(level).encode('ascii', 'xmlcharrefreplace')
#self.formatted = str(formatted).encode('ascii', 'xmlcharrefreplace')
self.formatted = str(formatted).encode('utf-8', 'xmlcharrefreplace')

#Fixing issue 6123 for gym names that are in utf format.
self.formatted = str(formatted).encode('utf-8', 'ignore').decode('utf-8')
self.formatted = str(formatted).encode('ascii', 'xmlcharrefreplace')

self.data = str(data).encode('ascii', 'xmlcharrefreplace')
self.friendly_msg = ""

Expand Down
2 changes: 1 addition & 1 deletion web
20 changes: 12 additions & 8 deletions windows_bat/PokemonGo-Bot-Configurator.bat
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,20 @@ ECHO.
ECHO.// MUST CONFIGURE THE USER ARRAY AND GOOGLE MAPS API KEY.>%UserData%
ECHO.// YOU CAN GET A KEY HERE: https://developers.google.com/maps/documentation/javascript/get-api-key>>%UserData%
ECHO.var userInfo = {>>%UserData%
ECHO. users: [{>>%UserData%
ECHO. enable: true,>>%UserData%
Set /p users="What's the username to use ?: "
ECHO. users: ["%users%"],>>%UserData%
ECHO. userZoom: true,>>%UserData%
ECHO. zoom: 16,>>%UserData%
ECHO. userFollow: true,>>%UserData%
ECHO. username: "%users%",>>%UserData%
ECHO. socketAddress: "127.0.0.1:4000",>>%UserData%
ECHO. enableSocket: true>>%UserData%
ECHO. }],>>%UserData%
ECHO. userZoom: false,>>%UserData%
ECHO. userPath: true,>>%UserData%
ECHO. zoom: 16,>>%UserData%
ECHO. userFollow: true,>>%UserData%
SET /p API="What's your Google Maps API Key ?: "
ECHO. gMapsAPIKey: "%API%",>>%UserData%
ECHO. botPath: true,>>%UserData%
ECHO. actionsEnabled: false>>%UserData%
ECHO.};>>%UserData%
ECHO. gMapsAPIKey: "%API%">>%UserData%
ECHO. };>>%UserData%
goto:menu

:Menu2
Expand Down
2 changes: 2 additions & 0 deletions windows_bat/PokemonGo-Bot-Updater.bat
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ FOR /F "usebackq" %%A IN ('%BotPath%\configs\config.json.optimizer.example') DO
FOR /F "usebackq" %%A IN ('%BotPath%\configs\config.json.path.example') DO set OldSizePath=%%~zA
FOR /F "usebackq" %%A IN ('%BotPath%\configs\config.json.pokemon.example') DO set OldSizePokemon=%%~zA
git pull
pip uninstall -y pgoapi
git submodule update --init --recursive
pip install --upgrade -r requirements.txt
FOR /F "usebackq" %%A IN ('%BotPath%\configs\config.json.example') DO set SizeNormal=%%~zA
FOR /F "usebackq" %%A IN ('%BotPath%\configs\config.json.cluster.example') DO set SizeCluster=%%~zA
FOR /F "usebackq" %%A IN ('%BotPath%\configs\config.json.map.example') DO set SizeMap=%%~zA
Expand Down

0 comments on commit b4a561e

Please sign in to comment.