Documentation
¶
Index ¶
- Variables
- func CheckCondition(queried any, operator string, expected any) (bool, error)
- func EnsureTargetPID() error
- func GenerateSchema() ([]byte, error)
- func PrintSchema() error
- type CommandExecutor
- func (e *CommandExecutor) ClearRecording() error
- func (e *CommandExecutor) ListCustomCommands() error
- func (e *CommandExecutor) ListKeysCommand() error
- func (e *CommandExecutor) ListMouseButtonsCommand() error
- func (e *CommandExecutor) Replay(speed float64, dumpPath string) error
- func (e *CommandExecutor) RunCustomCommand(name, request string, shouldRecord bool) error
- func (e *CommandExecutor) RunExitCommand() error
- func (e *CommandExecutor) RunGetMousePositionCommand() error
- func (e *CommandExecutor) RunGetWheelPositionCommand() error
- func (e *CommandExecutor) RunInputCommand(key, action string, durationTicks int64, async bool, shouldRecord bool) error
- func (e *CommandExecutor) RunMouseCommand(action string, x, y int, button string, durationTicks int64, async bool, ...) error
- func (e *CommandExecutor) RunPingCommand() error
- func (e *CommandExecutor) RunScreenshotCommand(output string, b64 bool, async bool, shouldRecord bool) error
- func (e *CommandExecutor) RunScriptCommand(input string, isFile bool) error
- func (e *CommandExecutor) RunStateCommand(name, path string, shouldRecord bool) error
- func (e *CommandExecutor) RunVersionCommand() error
- func (e *CommandExecutor) RunWaitForCommand(conditionStr, timeoutStr, intervalStr string, verbose bool, shouldRecord bool) error
- func (e *CommandExecutor) RunWheelCommand(x, y float64, async bool, shouldRecord bool) error
- type Condition
- type LaunchCommand
- type LaunchOptions
- type Writer
Constants ¶
This section is empty.
Variables ¶
var WaitForExitTimeout = 30 * time.Second
Functions ¶
func CheckCondition ¶ added in v0.6.0
CheckCondition compares a queried value against an expected value using the given operator.
func EnsureTargetPID ¶
func EnsureTargetPID() error
EnsureTargetPID auto-detects the game PID if not already set.
func GenerateSchema ¶ added in v0.3.0
GenerateSchema generates a JSON Schema from the Go structs.
func PrintSchema ¶ added in v0.3.0
func PrintSchema() error
PrintSchema prints the JSON schema to stdout.
Types ¶
type CommandExecutor ¶
type CommandExecutor struct {
// contains filtered or unexported fields
}
CommandExecutor executes CLI commands via RPC.
func NewCommandExecutor ¶
func NewCommandExecutor() *CommandExecutor
NewCommandExecutor creates a new CommandExecutor.
func (*CommandExecutor) ClearRecording ¶ added in v0.6.0
func (e *CommandExecutor) ClearRecording() error
ClearRecording clears the recording file for the current game.
func (*CommandExecutor) ListCustomCommands ¶ added in v0.3.0
func (e *CommandExecutor) ListCustomCommands() error
ListCustomCommands lists all registered custom commands.
func (*CommandExecutor) ListKeysCommand ¶
func (e *CommandExecutor) ListKeysCommand() error
ListKeysCommand lists all available key names.
func (*CommandExecutor) ListMouseButtonsCommand ¶
func (e *CommandExecutor) ListMouseButtonsCommand() error
ListMouseButtonsCommand lists all available mouse button names.
func (*CommandExecutor) Replay ¶ added in v0.6.0
func (e *CommandExecutor) Replay(speed float64, dumpPath string) error
Replay replays the recorded session.
func (*CommandExecutor) RunCustomCommand ¶ added in v0.3.0
func (e *CommandExecutor) RunCustomCommand(name, request string, shouldRecord bool) error
RunCustomCommand runs a custom command.
func (*CommandExecutor) RunExitCommand ¶ added in v0.7.0
func (e *CommandExecutor) RunExitCommand() error
RunExitCommand runs an exit command to signal the game to terminate.
func (*CommandExecutor) RunGetMousePositionCommand ¶ added in v0.3.0
func (e *CommandExecutor) RunGetMousePositionCommand() error
RunGetMousePositionCommand runs a get_mouse_position command.
func (*CommandExecutor) RunGetWheelPositionCommand ¶ added in v0.3.0
func (e *CommandExecutor) RunGetWheelPositionCommand() error
RunGetWheelPositionCommand runs a get_wheel_position command.
func (*CommandExecutor) RunInputCommand ¶
func (e *CommandExecutor) RunInputCommand(key, action string, durationTicks int64, async bool, shouldRecord bool) error
RunInputCommand runs an input command.
func (*CommandExecutor) RunMouseCommand ¶
func (e *CommandExecutor) RunMouseCommand(action string, x, y int, button string, durationTicks int64, async bool, shouldRecord bool) error
RunMouseCommand runs a mouse command.
func (*CommandExecutor) RunPingCommand ¶
func (e *CommandExecutor) RunPingCommand() error
RunPingCommand runs a ping command to check connection.
func (*CommandExecutor) RunScreenshotCommand ¶
func (e *CommandExecutor) RunScreenshotCommand(output string, b64 bool, async bool, shouldRecord bool) error
RunScreenshotCommand runs a screenshot command.
func (*CommandExecutor) RunScriptCommand ¶
func (e *CommandExecutor) RunScriptCommand(input string, isFile bool) error
RunScriptCommand runs a script from a file path or inline JSON string.
func (*CommandExecutor) RunStateCommand ¶ added in v0.6.0
func (e *CommandExecutor) RunStateCommand(name, path string, shouldRecord bool) error
RunStateCommand queries game state via a registered state exporter.
func (*CommandExecutor) RunVersionCommand ¶ added in v0.4.0
func (e *CommandExecutor) RunVersionCommand() error
RunVersionCommand runs the version command. Shows CLI version and attempts to get game version via ping.
func (*CommandExecutor) RunWaitForCommand ¶ added in v0.6.0
func (e *CommandExecutor) RunWaitForCommand(conditionStr, timeoutStr, intervalStr string, verbose bool, shouldRecord bool) error
RunWaitForCommand polls until a condition is met or timeout expires.
func (*CommandExecutor) RunWheelCommand ¶
func (e *CommandExecutor) RunWheelCommand(x, y float64, async bool, shouldRecord bool) error
RunWheelCommand runs a wheel command.
type Condition ¶ added in v0.6.0
type Condition struct {
Type string // "state" or "custom"
Name string // exporter or command name
Path string // path or request
ResponsePath string // optional JSON path to extract from response (e.g., ".found")
Operator string // ==, !=, <, >, <=, >=
Value any // expected value (parsed from JSON)
}
Condition represents a parsed wait condition.
func ParseCondition ¶ added in v0.6.0
ParseCondition parses a condition string in the format "type:name:path operator value". Path can include an optional response path suffix: "request.responsePath" where responsePath is a dot-separated path to extract from the JSON response. Example: "custom:autoui.exists:type=Button.found == true"
type LaunchCommand ¶ added in v0.7.0
type LaunchCommand struct {
// contains filtered or unexported fields
}
LaunchCommand handles the `autoebiten launch` functionality.
func NewLaunchCommand ¶ added in v0.7.0
func NewLaunchCommand(options *LaunchOptions) *LaunchCommand
NewLaunchCommand creates a new launch command handler.
func (*LaunchCommand) Run ¶ added in v0.7.0
func (lc *LaunchCommand) Run() error
type LaunchOptions ¶ added in v0.7.0
type LaunchOptions struct {
GameCmd string
GameArgs []string
Timeout time.Duration // Timeout waiting for game RPC server
}
LaunchOptions contains options for the launch command.