Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Author: RebelliousUno
- --Date: 16/10/2014
- --Last Modified: 17/10/2014
- cabinet = peripheral.wrap("bottom")
- monitor = peripheral.wrap("top")
- monitor.setTextScale(1.5)
- maxLength = 15
- x, y = monitor.getSize();
- function doMain()
- lastInvSize=0
- while(true) do
- invSize =cabinet.getInventorySize()
- if invSize>lastInvSize then
- monitor.clear()
- doTitles()
- monitor.setCursorPos(1,2)
- for i= 1, invSize-1 do
- name = cabinet.getStackInSlot(i)["name"]
- nameLen = string.len(name)
- posX, posY = monitor.getCursorPos()
- if posX+nameLen > x then
- posY = posY+1
- posX = 1
- end
- monitor.setCursorPos(posX,posY)
- monitor.write(name)
- newX, newY = monitor.getCursorPos()
- newX = 1+math.ceil(newX/maxLength)*maxLength
- print(newX)
- monitor.setCursorPos(newX,newY)
- end
- lastInvSize = invSize
- end
- sleep(5)
- end
- end
- function doTitles()
- titleText = "Subscribers Wall"
- monitor.setCursorPos(((x/2)-(string.len(titleText)/2)),1)
- monitor.setTextColor(colors.cyan)
- monitor.write(titleText)
- monitor.setTextColor(colors.white)
- end
- doMain()
Advertisement
Add Comment
Please, Sign In to add comment