Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Name = " "
- local Data = {}
- local qty = 0
- local chest = peripheral.wrap("top")
- local monitor = peripheral.wrap("right")
- monitor.clear()
- local Size = chest.getInventorySize()
- function FillData()
- for i=1,Size do
- Data[i] = {}
- if chest.getStackInSlot(i) ~= nil then
- for k,v in pairs(chest.getStackInSlot(i)) do
- Data[i][k] = v
- end
- end
- end
- end
- function GetQty()
- for i=1,Size do
- if Data[i]["name"] == Name then
- qty = qty+Data[i]["qty"]
- end
- end
- end
- while true do
- FillData()
- GetQty()
- monitor.clear()
- monitor.setTextScale(5)
- monitor.write("Nombre de "..Name.." : "..qty)
- qty = 0
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment