Skip to Content

Global functions

print and color_print: writing text to the game console.


print

print(...)

Writes to the game console in white. Arguments are separated by tabs and the line ends with a newline (one is added unless the text already ends with one). Whole numbers print as integers; other numbers use six significant digits. nil, booleans and strings print as themselves; tables print as table, coroutines as thread, Lua functions as undefined and C functions as function: 0x…; userdata and cdata print through __tostring, else as userdata: 0x…. Each string argument is truncated at its first NUL byte. The line also goes to the script's output, which MCP's lua_script_output reads; color_print does the same.

Returns: no values.

color_print

color_print(text, color?)

Writes text to the game console, ending it with a newline unless it already ends with one. Text is truncated at the first NUL byte. The default colour is white; a color argument that is not a colour also prints white.

Returns: no values.

On this page