System information

Manual:Scripting
26
Keywords
The following words are keywords and cannot be used as variable and function names:
and or not in
Delimiters
The following tokens serve as delimiters in the grammar:
() [] {} : ; $ /
Data types
RouterOS scripting language has following data types:
Type Description
number - 64bit signed integer, possible hexadecimal input;
boolean - values can bee true or false;
string - character sequence;
IP - IP address;
internal ID - hexadecimal value prefixed by '*' sign. Each menu item has assigned unique number - internal ID;
time - date and time value;
array - sequence of values organized in an array;
nil - default variable type if no value is assigned;
Constant Escape Sequences
Following escape sequences can be used to define certain special character within string:
\" Insert double quote
\\ Insert backslash
\n Insert newline
\r Insert carriage return
\t Insert horizontal tab
\$ Output $ character. Otherwise $ is used to link variable.
\? Output ? character. Otherwise ? is used to print "help" in console.
\_ - space
\a - BEL (0x07)
\b - backspace (0x08)
\f - form feed (0xFF)
\v Insert vertical tab
\xx Print character from hex value. Hex number should use capital letters.
:put "\48\45\4C\4C\4F\r\nThis\r\nis\r\na\r\ntest";
which will show on display
HELLO