TinTin++ Mud Client Manual
Math
space
Syntax: #math {variable} {mathematical expression}
space
See the mathematics manual entry for a list of operators that can be used.
space
Math allows you to perform calculations and store the result in the given variable. It also allows for string and regexp comparisons.
space
Example: #math sumvar {(1 + 1) * 10}
space
This basic operation would store the result (which is 20) in sumvar.
space
If the calculation contains floating point numbers the result is stored as a floating point number with the same precision as the argument with the highest precision.
space
Example: #math var {1.0 / 4}
space
Stores the result (which is 0.2) in var. Using 1.00 / 4 would store 0.25
space
Example: #math var 2d6
space
The d operator stands for dice, with 2d6 being the equivalent of throwing two 6-headed dice. If you need a random number between 1 and 100 you would use 1d100. If you need a random number between 0 and 9 you would use 1d10 - 1.
space
Example: The other operators behave more or less like one would expect.
space
See also: Format, Function, Local, Replace, Script and Variable.
space