Skip to content

Overview

Moongate accepts commands through its interactive server console. Press * to unlock the prompt after startup; console lock locks it again. On the console, TAB completes the command name and then the arguments that have fixed values, such as account create and its levels, script reload and the .lua files, help and the command names (a second TAB lists what matches what you typed); it never offers a user name or a password. Up and Down walk the lines you sent since the start (the last 100; an account create line with a password is never kept), and Escape clears the line. In game, type a command with a leading dot, such as .help. Commands are separated on whitespace; quoted arguments and passwords containing spaces are not supported.

The command registry describes which commands may run from InGame and their minimum account level. The console is treated as an administrator; in-game commands use the invoking session’s account level. Command input and ordinary command output stay private to the caller. broadcast explicitly sends a system message to everyone in the local world, and a successful save announces completion. shutdown also announces the requested server stop to players. Use ..text to say .text literally.

“Console” means the server console (always treated as an administrator); “In game” means typed with a leading dot by a character whose account has at least the minimum level. The role is the server mode that registers the command: Login, Game, or both in Standalone.

Command Syntax Console In game Minimum level Role
help help [command] Yes Yes Regular Every role
echo, e echo <text> Yes Yes Regular Every role
version version Yes Yes Regular Every role
uptime uptime Yes Yes Regular Every role
time time No Yes Regular Game
console console lock Yes No — Every role
script script reload <file> / script metrics Yes No — Game
account create account create <username> <password> [level] Yes Yes, in Standalone Administrator Login / Standalone
account api-access account api-access <username> <on|off> Yes, local only No — (local console) Login / Standalone
character character pending [account-serial] / character restore <character-serial> Yes Yes GameMaster Game
save save Yes Yes Administrator Game
sql_backup sql_backup Yes Yes Administrator Every role
broadcast broadcast <text> Yes Yes Administrator Game
shutdown shutdown [seconds] Yes Yes Administrator Game
restart restart [seconds] Yes Yes Administrator Game
decorate decorate Yes Yes Administrator Game
initial_spawn initial_spawn Yes Yes Administrator Game
globallight globallight [0-31] Yes Yes GameMaster Game
spawn spawn <template>, then target a spot No Yes GameMaster Game
set set <hits|mana|stamina|hunger|thirst|criminal> <value>, then target a mobile No Yes GameMaster Game
skill skill <name> <points>, then target a mobile No Yes GameMaster Game
add add <template>, then target a spot No Yes GameMaster Game
remove remove, then target an NPC or an item on the ground No Yes GameMaster Game
kill kill, then target an NPC or a player No Yes GameMaster Game
write write, then target an engraved stone No Yes Regular Game
tame tame [name], then target a creature No Yes GameMaster Game
resurrect resurrect, then target a corpse or a ghost No Yes GameMaster Game
animate animate <action>, then target a mobile No Yes GameMaster Game
where where, then target anything No Yes GameMaster Game
go go [<x>,<y>,<z> [map] | <place>] No Yes GameMaster Game
gmtools gmtools No Yes GameMaster Game
items items [text] No Yes GameMaster Game
npcs npcs [text] No Yes GameMaster Game
pages pages No Yes GameMaster Game
event event [list|on|off|auto <id>] Yes Yes Administrator Game
hide hide No Yes GameMaster Game
unhide unhide No Yes GameMaster Game
moongate moongate <x>,<y>,<z> [map] No Yes GameMaster Game
jail jail [name] No Yes GameMaster Game
fame fame <0..32000>, then target a mobile No Yes GameMaster Game
karma karma <-32000..32000>, then target a mobile No Yes GameMaster Game
weather weather [none|rain|snow|storm] No Yes GameMaster Game
season season [spring|summer|fall|winter|desolation|auto] No Yes GameMaster Game
spawns spawns No Yes GameMaster Game
gump gump <id> [name=value ...] No Yes GameMaster Game
music music [track] No Yes GameMaster Game
lock lock, then target a door No Yes GameMaster Game
unlock unlock, then target a door No Yes GameMaster Game
key key, then target a door No Yes GameMaster Game
book book <template> [name=value ...] No Yes GameMaster Game
create_check create_check <1..2000000000> No Yes GameMaster Game
add_gold add_gold <1..60000>, then target a mobile No Yes GameMaster Game
mark_rune mark_rune, then target a recall rune No Yes GameMaster Game
add_spell add_spell <key | number | circle N | all>, then target a spellbook or a mobile No Yes GameMaster Game
add_reagents add_reagents <key | number | circle N | all> [amount] No Yes GameMaster Game

A script runs any of these commands with the commands module of Lua:

commands.execute("season", "winter") -- as the console: every power, no player
commands.execute_as(player, "go", "britain") -- as that player wrote it in game
  • commands.execute(name, ...) runs the command as the server console does. A command that needs a player, such as one that opens a target cursor, answers that it works in game only. What the command answers is written in the server log.
  • commands.execute_as(player, name, ...) runs it as that player: with the level of its account, so a command above it is refused, and with its session, so a cursor opens for it. The player reads what the command answers.
  • The arguments follow the name, one each: strings, numbers and booleans. They are joined by spaces into one line, so an argument with a space in it is read as two.
  • Both answer true when the command was started and false when there is nothing to run: an empty name, a line end in the name or in an argument, a player that is not in the world. The command runs on its own, as one typed in game does: the script does not wait for it and does not get what it answered.
  • Everyone: help, echo, time, version, uptime, write.
  • Game masters: character, spawn, add, set, skill, remove, kill, tame, resurrect, animate, where, go, gmtools, items, npcs, pages, jail, hide, unhide, moongate, fame, karma, globallight, weather, music, season, spawns, gump, lock, unlock, key, book, create_check, add_gold, mark_rune, add_spell, add_reagents.
  • Administrators: account, save, sql_backup, broadcast, shutdown, restart, event, decorate, initial_spawn, plus everything a game master uses.
  • Console only: console, script.

Commands that ask for a target open the client’s target cursor after checking their arguments; pressing Escape prints Target canceled. and changes nothing. The texts they print are in the server language (see Localization).

Made with ❤️ by Tom

Buy me a coffee