character

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package character reads characters captured by ForeverScribe (https://github.com/MattMaximo/foreverscribe, MIT) into a typed model.

Fields ForeverScribe did not capture are nil (or an empty string for text), never invented.

Index

Constants

View Source
const DBVariable = "ForeverScribeDB"

DBVariable is the one global the addon writes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	Key        string // "Realm:Name"; the name alone when the realm is empty
	Name       string
	Realm      string
	Level      *int
	Class      string
	Race       string
	Faction    string
	Money      *int
	XP         *int
	XPMax      *int
	RestedXP   *int // experience points (GetXPExhaustion), not a percentage
	CapturedAt *int64
	Addon      string
	Client     Client

	Equipment    map[string]EquippedItem // nil when not captured
	Bags         []ItemStack
	BagsCaptured bool
	Bank         []ItemStack
	BankCaptured bool // false until the player has opened the bank with ForeverScribe running

	Quests          []Quest
	QuestsCaptured  bool
	CompletedQuests []int
	Talents         *Talents
	Skills          []Skill
	SkillsCaptured  bool
	Professions     []Skill // each profession once
	Reputations     []Reputation
}

func LoadCharacter

func LoadCharacter(key string, rec lua.Table) Character

LoadCharacter builds one character from its record. key is the record's key in `chars`.

type Client

type Client struct {
	Version string
	Build   string
	TOC     string
}

Client is the game client that wrote the capture.

func (Client) Empty

func (c Client) Empty() bool

type EquippedItem

type EquippedItem struct {
	Slot          string
	ItemID        *int
	Enchant       *int
	Link          string
	Name          string
	ItemLevel     *int
	Quality       *int
	Durability    *int
	DurabilityMax *int
}

type File

type File struct {
	Addon      string
	Schema     *int
	Client     Client
	Characters []Character
}

File is everything one SavedVariables file holds.

func Load

func Load(vars map[string]any) (File, error)

Load builds models from parsed variables (the result of lua.Parse).

func LoadFile

func LoadFile(path string) (File, error)

LoadFile reads and parses a ForeverScribe.lua file. A malformed file is a *lua.ParseError.

func (File) CapturedAt

func (f File) CapturedAt() *int64

CapturedAt is the newest capture time over all characters.

func (File) ClientOf

func (f File) ClientOf(c Character) Client

ClientOf is the client block of one character, falling back to the file's.

type ItemStack

type ItemStack struct {
	ItemID int
	Count  int
	Name   string
	Link   string
}

type Objective

type Objective struct {
	Text string
	Have *int
	Need *int
	Done *bool
	Type string
}

type Quest

type Quest struct {
	QuestID    int
	Title      string
	Level      *int
	Zone       string
	Complete   *bool
	Failed     *bool
	Objectives []Objective
}

type Reputation

type Reputation struct {
	FactionID int
	Name      string
	Standing  *int
	Value     *int
	Min       *int
	Max       *int
	AtWar     *bool
	Group     string
}

type Skill

type Skill struct {
	Name    string
	SkillID *int
	Rank    *int
	Max     *int
	Group   string
}

type Talent

type Talent struct {
	Name    string
	Group   string
	Rank    int
	MaxRank *int
	NodeID  *int
	SpellID *int
}

type TalentGroup

type TalentGroup struct {
	Name  string
	Order *int
	Spent int
}

TalentGroup is one named branch of a tree (for example "Discipline") and its spent points.

type TalentTree

type TalentTree struct {
	Name      string
	Points    *int // points spent in the tree
	Unspent   *int // currency.unspent
	MaxPoints *int // currency.max
	Groups    []TalentGroup
	Talents   []Talent
}

type Talents

type Talents struct {
	System  string
	Loadout string
	Unspent *int // across the whole capture (tree currencies, else the top-level field)
	Trees   []TalentTree
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL