f = fs.open('/inv.txt','w')
for i=1,16 do
    if tx.state.inv[i] == nil then
    
        t = tx.state.inv[i].item_type
        if t == nil then
            t = 'nil'
        elseif type(t) == 'table' then
            t = table.concat(t,'|')
        end
    
        s = i..': t='..t..' c='..tx.state.inv[i].count..' s='..tx.state.inv[i].space
        f.writeLine(s)
        if tx.state.inv[i].count > 0 then
            print(s)
        end
    
    end 
end
f.close()

