DirkScripts
Docs
βΉοΈ Shared Module - This can be used by both clients and the server
#lib.print
Print colour-coded information to the console. Each type is accessed as a method on lib.print.
βΉοΈ The debug type only prints when the resource has debug mode enabled via scriptConfig.
lualib.print.info("Server started successfully") lib.print.warn("Config value missing, using default") lib.print.error("Failed to load resource") lib.print.debug("Variable x =", x)
| Method | Description |
|---|---|
lib.print.info(...) | General information |
lib.print.warn(...) | Warnings |
lib.print.error(...) | Errors |
lib.print.debug(...) | Debug output (only in debug mode) |
| Parameter | Type | Required | Description |
|---|---|---|---|
| _type | String | true | Type of print - info, warn, error or debug |
| ... | Any | true | Debug info |
#lib.print.addType
Register a custom print type
lualib.print.addType(type, prefixText, color, condition)
| Parameter | Type | Required | Description |
|---|---|---|---|
| _type | String | true | Unique print type |
| prefix | String | true | What should be prefixed in front of the debug |
| condition | Function | true | Callback to check if it should print |
