Just bashed up a quick script to replace dfstatus:
function exitem()
local item = dfhack.gui.getSelectedItem()
if(item) then
if(item.flags.owned) then
print ("OWNED")
end
printall(item)
printall(item.itemrefs)
local itemClass = item:getType()
print("---------")
print(itemClass,df.item_type[itemClass])
print("---------")
print(item:getSubtype())
print("---------")
print(item:getMaterial())
print(item:getMaterialIndex())
print("-- df.global")
printall(df.global.world.raws.inorganics[168])
--print("-----")
--printall(dfhack.matinfo)
print("----- decode")
printall(dfhack.matinfo.decode(item).material)
print("----- find")
printall(dfhack.matinfo.find("COAL"))
print("-----")
print(dfhack.items.getDescription(item,-1,false))
print("-----gettoken")
printall(dfhack.matinfo.getToken(item))
end
local drinks=0
local drink=0
local roasts=0
local roastMeals=0
local meat=0
local meatMeals=0
local ironB=0;
local pigIronB=0;
local steelB = 0;
local mithB=0
local wmithB=0
local goldB=0
local silverB=0
local copperB=0
local bronzeB=0
local cokeB=0
local iron=dfhack.matinfo.find("IRON").index
local pigIron=dfhack.matinfo.find("PIG_IRON").index
local steel=dfhack.matinfo.find("STEEL").index
local mith=dfhack.matinfo.find("MITHRIL").index
local wmith=dfhack.matinfo.find("PATTERN_MITHRIL").index
local gold=dfhack.matinfo.find("GOLD").index
local silver=dfhack.matinfo.find("SILVER").index
local copper=dfhack.matinfo.find("COPPER").index
local bronze=dfhack.matinfo.find("BRONZE").index
local coke=dfhack.matinfo.find("COAL").type
for k,v in ipairs(df.global.world.items.all) do
if(v:getType()==df.item_type.DRINK) then
drinks = drinks + v.stack_size
drink= drink+1
elseif(v:getType() == df.item_type.FOOD) then
roastMeals = roastMeals + v.stack_size
roasts= roasts+1
elseif(v:getType() == df.item_type.MEAT) then
meatMeals = meatMeals + v.stack_size
meat= meat+1
elseif(v:getType() == df.item_type.BAR) then
if(v:getMaterialIndex()==iron) then
ironB=ironB+1
elseif(v:getMaterialIndex()==pigIron) then
pigIronB=pigIronB+1
elseif(v:getMaterialIndex()==steel) then
steelB=steelB+1
elseif(v:getMaterialIndex()==mith) then
mithB=mithB+1
elseif(v:getMaterialIndex()==wmith) then
wmithB=wmithB+1
elseif(v:getMaterialIndex()==gold) then
goldB=goldB+1
elseif(v:getMaterialIndex()==silver) then
silverB=silverB+1
elseif(v:getMaterialIndex()==copper) then
copperB=copperB+1
elseif(v:getMaterialIndex()==bronze) then
bronzeB=bronzeB+1
elseif(v:getMaterial()==coke) then
cokeB=cokeB+1
end
end
end
print("Drinks",drink,drinks)
print("Food",roasts,roastMeals)
print("Meat",meat,meatMeals)
print("Iron Bars",ironB)
print("Pig Iron Bars",pigIronB)
print("Steel Bars",steelB)
print("Mithril Bars",mithB)
print("W Mithril Bars",wmithB)
print("Gold Bars",goldB)
print("Silver Bars",silverB)
print("Copper Bars",copperB)
print("Bronze Bars",bronzeB)
print("Coke Bars",cokeB)
end
exitem()
caveats:
1) Yes, I am running Masterwork.
2) the stuff in the first if is how I examined the items to get the right flags - It is not the prettiest part of the code but it worked.
3) save this to exitem.lua in your df/hack/scripts directory and then type exitem at the dfhack prompt.