Debug.lua
A small library allowing simple debugging of multiple types, including tables, of up to 30 lines. Values can be printed with or without a headings. Values are printed at the end of every tick to the top left of the screen and down the left side. In the future, this library will allow debugging with priority.
Download 1.2: http://hastebin.com/zutozocaga.lua
Installation
Place the file debug.lua into the LuaScriptsLib folder.
How to use
To enable the Debug library for a specific level, add this line to lunadll.lua:
local debug = API.load("debug");
This will load the Debug API.
Example
local debug = API.load("debug");
local t = {1, [3] = 5, ["word"] = "string"};
local number = 73;
function onTick()
debug.table(t, "aTable");
debug.simple(number);
end
Should print:
aTable[1]: 1
aTable[3]: 5
aTable[word]: string
73
Functions
| type | object | heading |
|---|---|---|
| Prints the type of an object. | object | string: optional
Not required, but when not nil will print the string given by the second argument preceding the value. |
| simple | object | heading |
| Prints the values of an object, but only errors if it is not number, boolean, nil, or string type. | object | string: optional
Not required, but when not nil will print the string given by the second argument preceding the value. |
| table | table | heading |
| Prints out all indices of the table. | table | string: optional
Not required, but when not nil will print the string given by the second argument preceding the value. |