Common LUA Globals


The following global variables are pre-loaded for all LUA Service scripts.

Variable Type Description
TRACE_LEVEL 0 - 3 An integer value indicating if tracel-level debugging is currently enabled.
0 = none, 1 = DEBUG, 2 = DUMP, 3 = SPAM.
This can be used to avoid needless computation overhead when tracing is not activated.
SCRIPT_NAME String The "script name" key used by the loader to identify which LUA script content to execute.
SCRIPT_VERSION Number The version of the script which was loaded to return this LUA.
APPLICATION_NAME String The name of the n2svcd application which is executing this LUA.
SERVICE_MODULE String The class of the LuaService module which initiated this LUA.
LOADER_MODULE String The class of the LuaLoader module which loaded this LUA.
REQUIRE_LIST List of Table The list of internally-satisfiable require modules given to the LuaLoader to be used in conjunction with this script name. Most Loaders will not provide any require modules, in which case this global variable will be nil.
[] Table Anonymous table.
.name String The module name which will be internally satisfied by a require.
.lua_chunk String The LUA content (compiled or non-compiled) which satisfies the require.
.version Integer An associated version number provided by the loader logic.
INSTANCE_IDX Hex String The instance_idx of the LuaInstance currently executing this LUA.