ID:1232845
 
(See the best response by The Motto.)
Code:
var/Buying = input("[src]: Hello, what would you like to buy? ")in list("Armor(400 Gold)","Armor Top(400 Gold)","Cancel")


Problem description:
I was wondering if there was a way to have an input window like the one above have a time limit for you to enter something and if you don't with in a given amount of time it will just close and do nothing.

You could make your own function that does that using the input() proc.
I Would Personally Make an Obj proc that deleted After 15 Seconds Here's an example:
obj
Buyer
var/time=10//Timer is set to 10 seconds
var/mob/Buyer//Refers to the mob
New()
..()
spawn while(1)//If The Time is 1
time-=1
if(time<=0)//Checks the time
del(src)//Deletes the usr list that pops up
sleep(10)
proc
Buy_Me()
var/Buying = input("[src]: Hello, what would you like to buy? ")in list("Armor(400 Gold)","Armor Top(400 Gold)","Cancel")

If Your Arn't Sure how to apply this to you mob heres an example of that as well:
mob/verb/Test_This()
var/obj/Buyer/B=new//Creates a Object so you can open up the proc Buy_Me
B.Buyer=usr//Remember that var/mob/Buyer ? this makes the usr the buyer
B.Buy_Me()//And This Opens up the Buying input for the usr
I would use a datum, not an obj, because I believe datums are server-side only, and cannot be sent to the client.
In response to Ter13
Ter13 wrote:
I would use a datum, not an obj, because I believe datums are server-side only, and cannot be sent to the client.

Pretty much. By implementation, they can have an appearance associated, but you can't do that in DM. More importantly ... a datum is the lighter weight object and pretty much designed for this kind of work.

As a rule of thumb, obj is for things a player can see and has an icon, datum is for the rest.
In response to Ter13
Best response
Ahh so Like this
Buyer
var/time=10//Timer is set to 10 seconds
var/mob/Buyer//Refers to the mob
New()
..()
spawn while(1)//If The Time is 1
time-=1
if(time<=0)//Checks the time
del(src)//Deletes the usr list that pops up
sleep(10)
proc
Buy_Me()
var/Buying = input("[src]: Hello, what would you like to buy? ")in list("Armor(400 Gold)","Armor Top(400 Gold)","Cancel")

And Ofcoure You'd Change the
//var/obj/Buyer/B=new TO

var/Buyer/B=new

Yup. Although, you don't need the datum explicitly, just

Buyer
var/time = 10
// ... etc


Will do.
Well if there was a way with out using an obj I would rather try and do that way because in the case I want to do it that way.

@The Motto- it looks like a good way to do it but when I gave it a try that way it del the obj/shop keeper as soon as the timer ran out when the would would start.

@Ter13: How would i use datums in order to use this.

@Stephen: Answer my next question before I even ask and was can you use Motto idea when no obj or mob is involved(visible) which base on what you said that would be no.
In response to Stephen001
Ahh Okay I See, Good Tip
Awesome.
A little confusing but it works so I guess i'm going to have to take some time to let this soak in. Thanks for the help.