Creatable amount
int creatable_amount( item it )
Returns the amount of the item that you are capable of creating with your current inventory and skills.
Example:
# end-of-ascension scriptlet that tries to create your key lime pies
boolean create_key_lime_pies()
{
item[int] pies;
pies[0] = $item[boris's key lime pie];
pies[1] = $item[jarlsberg's key lime pie];
pies[2] = $item[sneaky pete's key lime pie];
pies[3] = $item[digital key lime pie];
pies[4] = $item[star key lime pie];
boolean ret = true;
foreach i in pies
{
if (item_amount(pies[i]) < 1)
{
if (creatable_amount(pies[i]) >= 1)
{
if (!create(1, pies[i])) ret = false;
}
else
{
ret = false;
}
}
}
return ret;
}