Forge
icon_state="forge"
density=1
verb
Forge()
set category="Temp"
set src in oview(1)
var/b=locate(/obj/Items/IronOre)in usr.contents
if(b)
if(!usr.forging)
usr.nomotion=1
usr.forging=1
usr<<"You begin to forge an Iron Ore..."
sleep(50)
if(prob(50))
if(usr.amount<10)
del(b)
usr.amount++
new /obj/Items/IronIngot(usr)
usr << "You created an Iron Ingot!"
else
del(b)
new /obj/Items/IronIngot(usr.loc)
usr << "You created an Iron Ingot, but you can't carry it!"
sleep(10)
usr.nomotion=0
usr.forging=0
else
usr << "You failed to make an Iron Ingot."
del(b)
usr.amount--
sleep(10)
usr.nomotion=0
usr.forging=0
What I'm trying to accomplish here is I wish it to, when the user uses the verb, pop up an input for a number. I'd like this number not to be over the amount var for the user(Amount being a variable used to limit inventory space)(As in, the user's current space left([usr.amount] out of 30) must not be exceeded by the input number), it also must equal or be less than the amount of /obj/IronOre in the user's inventory(and of course, must not equal 0). After said input, it should switch to a screen to select an ore type(Only types in the usr's inventory(typesof(/obj/ore)in usr.contents?), which path would be /obj/ore, and then move the inputted number's amount of the selected ore into something(list?), and proceed to loop through a forging code for each ore in the list.
Lamens terms: All I need is to know how to have a num input be applied to an object, i.e. you enter the number 5 and 5 of an object are removed from your inventory and sent to a list.
Either a push in the right direction or an explained fix would be most helpful.
var/input = input(blah,blah,blah)
To do the rest, use a while loop. Like