Documentation ¶
Index ¶
- Constants
- Variables
- func Console(level logging.LogLevel, text string)
- type Action
- type ActionResults
- type Actions
- type Alignment
- type Backend
- type BuffDetector
- type ClientRole
- type Event
- type EventBus
- type InputManager
- type InterruptKind
- type Key
- type Macro
- func (m *Macro) Copy() *Macro
- func (m *Macro) GetRoot() *Macro
- func (m *Macro) GetWindow() *window.Window
- func (m *Macro) SetError(err error, context string)
- func (m *Macro) SetRedirect(routine RoutineKind) error
- func (m *Macro) Unwatch(ch <-chan (<-chan struct{}))
- func (m *Macro) Watch() <-chan (<-chan struct{})
- type Message
- type MessageKind
- type Network
- type NetworkClient
- type NetworkRelay
- type PatternLoader
- type Receiver
- type RedirectExecution
- type RoutineExecutor
- type RoutineKind
- type Scheduler
- type SubroutineExecutor
- type VicHop
Constants ¶
View Source
const ( MainClientRole = "main" SearcherClientRole = "searcher" PassiveClientRole = "passive" InactiveClientRole = "inactive" )
Variables ¶
View Source
var ( RestartSignal = errors.New("restart") // Restarts the routine TerminateSignal = errors.New("terminate") // Terminates the routine RetrySignal = errors.New("retry") // Retry the current action StepBackSignal = errors.New("step back") // Step back to the last action )
View Source
var Routines = make(map[RoutineKind]Actions)
View Source
var Send = struct{}{}
Functions ¶
Types ¶
type ActionResults ¶
type Actions ¶
type Actions []Action
func (Actions) Register ¶
func (a Actions) Register(kind RoutineKind)
type BuffDetector ¶
type ClientRole ¶
type ClientRole string
type InputManager ¶
type InterruptKind ¶
type InterruptKind int
const ( DelayedInterrupt InterruptKind = iota IntervalInterrupt )
type Macro ¶
type Macro struct { sync.Mutex Root *Macro CancelPattern context.CancelFunc Account string EventBus EventBus Input InputManager Backend Backend Scheduler Scheduler Results *ActionResults State *config.Object[config.State] MacroState *config.Object[config.MacroState] Settings *config.Object[config.Settings] Database *config.Object[config.AccountDatabase] Network *Network VicHop VicHop BuffDetect BuffDetector Pattern PatternLoader Logger *logging.Logger Window *window.Window WinManager *window.Manager Scratch *config.Scratch Routine RoutineExecutor Subroutine SubroutineExecutor Action func(Action) error Status func(string) Pause <-chan (<-chan struct{}) Stop chan struct{} Error chan string Redirect chan *RedirectExecution Watchers []chan (<-chan struct{}) UnpauseWatchers []chan<- struct{} }
func (*Macro) SetRedirect ¶
func (m *Macro) SetRedirect(routine RoutineKind) error
func (*Macro) Watch ¶
func (m *Macro) Watch() <-chan (<-chan struct{})
Watch returns channel which outputs a channel or a nil value whenever the macro is paused or stopped. If a new channel is received, it indicates that the macro is paused and that the channel should be used to wait for unpause. This function must be used in asynchronous operations that are executed outside the routine loop.
type Message ¶
type Message struct { Kind MessageKind Sender string Receiver string Content string Data []byte `json:"-"` }
type MessageKind ¶
type MessageKind int
const ( RegistrationMessageKind MessageKind = iota AckRegistrationMessageKind ConnectedIdentitiesMessageKind SetRoleMessageKind AckSetRoleMessageKind VicDetectMessageKind NightDetectMessageKind SearchedServerMessageKind ShutdownMessageKind UnknownMessageKind )
type Network ¶
type Network struct { Client NetworkClient Relay NetworkRelay Watchers []chan *Message }
type NetworkClient ¶
type NetworkClient interface { Start() Close() Subscribe(kind MessageKind) chan *Message SubscribeOnce(kind MessageKind) <-chan *Message SetRole(ClientRole) error Send(receiver string, content interface{}) Broadcast(content interface{}) Connect(address string) error Disconnect() UnsubscribeAll() }
type NetworkRelay ¶
type NetworkRelay interface { }
type PatternLoader ¶
type RedirectExecution ¶
type RedirectExecution struct {
Routine RoutineKind
}
func (RedirectExecution) Error ¶
func (e RedirectExecution) Error() string
type RoutineExecutor ¶
type RoutineExecutor func(kind RoutineKind)
type RoutineKind ¶
type RoutineKind string
type Scheduler ¶
type Scheduler interface { Execute(interruptType InterruptKind) Start() Close() Initialize(macro *Macro) RequestFrame() <-chan *image.RGBA }
type SubroutineExecutor ¶
type SubroutineExecutor func(actions []Action)
Click to show internal directories.
Click to hide internal directories.