MOO-cows Mailing List Archive
Date: Mon, 4 Mar 1996 21:23:46 PST
From: Ian Macintosh <email@example.com>
Content-Type: text/plain; charset="us-ascii"
Hi John, and everyone else.
I've been a tad busy of late, and if anyone thinks I've been ignoring
them, please email me again. My ISP's pop3 burped and ate my message
queue, so it might have not been deliberate :)
Anyway, on to the prompt question...
I followed the thread here, and see you are probably still looking for a
At 02:19 PM 22/02/96 PST, you wrote:
>Hey, was talking to a few people (Kipp, and a few others) about setting
>up a prompt similar to those on MUDs. Kipp tells me that a while back
>Pavel wrote about how to set this up, and I'm wondering if anyone could
>either a) point me to a FAQ file with this in it, or b) tell me how to do
>it. Kipp gave me the verb code for a verb named Prompt, but I'm not sure
>how it functions and where it goes.
The MUD type prompt will not be solved entirely by 1.8.0, as over and
above the ability of sending a non CR/LF terminated line, you will need
the ability to send a prompt under all circumstances.
What has been proposed in the other followups will require you to call
something like player:do_prompt() at the end of every non 'this none this'
verb. A task sure to daunt even the most fearless programmer.
The solution is to have the server call a verb after decoding and
processing every input from the player, even a blank line (such as when
the player presses ENTER or RETURN only). I wrote a patch for this, and
can dig it up if nobody else still has a copy of it for you.
Unfortunately, you will have to patch it for 1.7.9 as I wrote it for
1.7.8p4. However, there is the distinct possibility that you can
insert the patch without modification.
All it really does is, inside server.c, in the main program loop, after
decoding AND executing the line of text typed by the player, it calls
the verb #0:do_prompt() IF the verb exists. I found the best thing to
do inside there is to just call player:do_prompt() which handled things
like prompt enabling, disabling, customizing, etc.
The nice part about it is that the prompt will display even if the verb
you are calling suspends for any reason, as well as when the player
just presses ENTER, something no in-db verb can do.
Subject Index |