Multitool debug methods
The Multitool debug screen, at the bottom of your Multitool, works like a terminal window. These global methods allow you to display information on it, providing an easy output to make sure your code is working right.
This will print a message on the screen using the current settings. The method
print(message)
is an alias to this method.
Keep in mind that to log numerical values, they must first be converted into string withtostring(value)
.
logWarning( message string )
This will print a message on the screen, automatically colored yellow.
This will print a message on the screen, automatically colored red.
This will print a message on the screen without automatically adding a line break. Calling this method repeatedly will always print on the same line.
This will print a message on the screen adding a line break at the end. Functionally the same as
log(message)
.
setFgColor( colorId number )
Sets the foreground color of the text to be printed. Uses the numbers on the ANSI colors table for Foreground.
setBgColor( colorId number )
Sets the background color of the text to be printed. Uses the numbers on the ANSI colors table for Background.
resetFgColor( )
Resets the text foreground color to the default bright white.
resetBgColor( )
Resets the text background color to the default black.
resetColors( )
Resets both background and foreground colors for the text to their defaults.
setCursorPos( column number, line number )
Sets the absolute position of the cursor, that is, where text is going to be printed. Takes both
column
andline
at once.
setCursorX( column number )
Sets only the absolute horizontal position of the cursor to
column
.
setCursorY( line number )
Sets only the absolute vertical position of the cursor to
line
.
moveCursorX( deltaColumn number )
Moves the cursor relative to its current position, horizontally by an amount of
deltaColumn
characters.
moveCursorY( deltaLine number )
Moves the cursor relative to its current position, vertically by an amount of
deltaLine
characters.
Saves the current position of the cursor to memory.
Moves the cursor to the position previously saved with
saveCursorPos()
.
clear( )
Clears the entire screen.
Clears only the line where the cursor currently is.
ANSI colors
Foreground | Background | Name | Color |
---|---|---|---|
30 | 40 | Black | 0, 0, 0 |
31 | 41 | Red | 255, 0, 0 |
32 | 42 | Green | 0, 255, 0 |
33 | 43 | Yellow | 255, 255, 0 |
34 | 44 | Blue | 0, 0, 255 |
35 | 45 | Magenta | 255, 0, 255 |
36 | 46 | Cyan | 0, 255, 255 |
37 | 47 | White | 176, 174, 165 |
90 | 100 | Bright Black (Gray) | 24, 22, 13 |
91 | 101 | Bright Red | 255, 158, 144 |
92 | 102 | Bright Green | 193, 255, 177 |
93 | 103 | Bright Yellow | 255, 255, 177 |
94 | 104 | Bright Blue | 0, 40, 255 |
95 | 105 | Bright Magenta | 255, 159, 255 |
96 | 106 | Bright Cyan | 194, 255, 255 |
97 | 107 | Bright White | 255, 255, 255 |