https://github.com/sigafoos/pokemongo
A series of go packages for interacting with data from Pokemon Go's gamemaster file.
https://github.com/sigafoos/pokemongo
golang pokemon pokemon-go pokemongo
Last synced: 5 months ago
JSON representation
A series of go packages for interacting with data from Pokemon Go's gamemaster file.
- Host: GitHub
- URL: https://github.com/sigafoos/pokemongo
- Owner: Sigafoos
- License: mit
- Created: 2019-07-23T18:17:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-12T21:40:34.000Z (almost 6 years ago)
- Last Synced: 2025-04-09T14:20:05.475Z (9 months ago)
- Topics: golang, pokemon, pokemon-go, pokemongo
- Language: Go
- Size: 17.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# pokemon-go
[](code-of-conduct.md)
[](https://godoc.org/github.com/Sigafoos/pokemongo)
A library for dealing with Pokemon Go CP and IVs.
It requires you to have a `gamemaster.json` file in the same format as what PVPoke uses. The easiest way would be to... use PVPoke's:
```
curl -O https://raw.githubusercontent.com/pvpoke/pvpoke/master/src/data/gamemaster.json
```
## Usage
Here's an example `main.go`. It:
* loads the gamemaster file
* looks up Wobbuffet by its Pokedex number
* sets its level and IVs
* calculates its CP and stat product
* prints the object
```go
package main
import (
"fmt"
"os"
"github.com/Sigafoos/pokemongo"
)
func main() {
fp, err := os.Open("gamemaster.json")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer fp.Close()
gm, err := pokemongo.NewGamemaster(fp)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
wob := gm.PokemonByNumber(202)
wob.Level = 23.5
wob.IVs = pokemongo.Stats{
Attack: 10,
Defense: 13,
HP: 12,
}
wob.Calculate()
fmt.Printf("%+v\n", wob)
}
```