FurryMUCK SM MPI Macros


MPI macros are suplements to the basic MPI functions..



Macro           Page #  Author     | Macro           Page #  Author
-----------------------------------+------------------------------------
%list             1     Lynx       | DelayListEval    24-27  Skant
gen-morph         2-3   Timur      | StoreList        28     Skant
list-match        4     Timur      | Default          29     Skant
look-notify       5     Cymoryl    | listrand         30     Chirik
pmatch            6     Cymoryl    | zombies          31     Chirik
pose              7     Squirrelly | sit              32     Squirrelly
subindex          8       | Commander        33-34  Dekhyr
tmatch            9     Cymoryl    | case             35     Snowshadow
right/left       10-11  Chirik     | DelayListSpoof   36     Skant
secsday          12     Chirik     | exits-laston     37     Timur
phase            13-14  Chirik     | appt             38-39  Snowshadow
ListTell         15     Skant      | apptset          40     Snowshadow
DelayTell        16     Skant      | caseexpr         41     Snowshadow
DelayOtell       17     Skant      | EXTMpi           42     Skant
DelayPose        18     Skant      | Tables           43     Timur
DelayListTell    19     Skant      | sysparm          44     Squirrelly
DelayExec        20-21  Skant      | wrap             45-46  SquirtJr
DelayString      22     Skant      | numtowords       47     Ken_Cougar
DelayList        23     Skant      | 
-----------------------------------+------------------------------------

