ID:178889
 
Open the drawer
alert("Deposit",,"Withdraw")
Deposit
items in inventory select
item iz deposited
max deposit = 2
Withdraw
withdraw items in drawer

how would I goesabout doing this?

-FireEmblem
FireEmblem wrote:
Open the drawer
alert("Deposit",,"Withdraw")
Deposit
items in inventory select
item iz deposited
max deposit = 2
Withdraw
withdraw items in drawer

That's pretty good pseudocode to start out, so let's work with that:
obj/drawer
verb/Open()
var/choice=alert("What do you want to do?","Drawer","Deposit","Widthdraw")
if(choice=="Deposit")
if(contents.len>=2)
usr << "The drawer is full. It contains \a [contents[1]] and \a [contents[2]]."
return
var/list/choices=list()
var/obj/item
for(item in usr.contents)
choices["\a [item]"]=item
var/which=input("What do you want to put in?","Drawer") as null|text in choices
if(!which) return
item=choices[which]
item.loc=src // move it to the drawer
usr << "You put \a [item] into the drawer\..."
if(contents.len==2) usr << ". The drawer also contains \a [contents[1]]."
else usr << "."
else if(choice=="Withdraw")
var/list/choices=list()
var/obj/item
for(item in contents)
choices["\a [item]"]=item
var/which=input("What do you want to take out?","Drawer") as null|text in choices
if(!which) return
item=choices[which]
item.loc=usr // move it to usr
usr << "You take \a [item] out of the drawer\..."
if(contents.len) usr << ". The drawer still contains \a [contents[1]]."
else usr << "."

Lummox JR
In response to Lummox JR
Thank you very much, I didn't really need the code though, just helpful advice =)
-Emblem of Fire,FireEmblem