A quick note:
This is a fork of the project PokemonGo-Bot by PokemonGoF.
The goal of this fork is to progress the bot in an organized manner, and to promote a clean and functional codebase. As a result, OpenPoGoBot will be more reliable and secure than PokemonGo-Bot.
See CONTRIBUTING.md
- Spin Pokestops
- Catch Pokemon
- Release low cp pokemon
- Walk to a location
- Catch nearby pokemon when you have pokeballs available, don't if you don't
- Auto farm/catch mode switching
- Ignore certain pokemon filter
- Use superior ball types when necessary
- When out of normal pokeballs, use the next type of ball unless there are less than 10 of that type, in which case switch to farm mode
- Python 2.7.x
- pip
- git
- virtualenv (Optional)
- protobuf 3 (OS Dependent, see below)
- OS X:
brew update && brew install --devel protobuf
- Windows: Download protobuf 3.0: here and unzip
bin/protoc.exe
into a folder in your PATH. - Linux:
apt-get install python-protobuf
virtualenv env
source env/bin/activate
pip install -r requirements.txt
$ git clone -b dev https://github.com/OpenPoGo/OpenPoGoBot
$ cd OpenPoGo
$ virtualenv .
$ source bin/activate
$ pip install -r requirements.txt
Google Maps API: a brief guide to your own key
This project uses Google Maps. There's one map coupled with the project, but as it gets more popular we'll definitely hit the rate-limit making the map unusable. That said, here's how you can get your own and replace ours:
- Navigate to this page
- Select 'Create a project' in the dropdown menu.
- Wait an eternity.
- Click 'Create' on the next page (optionally, fill out the info)
- Copy the API key that appears.
- After the code done, will update here how to replace.
usage: pokecli.py [-h] -a AUTH_SERVICE -u USERNAME -p PASSWORD -l LOCATION [-lc] [-c] [-m] [-w] [--distance_unit] [--initial-transfer] [--maxsteps] [-iv] [-d] [-t]
optional arguments:
-h, --help show this help message and exit
-a AUTH_SERVICE, --auth_service AUTH_SERVICE Auth Service ('ptc' or 'google')
-u USERNAME, --username USERNAME Username
-p PASSWORD, --password PASSWORD Password
-l LOCATION, --location LOCATION Location (Address or 'xx.yyyy,zz.ttttt')
-lc, --location_cache Bot will start at last known location
-m MODE, --mode MODE Set farming Mode for the bot ('all', 'poke', 'farm')
-w SPEED, --walk SPEED Walk instead of teleport with given speed (meters per second max 4.16 because of walking end on 15km/h)
-du, --distance_unit UNIT Set the unit to display distance in (e.g, km for kilometers, mi for miles, ft for feet)
-it, --initial_transfer Start the bot with a pokemon clean up, keeping only the higher CP of each pokemon. It respects -c as upper limit to release.
-ms, --max_steps MAX_STEP Set the steps around your initial location (DEFAULT 5 mean 25 cells around your location)
-iv IV, --pokemon_potential Set the ratio for the IV values to transfer (DEFAULT 0.4 eg. 0.4 will transfer a pokemon with IV 0.3)
-if LIST, --item_filter LIST Pass a list of unwanted items to recycle when collected at a Pokestop (e.g, [\"101\",\"102\",\"103\",\"104\"] to recycle potions when collected)"
-d, --debug Debug Mode
-t, --test Only parse the specified location
Pokemon Trainer Club (PTC) account:
$ python2 pokecli.py -a ptc -u tejado -p 1234 --location "New York, Washington Square"
Google Account:
$ python2 pokecli.py -a google -u tejado -p 1234 --location "New York, Washington Square"
To edit the pokemon release configuration, copy file ``release_config.json.example`` and rename it to ``release_config.json``
Edit this file however you like, but keep in mind:
1. Pokemon name is always capitalize and case-sensitive
2. Be careful with the ``any`` configuration!
1. Check the type of your API request in [POGOProtos](https://github.com/AeonLucid/POGOProtos/blob/eeccbb121b126aa51fc4eebae8d2f23d013e1cb8/src/POGOProtos/Networking/Requests/RequestType.proto) For example: RECYCLE_INVENTORY_ITEM
2. Convert to the api call in OpenPoGoBot/__init__.py, RECYCLE_INVENTORY_ITEM change to self.api.recycle_inventory_item
```
def drop_item(self,item_id,count):
self.api.recycle_inventory_item(...............)
```
3. Where is the param list?
You need check this [Requests/Messages/RecycleInventoryItemMessage.proto](https://github.com/AeonLucid/POGOProtos/blob/eeccbb121b126aa51fc4eebae8d2f23d013e1cb8/src/POGOProtos/Networking/Requests/Messages/RecycleInventoryItemMessage.proto)
4. Then our final api call is
```
def drop_item(self,item_id,count):
self.api.recycle_inventory_item(item_id=item_id,count=count)
inventory_req = self.api.call()
print(inventory_req)
```
5. You can now debug on the log to see if get what you need
Head over to the OpenPoGoWeb Project and follow the instructions to clone it into your web
directory.
Here's the introduction
You can use -c 1 to protect your first stage low CP pokemon.
Not yet, still need a trainer to train the script param. But we are very close to.
It works, use -l "xx.yyyy,zz.ttttt" to set lat long for location. -- diordache
Try to generate an app password and set is as
-p "<your-app-password>"
This error is mostly occurs for those who using 2 factor authentication but either way for the purpose of security would be nice to have a separate password for the bot app.
The status code "3" corresponds to "Flee" - meaning your Pokemon has ran away. {"responses": { "CATCH_POKEMON": { "status": 3 } }
Finish the tutorial on a smartphone. This will then allow everything to be visible.
Quick Tip: When using this script, use a Lucky egg to double the XP for 30 mins. You will level up much faster. A Lucky egg is obtained on level 9 and further on whilst leveling up. (from VipsForever via /r/pokemongodev)
You don't want to collect common pokemon once you hit a certain level. It will slow down leveling but you won't fill up either.
Create the following filter
./data/catch-ignore.yml
Its a yaml file with a list of names so make it look like
ignore:
- Pidgey
- Rattata
- Pidgeotto
- Spearow
- Ekans
- Zubat
You can either view the map via opening the html file, or by serving it with SimpleHTTPServer (runs on localhost:8000)
To use SimpleHTTPServer:
$ python -m SimpleHTTPServer [port]
The default port is 8080, you can change that by giving a port number.
Anything above port 1000 does not require root.
You will need to set your username(s) in the userdata.js file before opening:
Copy userdata.js.example to userdata.js and edit with your favorite text editor.
put your username in the quotes instead of "username"
If using multiple usernames format like this:
var users = ["username1","username2"];
- tejado many thanks for the API
- Mila432 for the login secrets
- elliottcarlson for the Google Auth PR
- AeonLucid for improved protos
- AHAAAAAAA for parts of the s2sphere stuff