Debug
(These are all accessible in the global table, e.g.: getconstant(...))
debug.isvalidlevel
<boolean> debug.isvalidlevel(<number> level)
Returns whether level is a valid level or not.
debug.getregistry
<table<function | thread>> debug.getregistry()
Returns the lua registry.
debug.getconstant
<any> debug.getconstant(<function | number> func, <number> index)
Returns the constant at index in the constant table of the function or level func. Throws an error if the constant does not exist.
debug.getconstants
<table<any>> debug.getconstants(<function | number> func)
Returns the constant table of the function or level func.
Returns debugger information about a function or stack level.
Returns the proto at index in the function or level func if active is false.
If active is true, then every active function of the proto is returned.
debug.getprotos
Returns a list of protos of the function or level func.
Returns the value at index in the stack frame level. Throws an error if no value could be found.
If index is not specified, then the entire stack frame is returned.
debug.getupvalue
Returns the upvalue at index in the function or level func. Throws an error if the upvalue does not exist.
An upvalue is a local variable used by an inner function, and is also called an external local variable.
Read more on Lua visibility rules.
debug.getupvalues
Returns a list of upvalues of the function or level func.
debug.setconstant
Sets the constant at index in the function or level func to value.
Sets the register at index in the stack frame level to value.
debug.setupvalue
Sets the upvalue at index in the function or level func to value.