var/obj/O
for(O in usr)
usr << "[O.name]"
if (O.name == "log")
var/obj/O1
for(O1 in usr)
if (O1.name == "saw")
new /obj/board(usr)
new /obj/woodchips(usr)
usr << "You have successfully made a board!"
del O
return 1
if(!usr.contents.Find(/obj/saw))
usr<<browse("<font color=#666666 face=Times New Roman size=3>Buy a saw.</font>","window=Allarkis")
return
if(!usr.contents.Find(/obj/log))
usr<<browse("<font color=#666666 face=Times New Roman size=3>Buy a log.</font>","window=Allarkis")
return
Problem description: If you ignore the two if statements at the bottom that generate browse statements telling you what is missing from your attempt at making lumber, the above code will work. However, I need the code to show the user what he is missing. I have set up the verb to for list the contents of the user so that if the items are present, the board is automatically made. I do not know how to make it do the browse statments when it is done looping the list.
The chain of thought in this code should be...
check user's inventory
is there a log?
Yes, there is a log
is there a saw?
Yes, there is a saw
give user a board
give user some woodchips
destroy the log
end the verb
No, there is no saw in the user's entire inv.
tell user to buy a saw
end the verb
No, there is no log in the user's entire inv.
tell user to buy a log
end the verb