nodeka

package
v0.0.0-...-6a1bf87 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Abilities = map[string]*Ability{} // Map of ability names to ability structs
View Source
var AbilityDown func(*client.Trigger) = func(t *client.Trigger) {
	if buff, ok := Abilities[t.Matches[1]]; ok {
		buff.IsActive = false
	}
	if Autobuff && GetState() == Stopped {
		client.OnEvent("OnReply", "doAutobuff", func() { CheckBuff() }, false)
	}
}

AbilityDown handles when a buff drops, preparing it to be cast again.

View Source
var AbilityFired func(*client.Trigger) = func(t *client.Trigger) {
	if name, ok := Activations[t.String()]; ok {
		if ab, ok := Abilities[name]; ok {
			ab.IsActive = true
			if ab.Prevention != "" {
				Preventions[ab.Prevention] = true
			}
			if BuffAttempt == ab {

				BuffAttempt = nil
				BuffTarget = ""
				if DoingBuff {
					CheckBuff()
				}
				return
			}
			if AttackAttempt == ab {
				AttackAttempt = nil
				AttackTarget = ""
			}
		}
	}
}
View Source
var Activations = map[string]string{} // Map of activation strings to ability name
View Source
var AdjustedSessionPPM float64 = 0
View Source
var AdjustedSessionPlat float64 = 0
View Source
var AdjustedTotalPPM float64 = 0
View Source
var AdjustedTotalPPMCount float64 = 0
View Source
var AdjustedTotalPlat float64 = 0
View Source
var Areas map[string]*Area = nil
View Source
var ArmorLevels = []int{0, 3, 6, 10, 15, 19, 23, 28, 34, 40, 46, 53, 61, 70, 80}
View Source
var AttackTarget = ""
View Source
var Autobuff = false
View Source
var BagIndex int = 0
View Source
var Bags []*Bag = []*Bag{}
View Source
var BuffTarget = ""
View Source
var Buffs = []string{}
View Source
var ClassCheck func(*Ability, string) bool = nil
View Source
var ClassConfigs = map[string]func(){
	"sorcerer": initSorcerer,
	"footpad":  initFootpad,
	"paladin":  initPaladin,
	"marauder": initMarauder,
	"witch":    initWitch,
	"valkyrie": initValkyrie,
	"druid":    initDruid,
	"ninja":    initNinja,
	"poliir":   initPoliir,
	"monk":     initMonk,
	"fallad":   initFallad,
	"nojohr":   initNojohr,
}
View Source
var Combo = []string{}
View Source
var Combos = map[string][]string{}
View Source
var Config *client.Config
View Source
var DoingBuff = false
View Source
var GetList map[*Component]int = map[*Component]int{}
View Source
var GetScraps bool = false
View Source
var Initializing bool = false
View Source
var Map *mapper.Map = nil
View Source
var MobList []*Mob = []*Mob{}
View Source
var NRooms int = 0
View Source
var NextRoom *mapper.Room = nil
View Source
var PlayerSkip = true
View Source
var PreventAvailable func(*client.Trigger) = func(t *client.Trigger) {
	Preventions[t.Results["type"]] = false
	if t.Results["type"] == "run time" {
		My.RunPercent = 300
		return
	}
	if t.Results["type"] == "run time decrement" {
		C.Parse("prev")
		return
	}
	if Autobuff && GetState() == Stopped {
		client.OnEvent("OnReply", "doAutobuff", func() { CheckBuff() }, false)
	}
}
View Source
var PreventUsed func(*client.Trigger) = func(t *client.Trigger) {
	Preventions[t.Matches[1]] = true
	if DoingBuff {
		BuffAttempt = nil
		CheckBuff()
		return
	}
	if BuffAttempt != nil {
		if t.Matches[1] == BuffAttempt.Prevention {
			AbilityFailed(nil)
			return
		}
	}
	if AttackAttempt != nil {
		if t.Matches[1] == AttackAttempt.Prevention {
			AbilityFailed(nil)
			return
		}
	}
}
View Source
var Preventions = map[string]bool{}
View Source
var PutType string = ""
View Source
var RoundAccuracy float64 = 0
View Source
var RoundAverageAccuracy float64 = 0
View Source
var RoundAverageDamage = 0
View Source
var RoundCount = 0
View Source
var RoundDamage = 0
View Source
var SaveList []*Component = []*Component{}
View Source
var SawFull bool = false
View Source
var SawPlayer = false
View Source
var SawPut bool = false
View Source
var SawQuestLine = false
View Source
var Score map[*mapper.Room]int = nil
View Source
var ScrapValues = map[string]int{
	"metal":   5,
	"wood":    4,
	"cloth":   4,
	"leather": 3,
}
View Source
var SeenPreventDuration = time.Second * 0
View Source
var SeenPreventName = ""
View Source
var SessionExp float64 = 0
View Source
var SessionPPM float64 = 0
View Source
var SessionPlat float64 = 0
View Source
var SessionStart time.Time
View Source
var SessionXPM float64 = 0
View Source
var SleepOn = true
View Source
var SleepTick int = 4
View Source
var SleepTimer *time.Timer = nil

Timers

View Source
var Smiles int = 0
View Source
var Start *mapper.Room = nil
View Source
var TickTime = 59
View Source
var TimeStart time.Time
View Source
var TotalExp float64 = 0
View Source
var TotalPPM float64 = 0
View Source
var TotalPlat float64 = 0
View Source
var TotalXPM float64 = 0
View Source
var TradeList map[*Component]int = map[*Component]int{}
View Source
var TradeMaterials []*Component = []*Component{}
View Source
var TriggerMap map[*client.Trigger]*Mob
View Source
var Visited []*mapper.Room = nil
View Source
var WatchdogTimer *time.Timer = nil
View Source
var WeaponLevels = []int{0, 5, 10, 15, 19, 23, 28, 34, 40, 46, 53, 61, 70, 80, 90}

Functions

func AbilityFailed

func AbilityFailed(t *client.Trigger)

func AddGetName

func AddGetName(name string, num int, t string)

func AddSmile

func AddSmile(t *client.Trigger)

func BagsFull

func BagsFull(t string) bool

func Begin

func Begin()

Should fire when we see the exit line, mobs come right after

func BotAttack

func BotAttack()

func BotResume

func BotResume(t *client.Trigger)

func BotStart

func BotStart(r *mapper.Room)

func BotStop

func BotStop(t *client.Trigger)

func BotTrain

func BotTrain(t *client.Trigger)

func BowDown

func BowDown(t *client.Trigger)

func CheckBuff

func CheckBuff()

CheckBuff returns true if a buff is ready and is being attempted

func CombatPrompt

func CombatPrompt(t *client.Trigger)

func ComponentCount

func ComponentCount(t string, comp *Component) int

func CraftInit

func CraftInit(t *client.Trigger)

func CraftItemClearCmd

func CraftItemClearCmd(t *client.Trigger)

func CraftItemGemClassCmd

func CraftItemGemClassCmd(t *client.Trigger)

func CraftItemGemCmd

func CraftItemGemCmd(t *client.Trigger)

func CraftItemGetCmd

func CraftItemGetCmd(t *client.Trigger)

func CraftItemMats

func CraftItemMats(recipe string, fstring string, trade bool, add bool)

func CraftItemMatsCmd

func CraftItemMatsCmd(t *client.Trigger)

func CraftItemMatsTradeAddCmd

func CraftItemMatsTradeAddCmd(t *client.Trigger)

func CraftItemMatsTradeCmd

func CraftItemMatsTradeCmd(t *client.Trigger)

func CraftItemPrimaryCmd

func CraftItemPrimaryCmd(t *client.Trigger)

func CraftItemRPCmd

func CraftItemRPCmd(t *client.Trigger)

func CraftItemSecondaryCmd

func CraftItemSecondaryCmd(t *client.Trigger)

func CraftItemShowCmd

func CraftItemShowCmd(t *client.Trigger)

func CraftItemSlotCmd

func CraftItemSlotCmd(t *client.Trigger)

func DamageLine

func DamageLine(t *client.Trigger)

func DepleteGem

func DepleteGem(t *client.Trigger)

func DoAttack

func DoAttack(target string, ab *Ability)

func DoBags

func DoBags()

func DoBuff

func DoBuff(target string, ab *Ability)

func DoCombo

func DoCombo(target string)

func DoPut

func DoPut(t string)

func DoShoot

func DoShoot(sa string)

func DoStep

func DoStep()

func DoTick

func DoTick()

func DoTrade

func DoTrade()

func GemScrollAdd

func GemScrollAdd(t *client.Trigger)

func GemScrollComplete

func GemScrollComplete(t *client.Trigger)

func GerahfDone

func GerahfDone(t *client.Trigger)

func GerahfHere

func GerahfHere(t *client.Trigger)

func GerahfOffer

func GerahfOffer(t *client.Trigger)

func GetAllComponentsCmd

func GetAllComponentsCmd(t *client.Trigger)

func GetAllGemstonesCmd

func GetAllGemstonesCmd(t *client.Trigger)

func GetAllScrapsCmd

func GetAllScrapsCmd(t *client.Trigger)

func GetAllType

func GetAllType(t string)

Messes up inventory - need to do it one bag at a time TODO one bag at a time

func GetAvailableTradeComponents

func GetAvailableTradeComponents() map[int][]*Component

Any component that isn't the max tier for that class is returned by this function, TODO add a more granular way to specify components to trade

func GetComponentCmd

func GetComponentCmd(t *client.Trigger)

func GetCounts

func GetCounts(available map[int][]*Component) map[int]int

func GetDone

func GetDone()

func GetGemsAbove

func GetGemsAbove(num int) int

func GetGemsAboveCmd

func GetGemsAboveCmd(t *client.Trigger)

func GetMats

func GetMats(comp *Component)

func GetMatsCmd

func GetMatsCmd(t *client.Trigger)

func GetNext

func GetNext()

func GetScrapsCmd

func GetScrapsCmd(t *client.Trigger)

func GetTradeCost

func GetTradeCost(comp *Component) int

GetTradeCost returns the cost of the component based on whether the user has smiles or not

func GetTradeValue

func GetTradeValue(comp *Component) int

GetTradeValue returns the value of the component provided when used to trade for another component.

func GetTradeableScraps

func GetTradeableScraps()

func GiveFailed

func GiveFailed(t *client.Trigger)

func GnomeBegin

func GnomeBegin(t *client.Trigger)

func GoTrain

func GoTrain(t *client.Trigger)

func IgnoreGold

func IgnoreGold(t *client.Trigger)

func InInventory

func InInventory(t *client.Trigger)

func Init

func Init(c *client.Client, file string) *client.Config

func InventoryFull

func InventoryFull(t *client.Trigger)

func IsPrevented

func IsPrevented(buff *Ability) bool

func IsPreventedString

func IsPreventedString(name string) bool

func MapLine

func MapLine(t *client.Trigger)

func MobDead

func MobDead()

func MobDeath

func MobDeath(t *client.Trigger)

func MobMissing

func MobMissing(t *client.Trigger)

func MoveComponent

func MoveComponent(t *client.Trigger)

func NextPath

func NextPath()

func NimCaught

func NimCaught(t *client.Trigger)

func NimDown

func NimDown(t *client.Trigger)

func NimReset

func NimReset()

func NimWait

func NimWait()

func OpenDoor

func OpenDoor(t *client.Trigger)

func PoolPrompt

func PoolPrompt(t *client.Trigger)

func PutAllCmd

func PutAllCmd(t *client.Trigger)

func PutComponentCmd

func PutComponentCmd(t *client.Trigger)

func PutDone

func PutDone(t *client.Trigger)

func PutFragmentsCmd

func PutFragmentsCmd(t *client.Trigger)

func PutGemstoneCmd

func PutGemstoneCmd(t *client.Trigger)

func PutScrapsCmd

func PutScrapsCmd(t *client.Trigger)

func Recalled

func Recalled(t *client.Trigger)

func ReplyPrompt

func ReplyPrompt(t *client.Trigger)

func Reset

func Reset()

func SalvageComplete

func SalvageComplete(t *client.Trigger)

func SaveComponent

func SaveComponent(comp *Component) bool

saveComponent returns true if the component should be saved from trading away

func SawBag

func SawBag(t *client.Trigger)

func SawBagFull

func SawBagFull(t *client.Trigger)

func SawComponent

func SawComponent(t *client.Trigger)

func SawMob

func SawMob(t *client.Trigger)

func SawPutLine

func SawPutLine()

func SawQuest

func SawQuest(t *client.Trigger)

func SawTech

func SawTech(t *client.Trigger)

func ScrollContinue

func ScrollContinue(t *client.Trigger)

func SetActive

func SetActive(t *client.Trigger)

func SetSmileCmd

func SetSmileCmd(t *client.Trigger)

SetSmileCmd sets the number of smiles we have received.

func SetState

func SetState(state BotState)

func SetStateCmd

func SetStateCmd(t *client.Trigger)

func SetTickTime

func SetTickTime(t *client.Trigger)

func ShowComp

func ShowComp(t string)

func ShowCompCmd

func ShowCompCmd(t *client.Trigger)

func ShowCraftLevelsCmd

func ShowCraftLevelsCmd(t *client.Trigger)

func ShowCraftRecipesCmd

func ShowCraftRecipesCmd(t *client.Trigger)

func ShowCraftSlotsCmd

func ShowCraftSlotsCmd(t *client.Trigger)

func ShowGemCmd

func ShowGemCmd(t *client.Trigger)

func ShowGetListCmd

func ShowGetListCmd(t *client.Trigger)

func ShowScrapCmd

func ShowScrapCmd(t *client.Trigger)

func SkipRoom

func SkipRoom(t *client.Trigger)

func StacyBegin

func StacyBegin(t *client.Trigger)

func StartCmd

func StartCmd(t *client.Trigger)

func StatusUpdate

func StatusUpdate()

func StepDone

func StepDone()

func StepFailed

func StepFailed(t *client.Trigger)

func Stop

func Stop()

func TickLoop

func TickLoop()

func TickSet

func TickSet(t *client.Trigger)

func ToggleTriggers

func ToggleTriggers(aname string, enabled bool)

func TradeAddCmd

func TradeAddCmd(t *client.Trigger)

TradeAddCmd adds a component to the trade list

func TradeClearCmd

func TradeClearCmd(t *client.Trigger)

TradeClear clears the trade list and state

func TradeComponentCmd

func TradeComponentCmd(t *client.Trigger)

func TradeDone

func TradeDone()

func TradeJewelsCmd

func TradeJewelsCmd(t *client.Trigger)

func TradeSalvageCmd

func TradeSalvageCmd(t *client.Trigger)

func TradeSaveCmd

func TradeSaveCmd(t *client.Trigger)

TradeSaveCmd adds a component to the SaveList so it will not be used as a component in the next trade

func TradeScrapsCmd

func TradeScrapsCmd(t *client.Trigger)

SCRAPS

func TradeShowCmd

func TradeShowCmd(t *client.Trigger)

TradeShowCmd shows the current list of components we want to trade to get.

func TradeShowSaveCmd

func TradeShowSaveCmd(t *client.Trigger)

TradeShowSaveCmd shows the list of components we want to avoid trading away.

func TradesLeft

func TradesLeft(t *client.Trigger)

func WatchdogFired

func WatchdogFired()

Types

type Ability

type Ability struct {
	Name       string
	Mana       int      // Mana cost of ability
	Spirit     int      // Spirit cost of ability
	Endurance  int      // Endurance cost of ability
	Prevention string   // prevention string
	MinAlign   int      // Must have at least this alignment to use
	MaxAlign   int      // Must have less than this alignment to use
	IsActive   bool     // Is the ability active?
	Activation []string // List of regexes that match activation strings
	Execute    string   // String to execute the ability
	Triggers   []*client.Trigger
}
var AttackAttempt *Ability = nil
var BuffAttempt *Ability = nil

type AbilityData

type AbilityData struct {
	Abilities map[string]*Ability
}

type Area

type Area struct {
	Name       string
	Mobs       []*Mob
	TriggerMap map[*client.Trigger]*Mob
}

type Bag

type Bag struct {
	Keyword  string
	Contents map[string]map[*Component]int
	Full     bool
	Types    []string
}
var CurrentBag *Bag = nil
var Inventory *Bag = nil

type BagConfig

type BagConfig struct {
	Keyword string
	Start   int
	End     int
	Types   []string
}

type BotState

type BotState string
const (
	Walking   BotState = "walking"
	Training  BotState = "training"
	Trading   BotState = "trading"
	Stopped   BotState = "stopped"
	Recalling BotState = "recalling"
	Step      BotState = "step"
	Stepping  BotState = "stepping"
	Stepped   BotState = "stepped"
	Attack    BotState = "attack"
	Attacking BotState = "attacking"
	Attacked  BotState = "attacked"
)

func GetState

func GetState() BotState

type Character

type Character struct {
	Name             string
	Exp              float64
	Align            int
	Gold             float64
	Lag              int
	CurrentHP        int
	MaxHP            int
	HPP              int
	CurrentMana      int
	MaxMana          int
	MPP              int
	CurrentSpirit    int
	MaxSpirit        int
	SPP              int
	CurrentEnd       int
	MaxEnd           int
	EPP              int
	Salvage          int
	PKFlag           bool
	Tank             string
	TankCondition    string
	Target           string
	TargetCondition  string
	Position         Position
	RunPercent       int
	BotDefault       string
	SalvageRoom      int
	TrainCommand     string
	AttackCommand    string
	NimAttackPercent int
}
var My Character

type CharacterConfig

type CharacterConfig struct {
	Recall           int
	SalvageRoom      int
	Buffs            []string
	Combos           map[string][]string
	Class            string
	BagConfigs       []*BagConfig
	BotDefault       string
	TrainCommand     string
	AttackCommand    string
	NimAttackPercent int
}
var CC *CharacterConfig = nil

func LoadConfig

func LoadConfig(name string) *CharacterConfig

type Component

type Component struct {
	Name      string
	Tier      int
	ID        int
	Material  string
	Class     string
	Type      string
	Expertise bool
	Artistry  bool
}
var GetTarget *Component = nil
var TradeTarget *Component = nil

func GetCombo

func GetCombo(cost int, available map[int][]*Component) []*Component

func GetComponentByType

func GetComponentByType(material, class string, tier int) *Component

func GetGemByClass

func GetGemByClass(cls string) *Component

type ComponentTrade

type ComponentTrade struct {
	Target    *Component
	Want      int
	Materials []*Component
}

type CraftData

type CraftData struct {
	BagConfigs []*BagConfig
	Recipes    []*Recipe
	Components map[string]*Component
}
var Craft *CraftData = nil

type CraftItem

type CraftItem struct {
	Primary   *Component
	Secondary *Component
	Gemstones map[string]*Component
	Slot      *ItemSlot
	Points    int
}
var Item *CraftItem = &CraftItem{
	Primary:   nil,
	Secondary: nil,
	Gemstones: map[string]*Component{},
	Slot:      nil,
	Points:    0,
}

func NewCraftItem

func NewCraftItem() *CraftItem

type ItemSlot

type ItemSlot struct {
	Name              string
	PrimaryAmount     int
	PrimaryMaterial   string
	SecondaryAmount   int
	SecondaryMaterial string
	Mob               string
}

type Mob

type Mob struct {
	Name     string
	Single   string
	Multiple string
	Attack   string
}

type MoveDirection

type MoveDirection string
const (
	MoveGet    MoveDirection = "moveget"
	MovePut    MoveDirection = "moveput"
	MovePutAll MoveDirection = "moveputall"
	MoveGive   MoveDirection = "movegive"
	MoveNone   MoveDirection = "movenone"
)
var Move MoveDirection = MoveNone

type Position

type Position string
const (
	Sleep Position = "sleep"
	Rest  Position = "rest"
	Stand Position = "stand"
	Fight Position = "fight"
)

type Recipe

type Recipe struct {
	Class     string
	Transform string
	Points    int
	Stats     []string
}

type TradeState

type TradeState string
const (
	TradeSalvage        TradeState = "tradesalvage"
	TradeScraps         TradeState = "tradescraps"
	TradeJewels         TradeState = "tradejewels"
	TradeComponent      TradeState = "tradecomponent"
	TradeComponentReady TradeState = "tradecomponentready"
	TradeNone           TradeState = "tradenone"
)
var Trade TradeState = TradeNone

Jump to

Keyboard shortcuts

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