Advertisement
Kukkerem

barrel.lua

Jul 16th, 2025 (edited)
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. local mon = peripheral.find("monitor")
  2. local barrel = peripheral.find("sophisticatedstorage:barrel")
  3.  
  4. function PrintBarrel()
  5.     mon.clear()
  6.     mon.setCursorPos(1,1)
  7.     i = 1
  8.     for slot, item in pairs(barrel.list()) do
  9.         mon.write(("%d x %s in slot %d"):format(item.count, item.name, slot))
  10.         i = i + 1
  11.         mon.setCursorPos(1,i)
  12.     end
  13.  
  14. end
  15.  
  16. while true do
  17.     PrintBarrel()
  18.     sleep(1)
  19. end
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement