Cold Help System: Building: CML: Generators


columnize Generates a list of columnized strings taken from the argument list. Option cols defines column information.
def Requires option var which is the name of a variable. Creates a new variable generator with that name, which has the value of the first argument. Will not evaluate arguments, instead stores the unparsed first argument. Similar to set
english Generates an english-formatted list from the arguments. Options can include sep (element seperator, defaulting to ","), empty (what to print if the argument list is empty, defaulting to "nothing"), and (what to print as a seperator before the last element, defaulting to "and")
foreach Requires option list. Will iterate over body for each element in list. Additional option var may be defined for iteration variable, defaults to iterator
join Joins arguments. Options can include seperator which is either none, english or a string literal. If none the list is forwarded to the caller, rather than joined to a string
name Generates the names of the objects in the arguments list. Options can include seperator which is either none, english or a string literal. If none is given a list is generated, otherwise a string is generated
pro Generates a pronoun. Required option is obj which defines the object for the pronoun generation. First argument is taken as the type of pronoun to use, as defined on $gender
random Returns a random number ranging from low to high which are given as options. Low can be omitted, one is used then instead.
servname The name of the server, as is set on @set $motd:server-name
set Requires option var which is the name of a variable. Creates a new variable generator with that name, which has the value of the first argument. Will evaluate arguments and store results. Similar to def
switch Requires option value which is evaluated. The resulting value is then used to select a result. Currently switch uses every other item in the argument list as a case/value pair (use the join generator for arguments with spaces). If there is a remaining odd element is is considered the default result
time Arguments are sent to the native method $time.format()
vars Returns the names of variables available. Option separator is the same as in name generator

Other tags

Each cml processor can also create extra generators. Also, caller to the cml can create extra variables that are available for generators.


Formatters | Generators | Customizing Ctext


the Cold Dark