MOO-cows Mailing List Archive
Re: Making a chat room
On Thu, 28 Sep 1995, Chris Black wrote:
> Hey I am pretty new to MOOs(Monday :), but I have read all the small documents
> I could find, skimmed thru the programmers manual, and browsed help
> for a possible answer to my question:
> Here is what I want to do, I want to create a chat room where
> anything that is said is automatically sent to the rest of the ppl in
> the room without having to use " or say or emote etc, just from what
> is typed, what I was thinking of doing was hacking the "huh" verb for
> this room to pass whatever was typed on the command line that doesn't
> match a verb (thus calling huh I believe) to
It depends on how much priority you want it to have. if you want the MOO
command line parser to search through every possible location for the
command, and only say it if the command can't be matched, then it would
be a good idea to put a :huh verb on the room to handle it.
(Remember: args is the second word typed, verb is the first word typed)
One other way to do it, although sloppier, is to make a verb on the room,
'*', with args 'any any any'. This will demand more priority than using
the huh verb, since the only location of a verb that could be used over
this is on the player object itself. With this you won't be able to do
anything that isn't defined on the player... ie no interactions with
objects, etc. this would be coded in the same way as the huh verb : it'd
do something like this:announce(player.name," says, \",verb,@args,\");.
As I said before, the only real difference between these two approaches
is that room:* would be used if the command cant be found on the player,
and room:huh would be used if the command can't be found anywhere: the
player, the room, or any other objects that may have the verb in
question. I'm not sure if this'll override other verbs on itself as
well.. ie if you type 'say hey there', and there's both a 'say' and a '*'
verb on the room, I'm not sure which one it'll run.
I would suggest using the :huh verb... but I tossed in the other idea
just as an idea.
Subject Index |