These are various MPI macros that you are free to use. And share. And rewrite. No warrantee is made against damage to your character if you should try to use one of these. @archive is your friend. Two of these macros use the {default} function that was added in FB6. If you are using these on a FB5 server, you should add this: @set me=/_msgmacs/default:{if:{:1},{:1},{:2}} ---- @set me=/_msgmacs/i2f5:{if:{gt:{abs:{:1}},59},{div:{abs:{:1}},12}'{if:{gt:{mod:{abs:{:1}},12},0},{mod:{abs:{:1}},12}"},{abs:{:1}}"} Usage: {i2f5:} Returns: in '" format ---- @set me=/_msgmacs/li2f:{if:{gt:{abs:{:1}},11},{if:{eq:1,{div:{abs:{:1}},12}},1 foot,{div:{abs:{:1}},12} feet}{if:{gt:{mod:{abs:{:1}},12},0},\, {if:{eq:1,{mod:{abs:{:1}},12}},1 inch,{mod:{abs:{:1}},12} inches}},{if:{eq:1,{abs:{:1}}},1 inch,{abs:{:1}} inches}} Usage: {li2f:} Returns: in " feet, inches" format ---- @set me=/_msgmacs/mirror:{if:{eq:{ref:this},{ref:me}},@desc mirror in use,{center:-=-- {name:this}'s Mirror --=-,77}{nl}{exec:_/de,me}{nl}{center:-=-- {name:this}'s Mirror --=-,77}{null:{tell:-=> {name:me} looked at {pronouns:%r,me} in your mirror.,this}}} Usage: @desc me={mirror} ---- @set me=/_msgmacs/next:{prop:{:1}#/{with:next,{add:1,{prop:_next/{:1},this}},{store:{if:{gt:{&next},{prop:{:1}#}},1,{&next}},_next/{:1},this}}} Usage: {next:} Requires: as a proplist Returns: Each successive use returns the next element of the list. ---- @set me=/_msgmacs/numlist:{with:counter,,{parse:line,{list:{:1},{default:{:2},this}},{right:{inc:counter},2}) {&line}}} Usage: {numlist:} Requires: as a proplist Returns: prepended by line numbers. ---- @set me=/_msgmacs/phase:{with:h,{ftime:%H},{if:{gt:{&h},21},night,{if:{gt:{&h},18},evening,{if:{gt:{&h},12},afternoon,{if:{gt:{&h},6},morning,night}}}}} Usage: {phase} Returns: morning, afternoon, evening, or night, depending on time of day. ---- @set me=/_msgmacs/season:{with:jul,{ftime:%j},{if:{gt:{&jul},355},winter,{if:{gt:{&jul},264},autumn,{if:{gt:{&jul},172},summer,{if:{gt:{&jul},80},spring,winter}}}}} Usage: {season} Returns: spring, summer, autumn, or winter, depending on time of year. ---- @set me=/_msgmacs/linewrap:{with:lines,,{with:max,{prop:_prefs/wrap-length,me},{with:line,{prop:_prefs/wrap-prefix1,me},{with:llen,{strlen:{&line}},{null:{if:{&max},,{set:max,72}}{if:{&llen},,{set:line,{prop:_prefs/wrap-prefix,me}}{set:llen,{strlen:{&line}}}}{foreach:w,{filter:x,{:1},{&x}, ,\r},{with:wlen,{add:1,{strlen:{&w}}},{if:{gt:{add:{&wlen},{&llen}},{&max}},{set:lines,{&lines}{&line}\r}{set:line,{prop:_prefs/wrap-prefix,me}{&w} }{set:llen,{strlen:{&line}}},{set:line,{&line}{&w} }{set:llen,{add:{&llen},{&wlen}}}}}}}{&lines}{&line}}}}} Usage: {linewrap:} Returns: Text wrapped to fit screen properly. ---- @set me=/_msgmacs/storelist:{with:inlist,{:1},{with:object,{default:{:3},this},{delprop:{:2}#,{&object}}{parse:line,{&inlist},{if:{&line},{null:{store:{add:1,{prop:{:2}#,{&object}}},{:2}#,{&object}}}{store:{&line},{:2}#/{prop:{:2}#,{&object}},{&object}},{default:{:4},{nl}}}}}} Usage: {storelist:,} Usage: {storelist:,,} Returns: , after storing as a proplist. ---- @set me=/_msgmacs/after:{with:~af1,{instr:{:1},{:2}},{if:{and:{&~af1},{le:{add:{&~af1},{strlen:{:2}}},{strlen:{:1}}}},{midstr:{:1},{add:{&~af1},{strlen:{:2}}},-1}}} Usage: {after:,} Returns: The portion of that comes after occurs. ---- @set me=/_msgmacs/before:{with:~bf1,{instr:{:1},{:2}},{if:{&~bf1},{midstr:{:1},1,{subt:{&~bf1},1}},{:1}}} Usage: {before:,} Returns: The portion of that comes before occurs. ---- @set me=/_msgmacs/change:{with:~cobj,{if:{:4},{:4},this},{store:{subst:{prop:{:1},{&~cobj}},{:2},{:3}},{:1},{&~cobj}}} Usage: {change:,,,[]} Returns: Changes , substituting text in the prop and storing it again. It returns the altered text. ---- @set me=_msgmacs/carrying:{with:list,{commas:{filter:thing,{contents:this,Thing},{not:{instr:{flags:{&thing}},D}}}, and ,dbref,{name:{&dbref}}{if:{eq:{name:{owner:{&dbref}}},{name:me}},({&dbref}{flags:{&dbref}})}},{if:{&list},[Carrying: {&list}]}}{if:{eq:{name:{owner:this}},{name:me}},{with:list2,{commas:{filter:thing2,{contents:this,Thing},{instr:{flags:{&thing2}},D}}, and ,dbref2,{name:{&dbref2}}({&dbref2}{flags:{&dbref2}})},{if:{&list2},{nl}[Dark: {&list2}]}}} Usage: @set me=_/co:{carrying} Returns: Content of what it's on. For the owner, it shows dbrefs and flags, and a second line with dark items. Requires that a muck support custom content listers.