TinTin++ Mud Client Manual
         FUNCTION

Command: #function {name} {operation}

         Functions allow you to execute a script within a line of text, and
         replace the function call with the line of text generated by the
         function.

         Be aware that each function should set the $result variable at the
         end of the function, or call #return with the given result.

         To use a function use the @ character before the function name.
         The function arguments should be placed between braces behind the
         function name with argument separated by semicolons.

         The function itself can use the provided arguments which are stored
         in %1 to %9, with %0 holding all arguments.

Example: #function {rnd} {#math {result} {1 d (%2 - %1 + 1) + %1 - 1}}
         #showme A random number between 100 and 200: @rnd{100;200}

Example: #function gettime {#format result %t %H:%M}
         #showme The current time is @gettime{}

Comment: You can remove a function with the #unfunction command.

Related: format, local, math, replace, script and variable.