Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = {peripheral.find("powered_tile")}
- local mon = peripheral.find("monitor")
- Max = m.getMaxStoredItems()
- mon.setBackgroundColor(colors.cyan)
- mon.setTextColor(colors.black)
- 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
- --while true do
- -- items = p.getStoredItems()
- -- term.setBackgroundColor(colors.black)
- -- term.clear()
- -- term.setCursorPos(1,1)
- -- print(term.getSize())
- -- paintutils.drawFilledBox(2,3,49,3,colors.gray)
- -- paintutils.drawFilledBox(2,3,math.ceil(items.qty*49/Max),3,colors.green)
- --end
Add Comment
Please, Sign In to add comment