BrutusMUD help

SCRIPT REFERENCES

Level: 61

How to use variables and functions in scripts? To use them follow simple
rules:

- in IF command, everything not enclosed in double quotes (") is considered
to be variable name or function call. Functions have always one argument
enclosed in parentheses, this argument can be another function or
variable or numeric or string constant (string constant must be enclosed
in double quotes as usual)
- in normal text, you have to use '@' character to indicate something special
is following. To substitute value of variable, just use @variable. If you
need a function call, you have to enclose this call in parentheses, so it
looks like this: @(function(arg))
To use name of character, you can use just @variable, where variable is
one of type char.

examples:

To say name of character referenced to by variable 'target':
say Target's name is @target

To say how many hitpoints this character has:
say @target has @(hit(target)) hitpoints

To find level of character with name 'fido' in the same room:
say fido is level @(level(get_char_room("fido")))

If target is good or neutral, greet him, otherwise kill him:
if (isgood(target) || isneutral(target))
bow @actor
else
mpkill @actor

 

Back to index

 
 

© Michal Kumžák 2011 | Provozováno na CMS E4E | Mapa webu