Advertisement
AleanaA

Untitled

Jul 15th, 2024 (edited)
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. ChestB = peripheral.wrap("back")
  2. ChestL = peripheral.wrap("left")
  3. DisplayR = peripheral.wrap("right")
  4. while true do
  5.     Items = {}
  6.     CurrentLine = 0
  7.     for slot, item in pairs(ChestL.list()) do
  8.         if not Items[item.name] then
  9.             Items[item.name] = 0
  10.         end
  11.         Items[item.name] = Items[item.name] + item.count
  12.  
  13.     end
  14.     for slot, item in pairs(ChestB.list()) do
  15.         if not Items[item.name] then
  16.             Items[item.name] = 0
  17.         end
  18.         Items[item.name] = Items[item.name] + item.count
  19.     end
  20.     DisplayR.clear()
  21.     for item, count in pairs(Items) do
  22.         CurrentLine = CurrentLine + 1
  23.         DisplayR.setCursorPos(1,CurrentLine)
  24.         DisplayR.write(item.." - "..count)
  25.     end
  26.     sleep(2)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement