crafter

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Delay whenever crafting is paused
	PauseDelay = 1 * time.Second

	// Duration of potion buff
	PotionDuration = 15 * time.Minute

	// Delay after key press
	KeyDelay = 500 * time.Millisecond

	// Delay for starting craft animations
	StartCraftDelay = 1500 * time.Millisecond

	// Delay for ending craft animations
	EndCraftDelay = 2500 * time.Millisecond
)

Variables

View Source
var (
	// Holds results to print out at exit
	Results = []Result{}
)

Functions

func PrintResults

func PrintResults()

PrintResults prints the results to stdout once XIVCrafter stops running

Types

type Crafter

type Crafter struct {
	Status int

	CurrentAmount int
	FoodCount     int

	PotionCount int

	Paused bool

	StopCrafterContext    context.Context
	StopCrafterCancelFunc context.CancelFunc
	StopHooksContext      context.Context
	StopHooksCancelFunc   context.CancelFunc
	// contains filtered or unexported fields
}

func NewCrafter

func NewCrafter(startPause string, stop string, confirm string, cancel string) *Crafter

NewCrafter returns a pointer to a Crafter struct

func (*Crafter) ExitProgram

func (c *Crafter) ExitProgram()

ExitProgram sets the running value to false and the paused value to true

func (*Crafter) Run

func (c *Crafter) Run() tea.Cmd

Run provides the main logic to handle crafting

func (*Crafter) RunHooks

func (c *Crafter) RunHooks() tea.Cmd

RunHooks provides the main logic to handle keyboard hook events

func (*Crafter) SetRecipe

func (c *Crafter) SetRecipe(name string, amount int, food string, foodDuration int, potion string, macro1 string, macro1Duration int, macro2 string, macro2Duration int, macro3 string, macro3Duration int)

func (*Crafter) StartProgram

func (c *Crafter) StartProgram()

StartProgram sets the paused value to false

func (*Crafter) StopProgram

func (c *Crafter) StopProgram()

StopProgram sets the paused value to true

type Result

type Result struct {
	// Name of recipe
	Name string

	// Total amount spent crafting the recipe
	CraftTime time.Duration

	// Total amount crafted
	CraftCount int

	// Total amount of food used
	FoodCount int

	// Total amount of potions used
	PotionCount int
}

func NewResult

func NewResult(name string, startTime time.Time, endTime time.Time, craftCount int, foodCount int, potionCount int) *Result

NewResults returns a pointer to a Result struct

Jump to

Keyboard shortcuts

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