The current version of the bot currently requires the encrypt library. Hop on the #poketrainer slack to find out more.
Long story short, you need to make libencrypt.so or encrypt.dll by finding the c_code folder of one of the unknown6 repositories and running make clean; make. You then put the built files into the same folder as pokecli.py and run it with:
python pokecli.py -i ACCOUNT_INDEx -e YOUR_ENCRYPT_LIB_NAME_GOES_HERE.DLL.SO
Please do not sell the bot, or use it to sell accounts/power leveling or what have you. If you really can't help yourself from trying to make money on it, please donate a portion of your profits to Kiva.
To the people that have done so already (heard from quite a few already), thank you for making the world a better place.
DISCLAIMER: this is super sketch and just a proof of concept It's not that bad any more, but still, use at your own risk and I claim no credit or responsibility or what have you for parts of it.
usage: pokecli.py [-h] [-i CONFIG_INDEX] [-l LOCATION] [-e ENCRYPT_LIB] [-d]
optional arguments:
-h, --help show this help message and exit
-i CONFIG_INDEX, --config_index CONFIG_INDEX
Index of account in config.json
-l LOCATION, --location LOCATION
Location
-e ENCRYPT_LIB, --encrypt-lib ENCRYPT_LIB
encrypt lib, libencrypt.so/encrypt.dll
-d, --debug Debug Mode
- Run python web.py to get a webservice to show you player information, this can be seen at:
- http://127.0.0.1:5000/YOUR_USERNAME_HERE
- Only 1 needs to run regardless of how many bots you are running
Copy config.json.example to config.json and change your account information.
Below the accounts you can change options in the default section. If you need to change some options for an individual account, you can copy them to the account section and modify as needed.
BEHAVIORsectionUSE_GOOGLEwill enable google walking directions for navigation- You will probably need to provide an api key in
GMAPS_API_KEYto avoid rate limits
- You will probably need to provide an api key in
STEP_SIZEcorresponds to how many meters you want to move at most between server calls, set this around 4-6 for walking or 100-200 for really, really fast drivingWANDER_STEPSwill set the distance a pokestop can be away before and still allow us to wander off the walk path. This allows you to get pokestops that aren't close to the sidewalk/road. If you don't set it we won't wander off the path.EXPERIMENTALwill set the flag to use exeperimental featuresSKIP_VISITED_FORT_DURATION[Experimental] Avoid a fort for a given number of seconds- Setting this to 500 means avoid a fort for 500 seconds before returning, (Should be higher than 300 to have any effect). This will let the bot explore a bigger area.
SPIN_ALL_FORTS[Experimental] will try to route using google maps(must have key) to all visible forts, ifSKIP_VISITED_FORT_DURATIONis set high enough, you may roam around forever.
CAPTURECATCH_POKEMONAllows you to disabling catching pokemon if you just want to mine for the forts for pokeballsMIN_FAILED_ATTEMPTS_BEFORE_USING_BERRYminimum number of failed capture attempts before trying to use a Razz Berry (default: 3)USE_POKEBALL_IF_PERCENTAs long as using a pokeball would result in at least this percent of a chance to capture, use it (default: 50)USE_GREATBALL_IF_PERCENTIf using a pokeball wouldn't result in at least the above percent, use a greatball if the capture rate is above this percent (default: 50)USE_ULTRABALL_IF_PERCENTIf using a greatball wouldn't result in at least the above percent, use an ultraball if the capture rate is above this percent (default: 50)USE_MASTERBALLUsing a masterball should in theory automatically result in a capture. If set to true, attempt to use a masterball if none of the above percentages are met. If this is set to false and none of the above percentages are met, default back to an ultraball (default: false)
EGG_INCUBATIONENABLEenables automatic use of incubators (default: true)USE_DISPOSABLE_INCUBATORSenables use of disposable (3-times use) incubators (default: false)BIG_EGGS_FIRSTincubate big eggs (most km) first (default: true)
POKEMON_CLEANUPTESTING_MODESet this to true if you want to see what pokemon the configured release method would keep or release (no pokemon are harmed when this is on)KEEP_POKEMON_NAMESNames of pokemon you want the bot to hold regardless of IV/CPTHROW_POKEMON_NAMESNames of pokemon you want the bot to throw away regardless of IV/CP- Note:
MIN_SIMILAR_POKEMONwill still be kept for all pokemon types
- Note:
KEEP_POKEMON_MAX_COUNTdefault 9999. If you want to keep a certain type of pokemon but you accidently run into a nest? Don't worry this will make sure you only keep X amount of pokemon specified inKEEP_POKEMON__NAMESRELEASE_METHOD= "CLASSIC", if you are unsure about the other methods you should stick to this one!KEEP_CP_OVERNever transfer any pokemon above this CP, Setting this to 0 will never transfer anythingKEEP_IV_OVERNever transfer any pokemon above this C IV, Setting this to 0 will never transfer anything
RELEASE_METHOD= "DUPLICATES"- The bot will collect all pokemon it encounters , thus collecting a ton of bad ones and filling up space. Enabling this feature (disabled by default) will have the bot automatically transfer pokemon that are duplicates. To determine which pokemon to transfer when duplicates exist, the pokemons are compared according to the
SCORE_METHODsetting. The bot will transfer the lowest scoring pokemon, maintainingMIN_SIMILAR_POKEMONof each type. To be completely confident that the bot will not transfer your high lvl pokemon, when this feature is enabled only pokemon with a score belowRELEASE_DUPLICATES_MAX_SCOREare released. If you have multiple pokemon that are close to the same lvl the bot can be configured to not transfer them by usingRELEASE_DUPLICATES_SCALAR. The value of this config is multiplied by the highest scoring pokemon of a type and only those pokemon that are less than the scaled score are transfered. - EXAMPlES: If you set
SCORE_METHODto "IV" while having two Snorlaxs, one with stats CP:14 IV:95 and the other with CP:1800 IV:30 the bot will transfer the Snorlax with CP of 1800 and keep the CP 14 Snorlax because you have indicated you only care about a pokemon's IV. It must be fully understood why this happens to avoid unwanted transfer of pokemon. If not used correctly this feature can very easily transfer a large ammount of your pokemon so please make sure you fully understand it's mechanics before attempting use!
- The bot will collect all pokemon it encounters , thus collecting a ton of bad ones and filling up space. Enabling this feature (disabled by default) will have the bot automatically transfer pokemon that are duplicates. To determine which pokemon to transfer when duplicates exist, the pokemons are compared according to the
RELEASE_METHOD= "ADVANCED", this method allows you to keep a minimum amount of pokemon basen on their CP or IVALWAYS_RELEASE_BELOW_LEVELThis will release all pokemon below a specified level, ignoring all below options. A pokemon level can range from 1-40 for all pokemon types. For reference you can check this table to see how much CP each pokemon will have on different levels. Using Level provides an easy way to filter bad pokemons across all pokemon types.KEEP_CP_OVERDon't transfer any pokemon above this CP (this will apply no matter what you set inBEST_CP)KEEP_IV_OVERDon't transfer any pokemon above this IV (this will apply no matter what you set inBEST_IV)BEST_CPAdditional options for keeping pokemon based on their CPMIN_AMOUNTMinimum amount of pokemon to keep by CPKEEP_ADDITIONAL_SCALARThe value of this config is multiplied by the highest CP pokemon of a type and only those pokemon that are less than the scaled score are transfered.MAX_AMOUNTMaximum amount of pokemon to keep by CP
BEST_IVAdditional options for keeping pokemon based on their IVMIN_AMOUNTMinimum amount of pokemon to keep by IVKEEP_ADDITIONAL_SCALARThe value of this config is multiplied by the highest IV pokemon of a type and only those pokemon that are less than the scaled score are transfered.MAX_AMOUNTMaximum amount of pokemon to keep by IVIGNORE_BELOWPokemon with lover IV than this will be ignored byMIN_AMOUNTandKEEP_ADDITIONAL_SCALAR
RELEASE_METHOD= "MULTI", this method allows you to define different RELEASE_METHODs and configs for on a per pokemon basisMULTI_DEFAULT_RELEASE_METHODthis is the default RELEASE_METHOD that will be used for pokemon that don't have an explicit overrideRELEASE_METHOD_*configuration blocks can be provided here to override the values that come fromPOKEMON_CLEANUP=>RELEASE_METHOD_*as the default values for the specific pokemon release method configurationsPOKEMON_CONFIGSthis is a mapping of pokemon name to configuration overrides for that pokemonpokemon namethis is a pokemon name in the set of valid names forKEEP_POKEMON_NAMESRELEASE_METHODthis is required if the release method should be different fromMULTI_DEFAULT_RELEASE_METHODotherwise it will use defaultRELEASE_METHOD_*settings in these configuration blocks will override defaults for the this specificpokemon name
SCORE_METHOD- A pokemon's score is an arbitrary and configurable parameter defines how to sort pokemon by best > worst to decide which one to keep first. Possible values are "CP", "IV", "CPxIV", or "CP+IV" or the special "FANCY" method.
- The "FANCY" method uses the options a
WEIGHT_IVandWEIGHT_LVLwhich give the ability to specifically set more weight on Lvl or IV. The formula is as follows:(iv / 100.0 * SCORE_WEIGHT_IV) + level / (player_level+1.5) * SCORE_WEIGHT_LVLwhere player_level+1.5 is the max level that pokemon can reach when fully powered up.
NEEDY_ITEM_FARMING[Experimental] will cease trying to catch pokemon and roam around to collect more pokeballs when inventory is lowENABLE:Boolean, whether or not this feature is enabledPOKEBALL_FARM_THRESHOLD:Integer, when the observed pokeball count drops on or below this number, skip catching pokemon and begin collecting.POKEBALL_CONTINUE_THRESHOLD:Integer, when the observed pokeball count reaches this amount, stop farming and go back to catching pokemon.FARM_IGNORE_POKEBALL_COUNT:Boolean, Whether to include this ball in counting. Same goes forGREATBALL,ULTRABALL, andMASTERBALL. Masterball is ignored by default.FARM_OVERRIDE_STEP_SIZE:Integer, When it goes into farming mode, the bot assumes this step size to potentially speed up resource gathering. This might lead to softbans. Setting to-1disables this feature. Disabled by default for safety.- If
EXPERIMENTALORCATCH_POKEMONare false, this configuration will disable itself.
CONSOLE_OUTPUTOptions for configuring logging messages-
COLORLOGA dictionary for the various modules that support colored logging. Currently this is implemented in the following modules:poketrainer, fort_walker, poke_catcher, release, evolve, and inventory. Use of red is discouraged since this is reserved forpokecli.pyand error logging. Valid color options are as follows, shamelessly copied from the readme.md fromcolorlog.The following escape codes are made available for use in the format string:
-
{color},fg_{color},bg_{color}: Foreground and background colors. -
bold,bold_{color},fg_bold_{color},bg_bold_{color}: Bold/bright colors. -
reset: Clear all formatting (both foreground and background colors). -
The availible color names are
"black","red","green","yellow","blue","purple","cyan"and"white". Multiple escape codes can be used at once by joining them with commas. (ex."black,bg_white")
-
-
There are more options, check the current config.json.example, many are self-explanatory.
For Chosing what Items to keep, get the names here, AeonLucidProtos_ItemID For Choosing what pokemon to keep get the names here,AeonLucidProtos_Pokemon
Put them in config. Type exactly as the name appears
- For windows you will probably need to install Microsoft Visual C++ Compiler for Python 2.7 first
- Install git via your package manager or download it for windows
- Python 2.7 or 3.5 windows downloads
- Run
pip install -r requirements.txtin the bots folder from your console- requests
- protobuf
- gpsoauth
- geopy (only for pokecli demo)
- s2sphere (only for pokecli demo)
Although this project was originally built for Python 2.7, we have recently added support for Python 3.5. However, our tools that allow web.py to talk with pokecli.py currently require them to run on the same version of Python. So, if you choose to use Python 3 for one of them, you must use it for both of them (and vice versa for Python 2).
If you make changes to the Python code, please use tox to run flake8 and isort checks against the code. If you see any errors, please fix them before opening a pull request.
To run tox, just install the package and run the tox command from the root
directory of the project. tox will automatically install flake8 and isort
packages into a virtual environment as needed when it runs.
pip install tox
tox
If you are not updating the Python code, you do not need to install or use tox.
Build and run container:
cd poketrainer/
docker build -t pokecli .
docker run -ti --name poketrainer -v /path/to/poketrainer/config.json:/config.json -p 5000:5000 pokecli -i 0
The name option, poketrainer in the example, is arbirary. Multilple containers can be made using different names. -v maps the config file into the container. You can modify config.json and it will be reread when the container is started, no need to recreate the container or rebuild the image. -p maps the web interface to the external network, so you can check on the status of your training from a different machine. If you choose not to map the port, the ip address of the container can be found
using docker inspect poketrainer.
The container is now running in the foregorund, and can be stopped by using Ctrl+C. The container can be detached using the sequence Ctrl+p Ctrl+q. To stop a container running in the background, run docker stop poketrainer and restart it using docker start poketrainer. This will start the docker container in the background, attach to it using 'docker attach poketrainer`.
You can create an alias for this by adding alias pokecli='docker start poketrainer && docker attach poketrainer' to ~/.bashrc.
What's working:
- A lot of things. Check out the example config to see some of the features. Catching Lured pokemon, sniping, regular pokemon, multiple kinds of navigation (google maps, walking, driving, customized speed), a web ui, auto transfers, auto evolves, auto power ups, auto egg incubation, inventory managament, multiple account botting. And much more, README to be updated soon.
To ask question related to api and general help, join Pokemon Go Reverse Engineering Slack team.
- [keyphact/UK6 team] https://github.com/keyphact/pgoapi for the unknown6 fix
- tejado for the base of this
- elliottcarlson for the Google Auth PR
- AeonLucid for improved protos
- AHAAAAAAA for parts of the s2sphere stuff
- beeedy for ability to transfer duplicate pokemon
- infinitewarp for introducing tox and cleaning up the code
- And to anyone on the pokemongodev slack channel <3
super sketch but yolo