Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap("left")
- local monitor = peripheral.wrap("top")
- monitor.setTextScale(0.5)
- local y_pos = 1
- local function out_format(item_name)
- return item_name:match(":(.*)")
- end
- local function out_main(list)
- for key = 1,27 do
- if list[key] ~= nil then
- local out = string.format("Slot %d : %dx %s", key, chest.getItemDetail(key).count, out_format(chest.getItemDetail(key).name))
- y_pos = y_pos + 1
- monitor.setCursorPos(1,y_pos)
- monitor.write(out)
- end
- end
- end
- -- main loop
- while true do
- -- monitor clean reset
- monitor.clear()
- monitor.setCursorPos(1,1)
- y_pos = 1
- out_main(chest.list())
- print("Iterated")
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement