config

package
v0.0.0-...-3f89074 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FullScreenWindowAlignment  WindowAlignment = "fullscreen"
	TopLeftWindowAlignment                     = "top-left"
	TopRightWindowAlignment                    = "top-right"
	BottomLeftWindowAlignment                  = "bottom-left"
	BottomRightWindowAlignment                 = "bottom-right"
)

Variables

View Source
var AppContext context.Context

Functions

func Concrete

func Concrete[T any](object Reactive, path string, args ...interface{}) *T

Types

type Account

type Account struct {
	Name           string `yaml:"name" key:"true"`
	Preset         string `yaml:"preset"`
	ServerID       string `yaml:"serverID,omitempty"`
	LinkCode       string `yaml:"linkCode,omitempty"`
	Invalid        bool   `yaml:"invalid,omitempty"`
	WindowConfigID string `yaml:"windowConfigID,omitempty"`
}

func (*Account) Delete

func (a *Account) Delete()

func (*Account) GenerateJoinUrl

func (a *Account) GenerateJoinUrl(ignoreLink bool) (string, error)

func (*Account) Load

func (a *Account) Load() error

func (*Account) Refresh

func (a *Account) Refresh() error

type AccountDatabase

type AccountDatabase struct {
	Accounts *List[Account] `yaml:"accounts"`
	Servers  *List[Server]  `yaml:"servers"`
}

func (*AccountDatabase) Add

func (d *AccountDatabase) Add(code string)

func (*AccountDatabase) Delete

func (d *AccountDatabase) Delete(name string)

func (*AccountDatabase) Get

func (d *AccountDatabase) Get(name string) *Account

type AltSync

type AltSync struct {
	AutoStartRelay bool `yaml:"autoStartRelay"`
}

type Config

type Config struct {
	Presets    *List[Settings]     `yaml:"presets"`
	Windows    *List[WindowConfig] `yaml:"windows"`
	Tools      *Object[Tools]      `yaml:"tools"`
	Networking *Object[Networking] `yaml:"networking"`
	DevMode    bool                `yaml:"devMode"`
}

type DiscordSettings

type DiscordSettings struct {
	Enabled    bool   `yaml:"enabled"`
	WebhookUrl string `yaml:"webhookUrl,omitempty"`
	PingID     int    `yaml:"pingID,omitempty"`
}

type File

type File[T any] struct {
	// contains filtered or unexported fields
}

func (*File[T]) Close

func (f *File[T]) Close()

func (*File[T]) Object

func (f *File[T]) Object() *Object[T]

func (*File[T]) Runtime

func (f *File[T]) Runtime() *Runtime

func (*File[T]) Save

func (f *File[T]) Save() error

type Format

type Format int
const (
	JSON Format = iota
	YAML
)

type JellyTool

type JellyTool struct {
	Enabled         bool          `yaml:"enabled"`
	BeeTypes        *List[string] `yaml:"beeTypes"`
	RequireMutation bool          `yaml:"requireMutation"`
	MutationType    string        `yaml:"mutationType" default:"Movespeed"`
	MutationValue   int           `yaml:"mutationValue" default:"0"`
	StopGifted      bool          `yaml:"stopGifted"`
	StopMythic      bool          `yaml:"stopMythic"`
}

type List

type List[T any] struct {
	// contains filtered or unexported fields
}

func (*List[T]) Append

func (c *List[T]) Append(chain chain, index int, value interface{}) error

func (*List[T]) Delete

func (c *List[T]) Delete(chain chain, index int) error

func (*List) File

func (c *List) File() Savable

func (*List[T]) ForEach

func (c *List[T]) ForEach(callback func(*T))

func (*List[T]) ForEachObject

func (c *List[T]) ForEachObject(callback func(*Object[T]))

func (*List[T]) Get

func (c *List[T]) Get(chain chain, index int) (interface{}, error)

func (*List[T]) GetConcrete

func (c *List[T]) GetConcrete(chain chain, index int) (interface{}, error)

func (*List[T]) Initialize

func (c *List[T]) Initialize(path string, file Savable) error

func (*List[T]) Length

func (c *List[T]) Length(chain chain, index int) int

func (*List[T]) Listen

func (c *List[T]) Listen(chain chain, index int, callback func(ListenOp, interface{})) error

func (*List[T]) MarshalYAML

func (c *List[T]) MarshalYAML() (interface{}, error)

func (*List[T]) Set

func (c *List[T]) Set(chain chain, index int, value interface{}) error

func (*List[T]) UnmarshalYAML

func (c *List[T]) UnmarshalYAML(unmarshal func(interface{}) error) error

type ListenOp

type ListenOp int
const (
	Set ListenOp = iota
	Append
	Delete
)

type LoopState

type LoopState struct {
	Unwind *UnwindLoop
	Index  []int
}

type MacroCounters

type MacroCounters struct {
	ClaimedHive int `state:"claimedHive" default:"-1" yaml:"-"`
}

type MacroNetworkingConfig

type MacroNetworkingConfig struct {
	SavedRelays *List[NetworkIdentity] `yaml:"savedRelays"`

	AvailableRelays     *List[NetworkIdentity] `state:"availableRelays" yaml:"-"`
	ConnectedIdentities *List[NetworkIdentity] `state:"connectedIdentities" yaml:"-"`
	ConnectingAddress   string                 `state:"connectingAddress" yaml:"-"`
	ConnectedAddress    string                 `state:"connectedAddress" yaml:"-"`
	RelayStarting       bool                   `state:"relayStarting" yaml:"-"`
	RelayActive         bool                   `state:"relayActive" yaml:"-"`
	RoleRegisterError   string                 `state:"roleRegisterError" yaml:"-"`

	Identity string `state:"identity" yaml:"-"`
}

type MacroSettings

type MacroSettings struct {
	KeyDelay int `yaml:"keyDelay" default:"50"`
}

type MacroState

type MacroState struct {
	AccountName string `yaml:"accountName" key:"true"`

	Running bool `state:"running" yaml:"-"`
	Paused  bool `state:"paused" yaml:"-"`

	Status string `state:"status" default:"Ready" yaml:"-"`

	Counters *Object[MacroCounters] `state:"counters" default:"true" yaml:"-"`

	HoneyOriginX int `state:"honeyOriginX" yaml:"-"`
	HoneyOriginY int `state:"honeyOriginY" yaml:"-"`

	BaseOriginX int `state:"baseOriginX" yaml:"-"`
	BaseOriginY int `state:"baseOriginY" yaml:"-"`

	HotbarOriginX int `state:"hotbarOriginX" yaml:"-"`
	HotbarOriginY int `state:"hotbarOriginY" yaml:"-"`

	Networking *Object[MacroNetworkingConfig] `yaml:"networking"`
}

type NetworkIdentity

type NetworkIdentity struct {
	Address  string `yaml:"address" key:"true"`
	Identity string `yaml:"identity"`
	Role     string `yaml:"role,omitempty"`
}

type Networking

type Networking struct {
	AutoConnect bool `yaml:"autoConnect"`
}

type Object

type Object[T any] struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(runtime *Runtime) (*Object[Config], error)

func NewDatabase

func NewDatabase(runtime *Runtime) (*Object[AccountDatabase], error)

func NewState

func NewState(runtime *Runtime) (*Object[State], error)

func (*Object[T]) Append

func (c *Object[T]) Append(chain chain, index int, value interface{}) error

func (*Object[T]) AppendPath

func (c *Object[T]) AppendPath(path string) error

func (*Object[T]) AppendPathf

func (c *Object[T]) AppendPathf(path string, args ...interface{}) error

func (*Object[T]) Delete

func (c *Object[T]) Delete(chain chain, index int) error

func (*Object[T]) DeletePath

func (c *Object[T]) DeletePath(path string) error

func (*Object[T]) DeletePathf

func (c *Object[T]) DeletePathf(path string, args ...interface{}) error

func (*Object) File

func (c *Object) File() Savable

func (*Object[T]) Get

func (c *Object[T]) Get(chain chain, index int) (interface{}, error)

func (*Object[T]) GetConcrete

func (c *Object[T]) GetConcrete(chain chain, index int) (interface{}, error)

func (*Object[T]) GetObjectPath

func (c *Object[T]) GetObjectPath(path string) (interface{}, error)

func (*Object[T]) GetPath

func (c *Object[T]) GetPath(path string) (interface{}, error)

func (*Object[T]) GetPathf

func (c *Object[T]) GetPathf(path string, args ...interface{}) (interface{}, error)

func (*Object[T]) Initialize

func (c *Object[T]) Initialize(path string, file Savable) error

func (*Object[T]) Length

func (c *Object[T]) Length(chain chain, index int) int

func (*Object[T]) LengthPath

func (c *Object[T]) LengthPath(path string) int

func (*Object[T]) Listen

func (c *Object[T]) Listen(chain chain, index int, callback func(ListenOp, interface{})) error

func (*Object[T]) ListenPath

func (c *Object[T]) ListenPath(path string, callback func(ListenOp, interface{})) error

func (*Object[T]) MarshalYAML

func (c *Object[T]) MarshalYAML() (interface{}, error)

func (*Object[T]) Object

func (c *Object[T]) Object() T

func (*Object[T]) Set

func (c *Object[T]) Set(chain chain, index int, value interface{}) error

func (*Object[T]) SetPath

func (c *Object[T]) SetPath(path string, value interface{}) error

func (*Object[T]) SetPathf

func (c *Object[T]) SetPathf(value interface{}, path string, args ...interface{}) error

func (*Object[T]) UnmarshalYAML

func (c *Object[T]) UnmarshalYAML(unmarshal func(interface{}) error) error

type Pattern

type Pattern struct {
	PatternMetadata
	ID    string `yaml:"id" key:"true"`
	Order int    `yaml:"order"`
}

type PatternMetadata

type PatternMetadata struct {
	Position        int
	Length          int
	Width           int
	Distance        int
	RotateDirection int
	RotateCount     int
	InvertFB        bool
	InvertLR        bool

	BackpackPercentage int
	Minutes            int
	ShiftLock          bool
	ReturnMethod       string
	DriftComp          bool
	GatherPattern      bool

	AutoUpdate bool
	Version    int
}

type PatternOverride

type PatternOverride struct {
	PatternMetadata
	Name string `yaml:"id" key:"true"`
}

type PatternSettings

type PatternSettings struct {
	Overrides      *List[PatternOverride] `yaml:"overrides"`
	Active         *List[Pattern]         `yaml:"active"`
	RetryCount     int                    `yaml:"retryCount" default:"3"`
	AlignmentLevel string                 `yaml:"alignmentLevel" default:"Low"`
}

type PlayerSettings

type PlayerSettings struct {
	MoveSpeed float64 `yaml:"moveSpeed" default:"24"`
}

type Reactive

type Reactive interface {
	Initialize(path string, file Savable) error
	Set(chain chain, index int, value interface{}) error
	Get(chain chain, index int) (interface{}, error)
	GetConcrete(chain chain, index int) (interface{}, error)
	Append(chain chain, index int, value interface{}) error
	Delete(chain chain, index int) error
	Length(chain chain, index int) int
	Listen(chain chain, index int, callback func(ListenOp, interface{})) error
	File() Savable
}

type Runtime

type Runtime struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(ctx context.Context) *Runtime

func (*Runtime) AddRoot

func (r *Runtime) AddRoot(name string, object Reactive)

func (*Runtime) Append

func (r *Runtime) Append(path string, primitive bool, key string)

func (*Runtime) Delete

func (r *Runtime) Delete(path string)

func (*Runtime) Listen

func (r *Runtime) Listen()

func (*Runtime) Set

func (r *Runtime) Set(path string, value interface{})

func (*Runtime) Start

func (r *Runtime) Start()

type Savable

type Savable interface {
	Save() error
	Runtime() *Runtime
}

type Scratch

type Scratch struct {
	LoopState *LoopState
	LastError error
	Stack     []string
	Redirect  bool
	// contains filtered or unexported fields
}

func NewScratch

func NewScratch() *Scratch

func (*Scratch) Add

func (s *Scratch) Add(name string, value int)

func (*Scratch) Clear

func (s *Scratch) Clear(name string)

func (*Scratch) Decrement

func (s *Scratch) Decrement(name string)

func (*Scratch) ExecutingRoutine

func (s *Scratch) ExecutingRoutine(routine string) bool

func (*Scratch) Get

func (s *Scratch) Get(name string) interface{}

func (*Scratch) Increment

func (s *Scratch) Increment(name string)

func (*Scratch) PrintStack

func (s *Scratch) PrintStack() string

func (*Scratch) Reset

func (s *Scratch) Reset(name string)

func (*Scratch) Set

func (s *Scratch) Set(name string, value interface{})

func (*Scratch) Subtract

func (s *Scratch) Subtract(name string, value int)

type Server

type Server struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Settings

type Settings struct {
	Name         string                   `yaml:"name" key:"true"`
	LogVerbosity int                      `yaml:"logVerbosity"`
	Discord      *Object[DiscordSettings] `yaml:"discord"`
	Window       *Object[WindowSettings]  `yaml:"window"`
	Player       *Object[PlayerSettings]  `yaml:"player"`
	Patterns     *Object[PatternSettings] `yaml:"patterns"`
	VicHop       *Object[VicHop]          `yaml:"vicHop"`
	Macro        *Object[MacroSettings]   `yaml:"macro"`
}

Settings defines the configuration for an individual preset

type State

type State struct {
	Config *Object[StateConfig] `yaml:"config"`
	Macros *List[MacroState]    `yaml:"macros"`

	VicHop *Object[VicHopVersion] `state:"vicHop" yaml:"-"`
}

type StateConfig

type StateConfig struct {
	CodeStatus    string `state:"codeStatus" default:"pending" yaml:"-"`
	DefaultPreset string `yaml:"defaultPreset" default:"Default"`
	ActiveAccount string `yaml:"activeAccount,omitempty" default:"Default"`
}

type Tools

type Tools struct {
	JellyTool *Object[JellyTool] `yaml:"jellyTool"`
}

type UnwindLoop

type UnwindLoop struct {
	Depth    int
	Continue bool
}

type VicHop

type VicHop struct {
	Enabled   bool   `yaml:"enabled"`
	Role      string `yaml:"role"` // Main, Passive, or Searcher
	ServerHop bool   `yaml:"serverHop"`
}

type VicHopMacroStatistics

type VicHopMacroStatistics struct {
}

type VicHopStatistics

type VicHopStatistics struct {
}

type VicHopVersion

type VicHopVersion struct {
	DatasetVersion     string `state:"datasetVersion"`
	DownloadingDataset bool   `state:"downloadingDataset"`
	UpToDate           bool   `state:"upToDate"`
}

type WindowAlignment

type WindowAlignment string

type WindowConfig

type WindowConfig struct {
	ID        string          `yaml:"id" key:"true" lock:"default"`
	Alignment WindowAlignment `yaml:"alignment" default:"top-left"`
	FullWidth bool            `yaml:"fullWidth" default:"true"`
	Screen    int             `yaml:"screen"`
}

type WindowSettings

type WindowSettings struct {
	WindowConfigID         string     `yaml:"windowConfigId"`
	WindowSize             WindowSize `yaml:"windowSize" default:"full"`
	PrivateServerLink      string     `yaml:"privateServerLink,omitempty"`
	FallbackToPublicServer bool       `yaml:"fallbackToPublicServer" default:"true"`
}

type WindowSize

type WindowSize string
const (
	QuarterWindowSize WindowSize = "quarter"
	HalfWindowSize    WindowSize = "half"
	FullWindowSize    WindowSize = "full"
)

Jump to

Keyboard shortcuts

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