cc-utilities/storage/inventory.lua
2024-10-08 23:52:54 +02:00

21 lines
337 B
Lua

local Inventory = {}
function Inventory.getName(inv)
return peripheral.getName(inv)
end
function Inventory.getSimpleName(inv)
if inv == nil then
return "[NO_INV]"
end
local name = peripheral.getName(inv)
local _, e = name:find(":")
if e == nil then
return name
end
return name:sub(e + 1)
end
return Inventory