lodestone-fetcher/main.go

58 lines
1004 B
Go

package main
import (
"log"
"slices"
"github.com/karashiiro/bingode"
"github.com/xivapi/godestone/v2"
)
func main() {
ignore := []string{
"Carpenter",
"Blacksmith",
"Armorer",
"Goldsmith",
"Leatherworker",
"Weaver",
"Alchemist",
"Culinarian",
"Miner",
"Botanist",
"Fisher",
}
base_levels := make(map[string]int)
base_levels["Dark Knight"] = 30
base_levels["Astrologian"] = 30
base_levels["Machinist"] = 30
base_levels["Red Mage"] = 50
base_levels["Samurai"] = 50
base_levels["Gunbreaker"] = 60
base_levels["Dancer"] = 60
base_levels["Reaper"] = 70
base_levels["Sage"] = 70
s := godestone.NewScraper(bingode.New(), godestone.EN)
c, err := s.FetchCharacter(29932586)
if err != nil {
log.Fatalln(err)
}
total := 0
for _, v := range c.ClassJobs {
if v.Name != "Scholar" && !slices.Contains(ignore[:], v.Name) {
base_level, ok := base_levels[v.Name]
if !ok {
base_level = 0
}
total += int(v.Level) - base_level
}
}
println(total)
}