Advertisement
Strangenova

CC_Prominence_2_item_check

May 19th, 2025
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. local chest = peripheral.wrap("left")
  2. local monitor = peripheral.wrap("top")
  3. monitor.setTextScale(0.5)
  4.  
  5. local y_pos = 1
  6.  
  7.  
  8. local function out_format(item_name)
  9.     return item_name:match(":(.*)")
  10. end
  11.  
  12. local function out_main(list)
  13.     for key = 1,27 do
  14.  
  15.         if list[key] ~= nil then
  16.             local out = string.format("Slot %d : %dx %s", key, chest.getItemDetail(key).count, out_format(chest.getItemDetail(key).name))
  17.  
  18.             y_pos = y_pos + 1
  19.             monitor.setCursorPos(1,y_pos)
  20.             monitor.write(out)
  21.         end
  22.     end
  23. end
  24.  
  25. -- main loop
  26. while true do
  27.     -- monitor clean reset
  28.     monitor.clear()
  29.     monitor.setCursorPos(1,1)
  30.     y_pos = 1
  31.  
  32.     out_main(chest.list())
  33.     print("Iterated")
  34.     sleep(10)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement