MPI _msgmacs Macros On FurryMuck

Macro Index

Macro             Author                      Macro             Author

%list Lynx DelayOtell Skant gen-morph Timur DelayPose Skant list-match Timur DelayListTell Skant look-notify Cymoryl DelayExec Skant pmatch Cymoryl DelayString Skant pose Squirrelly DelayList Skant subindex [unknown] DelayListEval Skant tmatch Cymoryl StoreList Skant right/left Chirik Default Skant secsday Chirik listrand Chirik phase Chirik zombies Chirik ListTell Skant sit Squirrelly DelayTell Skant Commander Dekhyr
Return to the Getting Started Page.

Macro definitions

%list

Usage:
{%list:<listname>}
Author:
Lynx
Effect:
Evaluates the given list for embedded MPI commands, similar to how Gen-Desc's %list[] function works.
Return to the Getting Started Page or the Macro Index.

gen-morph

Usage:
{gen-morph:<propdir>,<form>}
Author:
Timur
Effect:
Perform a set of property changes for a given selection. Valid selections are found in the list <propdir>/forms on the action calling gen-morph. If {&arg} is a unique partial match of an allowed form, then the property changes found in the list <propdir>/<form>/changes are performed. Each line of the changes list is a single command to gen-morph with the syntax: <obj>=<property>=<value>. After the changes occur, gen-morph checks for appropriate messages in the <propdir>/<form>/ directory. It first looks for a prop called <lastform>-<currentform>. Failing that, it checks for a prop called omsg in the same directory. If either is found, that prop is passed to {pose:} and the macro completes. Otherwise, the changes occur silently. Reminder: <propdir> and all subdirs must be located on the action calling the gen-morph macro.
Examplex:
@succ morph={gen-morph:species,{&arg}}. In the list, /species/forms, you might have the elements tiger, wolf, and dragon, each on a seperate line. Then a call such as 'morph tig' would do the changes found in /species/tiger/changes. If you were previously a wolf, morphing to a tiger would check for the prop /species/tiger/wolf-tiger: to use as your pose. An example change line for this morph might look like: me=_/de=You see a large tiger... Hint: gen-morph can be used to morph any properties.. you could just as easily set up something like @succ wear={gen-morph:clothes,{&arg}}
Return to the Getting Started Page or the Macro Index.

list-match

Usage:
{list-match:<list>,<substring>,<element-type>}
Author:
Timur
Effect:
Returns the index of the element containing <substring> or the error message, "I don't know which <element-type> you mean." if the substring is not unique within the given list. list-match searches the list as if it were a string, instead of element by element.
Example:
{list-match:{contents:here,player},Cym,furry} would return the index of the player that matches *cym*, or give the error "I don't know which furry you mean." if there was more than one match.
Return to the Getting Started Page or the Macro Index.

look-notify

Usage:
{look-notify:<description or mpi string>}
Author:
Cymoryl
Effect:
MPI version of the @6800 desc-notify feature, using all the same message properties, such as _desc_notify_looker, _desc_notify_looked, _desc_objector, and _desc_objected. If a person has a %n property set, then that will be displayed for %n in messages (use {name:me} instead for displaying a person's full name). Look-notify will also evaluate any lists passed to it for embedded MPI commands.
Example:
{look-notify:{list:mydesc}}
Return to the Getting Started Page or the Macro Index.

pmatch

Usage:
{pmatch:<pattern>}
Author:
Cymoryl
Effect:
Takes the passed pattern and matches it against people in the room, returning the names that match.
Example:
{pmatch:*k*} will return a list of people in the room who have k's in their names.
Return to the Getting Started Page or the Macro Index.

pose

Usage:
{pose:<message or MPI string>}
Author:
Squirrelly
Effect:
Works just like the 'pose' command. Useful for messages, and will also evaluate imbedded mpi code.
Example:
{pose:waves hello to {commas:{pmatch:b}}} will cause the person to wave hello to everyone in the room whose name starts with a 'b'.
Return to the Getting Started Page or the Macro Index.

subindex

Usage:
{subindex:<property>}
Author:
??
Effect:
Executes the subproperty named in the passed prop.
Example:
{subindex:clothes} where clothes is set to the value 'vest' will execute the property clothes/vest.
Return to the Getting Started Page or the Macro Index.

tmatch

Usage:
{tmatch:<pattern>}
Author:
Cymoryl
Effect:
Takes the passed pattern and matches it against the things in the room or on the player that the person owns, and returns a list of matching references #'s.
Example:
{tmatch:*ring*}
Return to the Getting Started Page or the Macro Index.

strpad / strlpad

Usage:
{right:string,length} ????
{right:string,length,pad character} ????
Author:
Chirik
Effect:
Strpad pads the string to length width by adding pad character to the right of the passed string. Strlpad pads the string to length width by adding pad character to the left of the passed string. If no pad character is supplied, then a space will be used. If the string is longer than the length to pad it to, strpad will truncate the string to that length, returning the beginning of the string, while strlpad will return the ending of the string.
Example:
(strpad)
{strpad:Hello World,5} will return 'Hello'
{strpad:Hello World,15} will return 'Hello World '
{strpad:Hello World,15,.} will return 'Hello World....'
Example:
(strlpad)
{strlpad:Hello World,5} will return 'World'
{strlpad:Hello World,15} will return ' Hello World'
{strlpad:Hello World,15,.} will return '....Hello World'
Return to the Getting Started Page or the Macro Index.

secsday

Usage:
{secsday}
{secsday:timezone}
Author:
Chirik
Effect:
Secsday will return the number of seconds that have elapsed so far today, FurryMUCK time. If you provide a timezone, then the seconds will be relative to that time zone.
Example:
(at 02:10:53 FurryMUCK)
{secsday} will return '7853' (FurryMUCK is timezone 5)
{secsday:4} will return '4253' (One hour behind Furry)
Return to the Getting Started Page or the Macro Index.

phase

Usage:
{phase}
{phase:isphase}
{phase:isphase,timezone}
Author:
Chirik
Effect:
Phase returns the 'phase of the day'. The phases are:
      Night:  18:45 to 05:45      Dawn:   05:45 to 06:15
      Day:    06:45 to 18:15      Dusk:   18:15 to 18:45
These phases are preset, and do not change with the time of the year. They should be useful for creating a room with a description that changes depending on the phase of the day. (For an example, check out Nuthatch Village Park, in Nuthatch Village. It uses a different description for day and night)

Phase takes two arguments, and both are optional. If you use phase with arguments, then it will return the current phase. If you provide the isphase argument, then phase will check to see if that is the current phase, and return either a 1 (true) or 0 (false). If you provide the timezone argument, then phase will return the phase relative to that timezone. If you wish to find out the phase for a specific timezone, then either leave the isphase argument blank {phase:,timezone} or put a '-' there {phase:-,timezone}

Example:
{phase} returns Night, Dawn, Day or Dusk.
{phase:Night} If it's night, returns a 1, otherwise 0.
{phase:Night,2} If it's night in timezone 2, return a 1.
{phase:-,2} returns Night, Dawn, Day or Dusk for timezone 2.
Return to the Getting Started Page or the Macro Index.

ListTell

Usage:
{ListTell:<string>,<playerlist>}
Author:
Skant
Effect:
{Tell}'s the string to a list of people. Your name is _not_ prepended to the message. If you do not own the room, the message will be prepended with a '> '. If the <list> parameter is omitted, it will default to all of the players in the current room ({contents:here,player}). {ListTell} returns the string that was given to it.
Example:
{ListTell:Drachenswald is beautiful!,{pmatch:K*}} will tell everyone in the room who's name begins with K what a wonderful place Drachenswald is. They will see:

Drachenswald is beautiful!

If you do not own the room, they will see:

> Drachenswald is beautiful!

Example:
{ListTell:Dragons are special!} will tell everyone in the room:

Dragons are special!

or, if you don't own the room:

> Dragons are special!

Return to the Getting Started Page or the Macro Index.

DelayTell

Usage:
{DelayTell:<delay>,<string>,<player>}
Author:
Skant
Effect:
Works exactly like {Tell} except the message is given after the delay. {DelayTell} works similar to the {Delay} command, but <string> is evaluated only before the delay. The results of the evaluation are told to <player> after the delay. If you want <string> evaluated after the delay, use {delay} with {lit} instead. The <player> parameter is optional and will default to telling the triggering player if omitted. This command is necessary for situations where it would be difficult to evaluate the expression after the delay, for instance if you are using variables (variables won't exist later) or properties that may change between now and the end of the delay.
Example:
{DelayTell:15,Visit the {&placetovisit}!,JoeSchmoe} where the variable {&placetovisit} equals 'Kaleidocave', will tell JoeSchmoe:

Visit the Kaleidocave!

...after a 15 second delay. Note this could not be done with: {delay:{lit:{tell:Visit the {&placetovisit}!,JoeSchmoe}}} because {&placetovisit} will not exist when the string is evaluated.

Return to the Getting Started Page or the Macro Index.

DelayOtell

Usage:
{DelayOtell:<delay>,<string>,<room>,<player>}
Author:
Skant
Effect:
This is the Otell compliment for {DelayTell} and works exactly the same way except that it does an {otell} instead. The <room> and <player> parameters are optional and default to 'here' and 'me', repectively. These parameters work just like they do in {otell}.
Example:
{DelayOtell:12,is testing a {&testname}.,here,#-1} where {&testname} equals 'new function', will tell everyone in the room:

Khryss is testing a new function.

...after a 12 second delay.

Return to the Getting Started Page or the Macro Index.

DelayPose

Usage:
{DelayPose:<delay>,<pose>}
Author:
Skant
Effect:
Same as {DelayTell} except that it calls {pose} instead.
Example:
{DelayPose:3,poses for {&posewho}.} when {&posewho} is 'the camera' will pose:

Skant poses for the camera.

...after a 3 second delay.

Return to the Getting Started Page or the Macro Index.

DelayListTell

Usage:
{DelayListTell:<delay>,<string>,<playerlist>}
Author:
Skant
Effect:
Same as {DelayTell} except it will {tell} the <string> to all the players in <playerlist> just like {ListTell}. If <playerlist> is omitted, it will {tell} the <string> to everyone in the room. Your name is not prepended to <string>, just like {ListTell}.
Example:
{ListTell:8,You feel {&feeling}.,{mklist:Skant,Khryss,Boing}} where {&feeling} is 'woozie', will {tell} Skant, Khryss, and Boing:

You feel woozie.

..after an 8 second delay or:

> You feel woozie.

...after an 8 second delay if you don't own the room.

Return to the Getting Started Page or the Macro Index.

DelayExec

Usage:
{DelayExec:<delay>,<propname>,<object>,<&1>,<&2>,...,<&6>}
Author:
Skant
Effect:
{Exec}'s the specified prop on the specified object after the delay. When the property is {exec}'ed the variables {&1} through {&6} will contain the values specified in <&1> through <&6>. Note that because of syntax, <object> can not be omitted if you are passing variables (<object> defaults to 'this' if omitted). The function returns the process ID of the process it places on the time queue. The {exec}'ed property itself will also return values after the delay according to what it was called from (ie. Succ or osucc message), so it may be necessary to {null} its output.
Example:
{DelayExec:12,DelayedProp,this,{&arg},{prop:TheAction},Cymoryl} Will {exec} the property 'DelayedProp' which is located on the trigger object ('this'). When the property runs, it will have access to these variables:

{&1} was set to the {&arg} that was passed to the trigger
{&2} was set to {prop:TheAction}, which for this example will be 'smiles'
{&3} was set to 'Cymoryl'

...so if DelayedProp has been set to:
DelayedProp:{&2} at {rand:{contents:here,player}} and says, '{&1}' and the {delayexec} had been called from @osucc then it would print:
Skant smiles at Khryss and says, 'Hi there!'
...after a 12 second delay to everyone else in the room.
Of course, this function has better uses than just simulating lag. }:>

Return to the Getting Started Page or the Macro Index.

DelayString

Usage:
{DelayString:<delay>,<string>,<&1>,<&2>,...,<&7>}
Author:
Skant
Effect:
Works much like {DelayExec}, except that instead of {exec}'ing a property, it takes a string and passes the string after a delay. The string will be evaluated for MPI commands. Like {DelayExec}, you can pass variables for the string to use. Note that you will probably want to use a {lit} on the string to keep it from evaluating _before_ the delay.
Example:
{DelayString:4,{lit:After a while, you do {commas:{mklist:{&1},{&2}, {&3}}}.},this,that,the other}
will output:
After a while, you do this, that and the other.
...after a 4 second delay.

Note on literals in general: Escape characters ('\') do work inside literals and are necessary if a literal contains {}'s which are not part of an MPI command. (Commas do not need to be escaped in a literal)

Example:
{lit:This test has {'s in it.} will generate an error (end brace not found). Use {lit:This test has \{'s in it.}
Return to the Getting Started Page or the Macro Index.

DelayList

Usage:
{DelayList:<delay>,<list>}
Author:
Skant
Effect:
Outputs the list one item at a time at <delay> second invervals. The first line will be output after the delay. The command returns the process ID of the process it places on the time queue. The output type depends on whether it was called from @succ, @osucc, etc. You can stop the output by typing '@kill me'. This removes all of your processes on the time queue (the only way to shut this off, since each line is a different process set by the last, and you only know the process ID of the first line. You can only shut off this command specifically if you kill it _before_ it outputs the first line).
Example:
{DelayList:5,{mklist:Line 1,Line 2,Line 3}} after 5 seconds, outputs:
Line 1
...then after another 5 seconds...
Line 2
...then after another 5 seconds...
Line 3
...and then it is finished.
Example:
{DelayList:3,{list:yourlist}} will output each item of 'yourlist' at 3 second invervals until it runs out of list to output.
Return to the Getting Started Page or the Macro Index.

DelayListEval

Usage:
{DelayListEval:<delay>,<listname>,<obj>,<index>,<&1>,<&2>,<&3>}
Author:
Skant
Effect:
This command evaluates the items of the indicated list one at a time at <delay> second intervals. <Listname> refers to the name of the list for this command. <Obj> is the object (action, room, whatever) this list is located on (defaults to 'this'). <Index> is the item number in the list which will be executed first, that is, if <index> is 3, then the third item in the list will be evaluated first, followed by the fourth, and so on until it reaches the end of the list (it may not actually go in that order. More on that later). If <index> is negative, then it will start with that many items back from the end of the list. That is, if <index> were -4, it would start with the fourth item from the end of the list, then go to the third from the end, etc until it reached the end of the list. The last three parameters (<&1>,<&2>,<&3>) are variables that will be accessable when the list is evaluated. How the list is outputted depends on whether it was called from @succ, @osucc, etc. The function returns the process ID of the process it places on the time queue.

The list itself can do many things. The list can contain MPI code (which will be evaluated) or anything else. Commas in the list work properly (that is, they output correctly and do not need to be escaped out). When a list item is evaluated, it has access to several variables:

{&1},{&2},{&3}: These are variables that are passed to the each line of the list and are initially set by in the call to {DelayListEval}. Note that you have access to these variables whether you define them in the call to {DelayListEval} or not. And you may change their contents using {set} (ex: {set:2,<new value>} changes the value of {&2} and that value will be present for the rest of the list until it is changed with another {set}. That is, as far as the list is concerned, none of these variables are temporary). These are 'general purpose' variables and may be used for anything you desire.

{&4}: This variable contains the delay value. You may read this value and you may set it with {set:4,<newdelay>}. Thus you can speed up or slow down the 'play back' of the list.

{&5}: This variable contains the index of the next list item that will be evaluated. That's right. If you {set} this variable, you can jump to different lines of the list. {Set}'ing this variable to 0 will end the list evaluation. (This value is automatically set to 0 just before the last line of the list is evaluated and the list will terminate if it is still 0 by the end of the evaluation).

{&6}: This variable contains the name of the list being evaluated. Yup. If you {set} this variable, you can jump to another list.

{&7}: This variable contains the name of the object where the list is located. You guessed it. If you {set} this variable, you can jump to another object entirely. By using {&5},{&6}, and {&7}, you can jump to any part of any list anywhere.

Example:
{DelayListEval:8,mylist,this,3,var 1,var 2,var 3} will evaluate the items in a list called 'mylist' on the trigger object (this) starting with item #3. If that list contained:
1:This is second and will speed up.{null:{set:4,1}{set:1,new}}
2:This is the third line. It slows down again.{null:{set:4,4}{set:5,4}}
3:This is first.{null:{set:5,1}} The first arg is '{&1}'.
4:This is the fourth line.{null:{Tell:Almost done!}}
5:This is the last line! Now arg 1 is '{&1}'.

Then... after 8 seconds it would output...
This is first. The first arg is 'var 1'.
...after another 8 seconds...
This is second and will speed up.
...after 1 second...
This is the third line. It slows down again.
...after 4 seconds...
This is the fourth line.
...and it will {tell} you that it's about done... after 4 seconds...
This is the last line! Now arg 1 is 'new'.
...and then it will terminate.
Note: Use '@kill me' to stop this if it gets out of control.

Return to the Getting Started Page or the Macro Index.

StoreList

Usage:
{StoreList:<list>,<listname>,<object>}
Author:
Skant
Effect:
Operates like {store} except that it stores lsedit style lists. The <object> parameter is optional and defaults to 'this'. If <list> is null, it will erase the list at <listname>, otherwise it will replace it if a list by that name already exists. This function returns the list.
Example:
{StoreList:{mklist:this,that,the other},testlist} will create:
str /testlist#/:3
str /testlist#/1:this
str /testlist#/2:that
str /testlist#/3:the other
Example:
{StoreList:,testlist,this} will erase the list created in the previous example (the properties will be gone).
Return to the Getting Started Page or the Macro Index.

Default

Usage:
{Default:<argument>,<default>}
Author:
Skant
Effect:
If <argument> is null or 0, then this function returns <default>. Otherwise, it returns <argument>. It is used to provide a default parameter if a parameter is omitted.
Example:
{store:Test data.,testprop,{default:{&arg},this}} If {&arg} is null or 0 (which would usually mean it wasn't specified), then it defaults to storing the property on 'this'.
Return to the Getting Started Page or the Macro Index.

listrand

Usage:
{listrand:<list>}
Author:
Chirik
Effect:
Returns a randomly picked item from a list. This works the same as the {rand} function, except this takes a \r delimited list instead of a property based list.
Example:
{name:{listrand:{contents:here,player}}} This will randomly select one player in the room, and return their name. If the room contains Skant, Chirik and BoingDragon, then this will randomly select one of those three, and return it. IE: BoingDragon
Return to the Getting Started Page or the Macro Index.

zombies

Usage:
{zombies}
{zombies:<room>}
Author:
Chirik
Effect:
If no parameter is supplied, this will return a list of objects with the Z (zombie) flag set in the current room. If <room> is supplied, it will attempt to return a \r delimited list of zombies in <room>. If no zombies are found, then this returns nothing.
Example:
{zombies} Returns a list of zombies in the current room. {zombies:#12345} Returns a list of zombies in room #12345
Return to the Getting Started Page or the Macro Index.

sit

Usage:
{sithelp}
Author:
Squirrelly
Effect:
This actually a suite of functions for setting up sittable areas in a room. Type {sithelp} for instructions.
Return to the Getting Started Page or the Macro Index.

commander

Usage:
{commander:<text>,<arg num>,<command directory>}
Author:
Dekhyr
Effect:
Retrieves the <arg num>th word in <text> and returns the result of executing that word as a property which is in the trigger object's <command directory> directory. If the property cannot be found, the result of executing the trigger object's _command_fail property will be returned. If _command_fail is not present, then 'Huh?' will be returned.

The Commander treats <text> as a string of words, each separated by one or more spaces.

Each command thus executed may access the list of words gleaned from the command line arguments via the Commander's local variable {&parms}. Example setup on next page.

Example:
This could be part of some kind of elevator:
@desc here=An elevator. You see three buttons, marked '#help',
'floor1' and 'floor2'.
@action press=here
@link press=$nothing
@succ press={commander:{&arg},1,_cmd}
@set press=_command_fail:Please 'press #help' for help.
@set press=_cmd/#help:Press floor1 or floor2.
@set press=_cmd/floor1:Zoom! Up to floor 1.
@set press=_cmd/floor2:Whoosh! Up to floor 2.

This would allow commands 'press floor1' and 'press floor2'. In general, 'press X' is allowed, provided _cmd/X is present.