Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = {peripheral.find("powered_tile")}
- mon = peripheral.wrap("left")
- mon.setBackgroundColor(colors.cyan)
- mon.clear()
- mon.setTextScale(1)
- local w, h = mon.getSize()
- while true do
- local aff = {}
- local function nWrite(x,y,txt)
- aff[y] = aff[y] or {}
- aff[y][x]=txt
- end
- local x = 1
- local div = math.ceil(#p/h)
- local s=math.floor(w/(div)+0.5)
- for j=1, #p, h do
- for i=1, h do
- if p[i+j-1] then
- local v = p[i+j-1]
- local item = v.getStoredItems()
- if item ~= nil then
- nWrite(x,i,(i+j-1).."-"..item.display_name.." x"..(item.qty==v.getMaxStoredItems() and "Full" or item.qty))
- else
- nWrite(x,i,(i+j-1).."-vide")
- end
- end
- end
- x=x+s
- end
- for y=1, #aff do
- mon.setCursorPos(1,y)
- mon.clearLine()
- for x, txt in pairs(aff[y]) do
- mon.setCursorPos(x,y)
- mon.write(txt)
- end
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement