Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setTextColor(colors.green)
- term.write("v0.4")
- term.setTextColor(colors.white)
- names = {"gold", "iron"}
- chest = peripheral.wrap("bottom")
- print("")
- function checkChest()
- items = {}
- qty = {}
- for i = 1,chest.getInventorySize() do
- item = chest.getStackInSlot(i)
- if item ~= nil then
- for j = 1,#names do
- if string.match(item["name"], names[j]) then
- items[#items+1] = item["name"]
- qty[#qty+1] = item["qty"]
- break
- end
- end
- end
- end
- return items, qty
- end
- items, qty = checkChest()
- for i=1,#items do
- print(qty[i].." "..items[i])
- end
- ---------------------------------------------------------------------------------------
- function tellNames()
- for i = 1,chest.getInventorySize() do
- item = chest.getStackInSlot(i)
- print(item["name"]..", "..item["display_name"]..", "..item["raw_name"]..", "..item["mod_id"])
- end
- end
- --[[
- pastebin get 5yu5bhR3
- for i,v in pairs(someItem) do
- print(i..", "..v) prints eg. "display_name, Crafting Table", "qty, 2", "max_size, 64"
- end
- ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement