Functions

The following PernWorld specific functions have been documented. They work like the built in global functions explained in 'help functions'.

View the help files via '+help function <function>'.

knotsearch age dage
rage dolphin dragon
color race columnate
elist

Knotsearch

Use: knotsearch(<knot> [ / <search pattern>])

Returns a list of dbrefs, the characters on <knot> who match <search pattern>. If no search pattern is specified, they it returns all the characters on <knot>. The format of the search pattern is the same as is used in <knot> .who/<search pattern>.

Examples:

say [knotsearch(pub/name:a*)]

You say "#1234 #1000 #9595 #333"

say [knotsearch(woc)]

You say "#555 #1191"

say [knotsearch(mic/admins)]

You say "#4321 #9999 #747"

(top)


Age

Use: age(<secs>)

Returns the age for a character given by <secs>.

A common use is in descriptions:

A boy aged 6 Turns, 5 months, and 21 days old.

Note: v(birthsecs) returns the <secs> set by doing &birthsecs <name>=<secs>. For all code such as +sheet to work properly, the <secs> that give you age must be set this way. To find out what secs give what age, see +help time2.

(top)


Dage

Use: dage(<secs>)

Returns the age for a dragon given by <secs>.

(top)


Rage

Use: rage(<secs>)

Returns the age for a runner given by <secs>.

(top)


Dolphin

Use: dolphin(<character>)

Returns the dbref of the dolphin that <character> is paired with. <character> must be a dbref or referred to in the format *<character name>.

(top)


Dragon

Use: dragon(<character>)

Returns the dbref of the dragon that <character> has Impressed. <character> must be a dbref or referred to in the format *<character name>.

(top)


Color

Use: color(<dragon>)

Returns the color of <dragon>. <dragon> must be a dbref.

(top)


Race

Use: race(<dbref>)

Returns the race of <dbref>.

(top)


Columnate

Use: columnate(<list>,<columns>,<spacing>[,<prepend>[,<append[,<delim>]]])

Returns: List, broken up into columns, or #-1 for bad arguments.

<spacing> includes the separator between columns.
<prepend> is put on the left side of every line except the first.
<append> is put on the right side of every line, including the last (in the proper place), unless it is one line total.
<delim> is the delimiter for the list.

(top)


Elist

Use: elist(<list> [,<delimiter>])

Takes a list of words and returns them in the format of an English list — separated by commas with an and between the last two words. The default is for words separated by spaces but you can specify a different delimiter.

Examples:

say [elist(one two three four)]

You say "one, two, three and four."

say [elist(apples|oranges|bananas|pears|apricots,|)]

You say "apples, oranges, bananas, pears and apricots."

say [elist(foobar)]

You say "foobar."

say [elist()]

You say ""

(top)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License