| TinTin++ Mud Client Manual |
|
TinTin++ Alias All Bell Buffer Chat Chat Protocol Class Colors Commands Config Cr Delay Echo Forall Format Function Gag Grep Help Highlight If Ignore Info Kill Line List Log Loop Macro Map |
|
|
| Function |
| Syntax: #function {name} {commands} |
| The function command is used much like a variable, except that you can pass along arguments. You can execute commands inside a function, and after the function is finished the line that called the function has the function call replaced with whatever the $result variable holds. |
| The result variable is also used in the echo command, so you should be careful when using #echo inside a function. You can use a function by calling it with: @<functionname>{<arguments>} the arguments are stored in %0 to %99, with %0 holding all arguments, %1 the first, %2 the second, etc. The arguments are separated by spaces. |
Example: #function {time} {#format {epoch} {%T};#format {result} {%t} {$epoch}} |
| The first command of the function will store the number of seconds since 1970 in $epoch. The second command will use this number to store the current time in $result. Using: #showme @time{} will display the current military time, no arguments are used in this example. |
| See the scripts section for more complex examples. |
| Notice: You can remove functions with the #unfunction command. |