Cancel Input

by Spunky_Girl
A simple demo on how to cancel an input() call [More]
To download this demo for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Spunky_Girl.CancelInput##version=0

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Spunky_Girl.CancelInput##version=0

138 downloads
Latest Version
Date added: Oct 24 2010
Last updated: Oct 25 2010
1 fan
I saw this on the forums here and decided to make a quick demo.

The input box will disappear after 5 seconds.

CREDIT: Nadrew

Comments

Schnitzelnagler: (Oct 25 2010, 6:04 am)
You could craft a more useful demonstration (or even a library, since this can be easily added functionality), by returning a value (else the player input is getting rather... you know... pointless) and supporting lists.

Most unfortunately, adding a possible type as Selector is non trivial.

MyInput
proc
Input(Caller, Message, Title, Default, list/Choices)
if(Caller && (ismob(Caller) || istype(Caller, /client)))
if(Choices && istype(Choices, /list) && Choices.len)
. = input(Caller, Message, Title, Default) in Choices
else
. = input(Caller, Message, Title, Default)


I included a few security checks and avoided the potential hidden usr abuse in input (which is often a point of criticism). I'm not sure why you're releasing the demonstration in debug mode either, but...