Usage: {numtowords:} Author: Ken_Cougar Effect: Returns a string of the value of the written out in words. Example: {numtowords:26344} will return the string, Twenty-Six Thousand, Three Hundred and Forty-Four Limitations: It can only handle positive integers.
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 /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 /
/changes are performed. Each line of the changes list is a single command to gen-morph with the syntax: ==. After the changes occur, gen-morph checks for appropriate messages in the // directory. It first looks for a prop called -. 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: and all subdirs must be located on the action calling the gen-morph macro. Example of use: @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}}
list-match Usage: {list-match:list,substring,element-type} Author: Timur Effect: Returns the index of the element containing or the error message, "I don't know which 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. Ex: {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.
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. Ex: {look-notify:{list:mydesc}}
pmatch Usage: {pmatch:pattern} Author: Cymoryl Effect: Takes the passed pattern and matches it against people in the room, returning the names that match. Ex: {pmatch:*k*} will return a list of people in the room who have k's in their names.
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. Ex: {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'.
subindex Usage: {subindex:property} Author: ?? Effect: Executes the subproperty named in the passed prop. Ex: {subindex:clothes} where clothes is set to the value 'vest' will execute the property clothes/vest.
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. Ex: {tmatch:*ring*}
strpad strlpad Usage: {right:string,length} Usage: {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. Ex: (strpad) {strpad:Hello World,5} will return 'Hello' {strpad:Hello World,15} will return 'Hello World ' {strpad:Hello World,15,.} will return 'Hello World....' Ex: (strlpad) {strlpad:Hello World,5} will return 'World' {strlpad:Hello World,15} will return ' Hello World' {strlpad:Hello World,15,.} will return '....Hello World'
secsday Usage: {secsday} Usage: {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. Ex: (at 02:10:53 FurryMUCK) {secsday} will return '7853' (FurryMUCK is timezone 5) {secsday:4} will return '4253' (One hour behind Furry)
phase Usage: {phase} Usage: {phase:isphase} Usage: {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} Ex: {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.
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. Ex: {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! Ex: {ListTell:Dragons are special!} will tell everyone in the room: Dragons are special! or, if you don't own the room: Dragons are special!
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 is evaluated only before the delay. The results of the evaluation are told to after the delay. If you want 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. Ex: {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.
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 and parameters are optional and default to 'here' and 'me', repectively. These parameters work just like they do in {otell}. Ex: {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.
DelayPose Usage: {DelayPose:delay,pose} Author: Skant Effect: Same as {DelayTell} except that it calls {pose} instead. Ex: {DelayPose:3,poses for {&posewho}.} when {&posewho} is 'the camera' will pose: Skant poses for the camera. ...after a 3 second delay.
DelayListTell Usage: {DelayListTell:delay,string,playerlist} Author: Skant Effect: Same as {DelayTell} except it will {tell} the to all the players in just like {ListTell}. If is omitted, it will {tell} the to everyone in the room. Your name is not prepended to , just like {ListTell}. Ex: {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.
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. Ex: {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. }:>
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. Ex: {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) Ex: {lit:This test has {'s in it.} will generate an error (end brace not found). Use {lit:This test has \{'s in it.}
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). Ex: {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. Ex2: {DelayList:3,{list:yourlist}} will output each item of 'yourlist' at 3 second invervals until it runs out of list to output.
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 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,} 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. Ex: {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.
StoreList Usage: {StoreList:list,listname,object} Author: Skant Effect: Operates like {store} except that it stores lsedit style lists. The 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. Ex: {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 Ex2: {StoreList:,testlist,this} will erase the list created in the previous example (the properties will be gone).
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. Ex: {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'.
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. Ex: {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
zombies Usage: {zombies} Usage: {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 is supplied, it will attempt to return a \r delimited list of zombies in . If no zombies are found, then this returns nothing. Ex: {zombies} Returns a list of zombies in the current room. {zombies:#12345} Returns a list of zombies in room #12345
sit Usage: {sithelp} Author: Squirrelly Effect: This actually a suite of functions for setting up sittable areas in a room. Type {sithelp} for instructions.
Commander Usage: {commander:text,arg num,command directory} Author: Dekhyr Effect: Retrieves the 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 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}. Ex: 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.
Case Usage: {case:value,valuelist,resultlist,default} Author: Snowshadow Effect: Matches value exactly to one of the items in valuelist and returns the corresponding result from resultlist. If valuelist and resultlist are not the same length, returns an error. If value is not in valuelist, returns default, or nothing if default is not supplied. Ex: If a list called 'values' contains happy sad angry and a list called 'results' contains smiling frowning scowling and a property called 'mood' contains sad, then {case:{prop:mood},{list:values},{list:results}} returns 'frowning'.
DelayListSpoof Usage: {DelayListSpoof:delay,list} Author: Skant Effect: Works exactly like {DelayList}, except the list is 'spoofed' a line at a time with {ListTell} at delay second intervals. This macro makes such things as jukeboxes, robotic dancers, etc very easy to make. The command returns the process ID of the process it places on the time queue. 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). Ex: {DelayListSpoof:5,{list:yourlist}} will spoof the contents of 'yourlist' line by line at 5 second intervals. Note that each line of the list is not limitted to 80 chars. Each line is delimited by a return character, not the screen width. Each line will be prepended with a '> ' unless the action is placed on the room.
exits-laston Usage: {exits-laston:} Author: Timur Effect: This creates a list of the furries who own exits in the current room, excluding yourself and any duplicates. This list is then passed to the laston program to generate the data. The intent of this macro is to allow builders to scan their rooms to see if any 'tenants' should be unlinked to allow room for others. If the triggering player doesn't own the room they are in, a polite error message is displayed and the macro exits gracefully.
appt Usage: {appt:listname} Author: Snowshadow Effect: A list-based appointment book or daily reminder. Given the name of a properly formatted list of dates, messages, and "advance times," returns a list of dates and messages which have not yet occurred and are no further in the future than their advance times. If listname is not supplied, it defaults to _appt. The format for the appointment list is that created by {apptset}: each line is a separate event and is of the form date-advance:message For instance, an "advance" value of 10 starts showing the message ten days before its date; 365 would show it for a whole year. NOTE: old appointments are NOT removed from the list, so you'll have to clean it up occasionally using lsedit. To have {appt} show your reminders each time you connect, @set me=_connect/appts:&{appt:listname} Ex: if the list 'myappts' contains 12/13/94-30:Snowshadow's birthday! }8> 8/6/94-7:Party, 8 pm in the Gazebo 6/20/94-10:RL picnic, 1:00 at the park 9/1/94-60:Losing net access! Ack! then on August 1, 1994 (8/1/94), {appt:myappts} will return 8/6/94: Party, 8 pm in the Gazebo 9/1/94: Losing net access! Ack!
apptset Usage: {apptset:date,advance,message,listname} Author: Snowshadow Effect: Adds an event to the appointment (property) list given by listname, for use with the {appt} macro. Underscores (_) in the message will be replaced with spaces, in case this macro is called from a command-line action. If listname is not supplied, it defaults to _appt. The list will be created if it does not yet exist. Each line in the list is for a different reminder and is of the form date-advance:message For more information, see {appt}. Ex: {apptset:9/1/94,60,Losing net access! Ack!,myappts} will add the line 9/1/94-60:Losing net access! Ack! to the property list named 'myappts'.
caseexpr Usage: {caseexpr:exprlist,resultlist,default} Author: Snowshadow Effect: Evaluates each of the expressions in the list exprlist. Returns the result from resultlist which corresponds to the first true expression in exprlist. If none of the expressions is true, returns default, or nothing if default is not supplied. If exprlist and resultlist are not the same length, returns an error. Basically an if-elseif-elseif-else. Ex: If a list called 'exprlist' contains {eq:foo,bar} {eq:yes,yes} {eq:3,3} and a list called 'resultlist' contains hello world how are you then {caseexpr:{list:exprlist},{list:resultlist},oops!} returns 'world'.
EXTMpi Usage: various function calls Author: Skant Effect: All those functions you wish were in MPI originally! @list #76021 for documentation
Tables Usage: various functions Author: Timur Effect: A suite of functions that allow you to define 'tables' within a room that people can sit at and have table-only conversations. Use @mpi {tables-help:1} to documentation.
sysparm _msgmacs/sysparm:{muf:#95842,{:1}} {sysparm:value} An MPI function to return the value of most Muck @tune settings. Some values of interest that you can use are: penny pennies cpenny cpennies muckname huh_mesg leave_mesg dump_interval dump_warntime object_cost exit_cost link_cost room_cost max_pennies start_pennies player_start dbdump_warning deltadump_warning dark_sleepers A few of the values not listed above have limited access.
wrap Usage: {wrap:str,cols} {wrap:str,cols,para} {wrap:str,cols,para,indent} Author: SquirtJr Effect: Formats a string to "pretty-print" by wrapping on word boundaries when a given screen column is reached, somewhat akin to the .format command in lsedit. {wrap} takes a string, str, and returns a string which is str word-wrapped to column cols. If para is specified, this is a word (or symbol) which, if encountered in str, starts a new paragraph (a return is put in the output string, and if indent is specified, is indented to that column number) Ex: {wrap:The rain in Spain stays mainly on the plain.,12,Spain.3} returns: The rain in stays mainly on the plain. Example of utility: Allows format to stay nice even when MPI evaluations change the text (for example, wearing particular clothes). If your current @desc looks like {eval:{list:mydesc}}, you could change it to {wrap:{eval:{concat:mydesc}},75,para,5} and always perserve the margins. (if "para" is in the mydesc list to denote hard paragraph breaks) Limitations: This is subject to the MPI 4096 character limit on strings, of course, so too large a desc might fail (of course, that's two screens, so don't be greedy). Also, the limit against command nesting might be run up against if a single paragraph is too big, but I haven't seen it happen yet. There is currently no facility within {wrap} for "literals" that should remain untouched.
numtowords Usage: {numtowords:integer} Author: Ken_Cougar Effect: Returns a string of the value of the integer written out in words. Example: {numtowords:26344} will return the string, Twenty-Six Thousand, Three Hundred and Forty-Four Limitations: It can only handle positive integers.
Home

Feedback: Please send your message to The Webmaster.webmaster@furrymuck.com

Date: Feb. 20, 2012