TinTin++ Mud Client Manual  
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
Variable
space
Syntax: #variable {name} {string}
space
Variables differ from the %0-99 arguments in the fact that you can specify a full word as a variable, and they stay in memory for the full session unless they are changed. They can be saved in the coms file, and can be set to different values if you have two or more sessions running at the same time. Variables are global for each session and can be accessed by adding a $ before the variable name.
space
Example: #alias {target} {#var target %0}
         #alias {x}      {cast 'acid blast' $target}
The name of a variable must exist of only letters and numbers in order to be substituted. If you do not meet these requirements do not panic, simply encapsulate the variable in braces:
space
Example: #variable {cool website} {http://tintin.sourceforge.net}
         chat I was on ${cool website} yesterday!
Variables can be nested using brackets, causing the variable to behave like an associative array.
space
Example: #var hp[self] 34;#var hp[target] 46
You can see the first nest of a variable using $variable[+1] and the last nest using $variable[-1]. Using $variable[-2] will report the second last variable, and so on. To show all indices use $variable[].
space
To see the nesting index of a variable use &variable.
space
Notice: In order to check if a variable exists you can use #if {&{variable}}
space
Notice: A non existent nested variable with an existing root variable will report itself as 0.
space
Notice: You can remove variables with the #unvariable command.
space