/
umud/DOC/
umud/DOC/examples/
umud/DOC/internals/
umud/DOC/wizard/
umud/MISC/
umud/MISC/dbchk/
umud/RWHO/rwhod/
Ok, I decided it's time to show you all some of my simple unter macro toys
that I use a lot. First off is the old favorite, a light switch that changes
the room desc from light to dark and back.

As with most of my toys, I use locked exits with the fail messages being the
macro. This is the file I upload with "/quote set lamp 'lamp.unter"...

]cmd xxon=set $me cmd fail=set here desc "$me.ondesc";@do $me.onsucc;unset
 here dark;set $me desc "$me.medescon";xxoff
]cmd xxoff=set $me cmd fail=set here desc "$me.offdesc";@do $me.offsucc;set
 here dark;set $me desc "$me.medescoff";xxon
]str onsucc=turns on the lamp.
]str offsucc=turns off the lamp.
]str medescon=You see a lamp, with a bright flame burning.
]str medescoff=You see what seems to be a lamp.
]str ondesc=The room is lit by the lamp. blah blah blah.
]str offdesc=The room is dark. blah blah blah.
]cmd fail=xxoff

As you can see, this is nice and generic, and in fact I've used it in several
different places (mostly in my penthouse suite on DreamScape; that's going to
be my place for showing off untertoys.) The exit "lamp;light" MUST own both
itself AND the room, for everything to work properly.

Later note: This could have been done easier by using booleans set in type
string attributes. For instance:

]cmd fail=_if $me.lit "xxoff" else "xxon"
]cmd xxoff=set here desc "$me.offdesc";@do $me.offsucc;set here dark;set $me
 desc "$me.medescoff";set $me str lit F
]cmd xxon=set here desc "$me.ondesc";@do $me.onsucc;unset here dark;set $me
 desc "$me.medescon";set $me str lit T
]str onsucc=turns on the lamp.
]str offsucc=turns off the lamp.
]str medescon=You see a lamp, with a bright flame burning.
]str medescoff=You see what seems to be a lamp.
]str ondesc=The room is lit by the lamp. blah blah blah.
]str offdesc=The room is dark. blah blah blah.
]str lit T

---

In the same vein, I have a couch that converts into a bed, and back again.
I did this with three exits, even though I could have used just two, maybe
even one, but it was a lot simpler (and is easier to maintain) with three.
There's a 'bed' exit, a 'couch' exit, and a controlling 'hideabed' exit. The
hideabed exit MUST own both the bed and couch exits. Again, the macro is
in the fail of the hideabed exit. (This could also be done with a hideabed
exit and two dark objects for the couch and bed, but you'd have to get a wizard
to set them dark for you. Or, hm. You could probably work out a system of
teleporting the objects in and out of the room, but I like this way better.)
All of these are set on the hideabed exit.

]cmd xxclose=@set $me cmd fail=@set bed name "xxbed";@set xxcouch name 
 "couch;sit";@_echo $me.clfail;@set $me name "open bed;make bed;hideabed";@set
 $me ofail $me.clofail;xxopen
]cmd xxopen=@set $me cmd fail=@set couch name "xxcouch";@set xxbed name 
 "bed;sit;sleep;couch";@_echo $me.opfail;@set $me name "close bed;make
 couch;hideabed";@set $me ofail $me.opofail;xxclose
]str opofail=fiddles with the couch, and tugs the seat out and unfolds it,
 revealing a slightly rumpled bed.
]str clofail=folds the bed back up and shoves it down into the seat of the 
 couch, putting it away.
]str clfail=You fold the bed back up and shove it back into the seat.
]str opfail=You find the straps, and tug on them until the seat unfolds and
 reveals the bed.
]cmd fail=xxopen

The bed and couch exits are normally described and failed. One should be named
"xx<name>" first, of course. Note that the ofail message is displayed AFTER
the fail macro is run.

Later note: Again, this could have been done by encoding booleans in strings.
In this case:

]cmd fail=_if $me.open "xxclose" else "xxopen"
]cmd xxclose=set bed name "xxbed";set xxcouch name "couch;sit";@_echo
 $me.clfail;set $me name "open bed;make bed;hideabed";set $me ofail
 $me.clofail;set $me str open F
]cmd xxopen=set couch name "xxcouch";set xxbed name "bed;sit;sleep;couch";
 @_echo $me.opfail;set $me name "close bed;make couch;hideabed";set $me ofail
 $me.opofail;set $me str open T
]str opofail=fiddles with the couch, and tugs the seat out and unfolds it,
 revealing a slightly rumpled bed.
]str clofail=folds the bed back up and shoves it down into the seat of the 
 couch, putting it away.
]str clfail=You fold the bed back up and shove it back into the seat.
]str opfail=You find the straps, and tug on them until the seat unfolds and
 reveals the bed.
]str open F

---

I've also been making directory stuff with one simple macro:

set foo cmd fail=@_echo $me.dir1;@_echo $me.dir2;@_echo $me.dir3;...etc.

And setting on the 'foo' exit the appropriate strings. (set foo str dir1=blah).
I've used this to do the information terminals, the elevator directory, and
the "cyberportal" directory on DreamScape. Simple, and easy to add to.

Jennifer/Moira