script

package
v0.0.0-...-fb5bbcc Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(command string, args []string, session *network.Session) error

ExecCommand executes a Lua command using the provided arguments and session. It searches for the command handler across all loaded scripts and executes the first match found.

func Initialize

func Initialize(directory string)

Initialize loads all Lua scripts from the provided directory.

func RegisterFunc

func RegisterFunc(funcName string, callable LuaCallable)

RegisterFunc registers a Go function as a global function accessible from all Lua scripts.

Types

type LuaCallable

type LuaCallable interface {
	Call(L *lua.LState) []lua.LValue
}

LuaCallable represents an interface for objects that can be called within a Lua state.

Jump to

Keyboard shortcuts

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