Skip to content

Commit

Permalink
Merge pull request #1 from PokemonGoF/dev
Browse files Browse the repository at this point in the history
update branch
  • Loading branch information
Surceis authored Jul 27, 2016
2 parents 6d3b1b0 + 1e1e5b9 commit 182047e
Show file tree
Hide file tree
Showing 16 changed files with 717 additions and 346 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ configs/*
!configs/config.json.example
!configs/release_config.json.example
!configs/config.json.pokemons.example
config.json
release_config.json

# Virtualenv folders
bin/
include/

#Pip check file
pip-selfcheck.json
pip-selfcheck.json
4 changes: 4 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@
* steffwiz
* pulgalipe
* BartKoppelmans
* phil9l
* VictorChen
* AlvaroGzP
* fierysolid
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ We use [Slack](https://slack.com) as a web chat. [Click here to join the chat!](
- [ ] Incubate eggs
- [ ] Use candy
- [ ] Fight Gym
- [ ] Inventory cleaner

## Wiki
All information on [Getting Started](https://github.com/PokemonGoF/PokemonGo-Bot/wiki/Getting-Started) is available in the [Wiki](https://github.com/PokemonGoF/PokemonGo-Bot/wiki/)!
Expand Down Expand Up @@ -171,20 +172,22 @@ To update your project do: `git pull` in the project folder
## Usage (up-to-date)
1. copy `config.json.example` to `config.json` and `release_config.json.example` to `release_config.json`
2. Edit `config.json` and replace `auth_service`, `username`, `password`, `location` and `gmapkey` with your parameters (other keys are optional, check `Advance Configuration` below)
3. Simply launch the script with : `./run.sh` or `./pokecli.py` or `python pokecli.py --config-file ./configs/config.json` if you want to specify a config file

## Advance Configuration
Option | Meaning
------ | -------
`max_steps` | The steps around your initial location (DEFAULT 5 mean 25 cells around your location) that will be explored
`mode` | Set farming Mode for the bot ('all', 'poke', 'farm'). 'all' means both spinning pokéstops and catching pokémon; 'poke'means only catching pokémon and 'farm' means only spinning pokéstops
`walk` | Walk with the given speed (meters per second max 4.16 because of walking end on 15km/h)
`walk` | Set the walking speed in kilometers per hour.(14km/h is the maximum speed for egg hatching)
`debug` | Let the default value here except if you are developer
`test` | Let the default value here except if you are developer
`initial_transfer` | Set this to an upper bound of the cp level which you want to transfer at the beginning of the run. For example, set the value to 0 to disable the initial transfer, set it to 100 to enable initial transfer for cp levels 0-99. It will still transfer pokémon during your exploration, depending on how your release_config.json is setup.
`initial_transfer` | Set this to true to transfer your pokemon at the beginning of the run based on your release config.
`location_cache` | Bot will start at last known location if you do not have location set in the config
`distance_unit` | Set the unit to display distance in (e.g, km for kilometers, mi for miles, ft for feet)
`item_filter` | Pass a list of unwanted items (in CSV format) to recycle when collected at a Pokestop (e.g, "101,102,103,104" to recycle potions when collected)
`evolve_all` | Set to true to evolve pokemons if possible, takes pokémon as an argument as well.
`evolve_all` | Set to true to evolve pokemon if possible, takes pokémon as an argument as well.
`evolve_speed` | Set the speed between each evolves in seconds. (Defaults to 3.7 seconds if not set)

## Catch Configuration
Default configuration will capture all Pokemon.
Expand All @@ -208,28 +211,32 @@ will release all Pidgey caught.

### Evolve All Configuration
By setting the `evolve_all` attribute in config.json, you can instruct the bot to automatically
evolve specified pokemons on startup. This is especially useful for batch-evolving after popping up
evolve specified pokemon on startup. This is especially useful for batch-evolving after popping up
a lucky egg (currently this needs to be done manually).

The evolve all mechanism evolves only higher IV/CP pokemons. It works by sorting the high CP pokemons (default: 300 CP or higher)
based on their IV values. After evolving all high CP pokemons, the mechanism will move on to evolving lower CP pokemons
The evolve all mechanism evolves only higher IV/CP pokemon. It works by sorting the high CP pokemon (default: 300 CP or higher)
based on their IV values. After evolving all high CP pokemon, the mechanism will move on to evolving lower CP pokemon
only based on their CP (if it can).
It will also automatically transfer the evolved pokemons based on the release configuration.
It will also automatically transfer the evolved pokemon based on the release configuration.

Examples on how to use (set in config.json):

1. "evolve_all": "all"
Will evolve ALL pokemons.
Will evolve ALL pokemon.
2. "evolve_all": "Pidgey,Weedle"
Will only evolve Pidgey and Weedle.
3. Not setting evolve_all or having any other string would not evolve any pokemons on startup.
3. Not setting evolve_all or having any other string would not evolve any pokemon on startup.

If you wish to change the default threshold of 300 CP, simply add the following to the config file:
"cp_min": <number>


## How to run with Docker

1. Build the image docker `build -t PokemonGo-Bot:latest .`
2. Start a new container from this newly created image `docker run -d --name pgobot PokemonGo-Bot:latest`
3. Check the logs in real-time `docker logs -f pgobot`

## How to add/discover new API
The example is [here](https://github.com/PokemonGoF/PokemonGo-Bot/commit/46e2352ce9f349cc127a408959679282f9999585)
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
Expand Down Expand Up @@ -317,7 +324,7 @@ ignore:
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.
The default port is 8000, 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.
Expand Down
19 changes: 15 additions & 4 deletions configs/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@
"walk": 4.16,
"debug": false,
"test": false,
"initial_transfer": 0,
"initial_transfer": false,
"location_cache": true,
"distance_unit": "km",
"item_filter": "",
"reconnecting_timeout": 15,
"item_filter": {
"1": { "keep" : 100 },
"101": { "keep" : 10 },
"102": { "keep" : 30 },
"103": { "keep" : 30 },
"201": { "keep" : 30 },
"701": { "keep" : 100 }
},
"evolve_all": "NONE",
"evolve_speed": 20,
"cp_min": 300,
"use_lucky_egg": false,
"evolve_captured": false,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
// "Rattata": { "always_catch" : true }
"// Example of always catching Rattata:": {},
"// Rattata": { "always_catch" : true }
},
"release": {
"any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
// "Rattata": { "always_release" : true }
"// Example of always releasing Rattata:": {},
"// Rattata": { "always_release" : true }
}
}
Loading

0 comments on commit 182047e

Please sign in to comment.