[543] in Coldmud discussion meeting
Re: Timed out input.
daemon@ATHENA.MIT.EDU (Sun Nov 6 14:35:53 1994
)
From: deforest@netcom.com (Robert de Forest)
To: jeffpk@netcom.com (Jeff Kesselman)
Date: Sun, 6 Nov 1994 11:35:23 -0800 (PST)
Cc: coldstuff@MIT.EDU
In-Reply-To: <199411060441.UAA18296@netcom9.netcom.com> from "Jeff Kesselman" at Nov 5, 94 08:41:44 pm
>
>
> I'm writing combat-mode code right now in c-- (or ColdC as Brandon
> suggests it be called.) Anyway, if someone is part of a combat I need to
> querey him each segment to find out if he wants to do anything (combat
> is sequentail, based on the Hero System.) Anyway I need to querey the
> character, but don't want the whole combat to hang if someone for some
> reasin can't or doesnt want to repsond.
>
> What i need is a way to time out the attempt to get info from the user.
>
> I realize that usually cold-mud code is driven by the user input, not the
> other way around.
>
> Can someone tell me how to get th effect I'm after???
>
> Thanks
>
> Jeff Kesselman
>
>
>
With version 0.12.0 you can write an input method on the user which prompts
'em, then suspends and places the suspended task ID in a list with an
expiratoin time. If the user does something, resume the task and use the
something as input, otherwise simply kill the suspended input task and tell
the user the question has been canceled.
It was possible to do something like this before 0.12.0, but not nearly as
convienient. You'd have to do the same thing as before, but instead of
resuming the task you'd call a function designated by the task requsting
input, or not call it in the case of a cancelation, and in either case make
sure the user's input state is restored to the default :).
Crag / Robert