RE: Getting input from the player

From: Gary Barnett (gbarnett@polarnet.com)
Date: 02/02/97


>
>
>-----Original Message-----
>From:	Eric Medlock [SMTP:ericm@exmidway.ecn.ou.edu]
>Sent:	Sunday, February 02, 1997 10:32 AM
>To:	CircleMUD Mailing-List
>Subject:	 Getting input from the player
>
>	I'm trying to implement a prompt on my mud that will ask the user
>'Are you sure(y/n)?' when they try to quit.... I cannot figure out how to
>get there answer... I realize this is probably a simple thing to do but I
>just couldn't figure out how to get straight input from the mud... any
>suggestions/help is much appreciated....
>
The solution can be found by tracing how the other input routines work
(logon name, password, opening menu, etc.)

The mud knows about the player's current state.. the CON_XXX constants
handle the current state.

When you are playing normally you are set to CON_PLAYING; when the game
is waiting for you to press enter after reading the MOTD when you log on,
you are set to CON_RMOTD 

My advice would be to search your code for CON_RMOTD and then add the
new code, using CON_RMOTD as a template. Maybe CON_CNFRM_QUIT
or something.

The other piece of the puzzle is that do_quit calls a bunch of functions. .You'll
obviously have to move the code in do_quit to the case CON_CNFRM_QUIT
in interpreter.c.. I'm not sure if there are any declarations in act.other.c that aren't
in interpeter.c .. but you might look there if you get compiler errors.

--Mallory

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST