bot

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TickInterval = 150 * time.Millisecond

Variables

This section is empty.

Functions

This section is empty.

Types

type Bindings

type Bindings struct {
	World          *World
	InputState     func(client.Context) (suspended, keyboardAvailable bool)
	ControlUI      func(client.Context, string) bool
	ClearHighlight func()
}

Bindings connects the script to the active mode without owning game state.

type PendingSkill

type PendingSkill struct {
	Skill      session.Skill
	MaxLevel   int
	Target     string
	CasterID   uint32
	CasterKind string
	CasterX    int
	CasterY    int
}

type Script

type Script struct {
	Path string

	Context client.Context

	NextTick          time.Time
	Disabled          bool
	KeyboardAvailable bool

	BlockedButtons [input.GamepadButtonCount]bool
	// contains filtered or unexported fields
}

The manager owns one script for the active mode. WorldMode borrows it to run gameplay callbacks at the appropriate points in its update.

func New

func New(ctx client.Context, path string, bindings Bindings) (*Script, error)

func (*Script) Active

func (b *Script) Active() bool

func (*Script) Close

func (b *Script) Close()

func (*Script) Fail

func (b *Script) Fail(callback string, err error)

func (*Script) HandleGamepad

func (b *Script) HandleGamepad(ctx client.Context, dt float64) input.GamepadCapture

The script claims controls before the renderer's pointer fallback.

func (*Script) InGame

func (b *Script) InGame() bool

func (*Script) InputFrame

func (b *Script) InputFrame(available bool) error

func (*Script) KeyPress

func (b *Script) KeyPress(code input.KeyCode) error

func (*Script) Tick

func (b *Script) Tick() error

type World

type World struct {
	Walk            func(client.Context, int, int) bool
	Stop            func(client.Context) bool
	Attack          func(client.Context, uint32) bool
	Skill           func(client.Context, uint32, session.Skill, int) bool
	Loot            func(client.Context, uint32) bool
	UseItem         func(client.Context, int) bool
	UsePendingSkill func(client.Context, uint32) bool
	HighlightActor  func(client.Context, uint32) bool
	SkillTargets    func(client.Context, bool, time.Time) []worldstate.Actor
	PendingSkill    func(client.Context) (PendingSkill, bool)
	CanAttack       func(client.Context, worldstate.Actor) bool
	ActorDead       func(uint32) bool
	CompanionLife   func(client.Context, uint32) (int, int, int, int, bool)
	WalkSequence    func() uint64
	UseShortcut     func(client.Context, int) (uint16, bool)
	RotateCamera    func(client.Context, float64, float64)
	ZoomCamera      func(client.Context, float64)
	CameraYaw       func(client.Context) float64
	CancelSkill     func()
}

World supplies the game operations without exposing WorldMode or Lua state. All callbacks are provided together; a nil World is used during login.

Jump to

Keyboard shortcuts

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