Lua API

Console module

Functions related to in-game console.

Usage

local Console = ELONA.require("core.Console")

Functions

register (mod_id, name, callback) Registers a new console command.
run () Runs registered command.

Functions

# register (mod_id, name, callback)

Registers a new console command.

Parameters:
  • mod_id : (string) the mod's id where the command is defined.
  • name : (string) the command name.
  • callback : (function) the command itself.
# run ()

Runs registered command.

Returns:
  • (any) the result of executed commands.
  • (nil) on failure