thatparadox

display

Jun 21st, 2013
109
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mon = peripheral.wrap("back")
  2. rednet.open("top")
  3.  
  4. function display()
  5. x,y = mon.getSize()
  6. --mt = {}
  7. mon.setBackgroundColor(colors.black)
  8. mon.clear()
  9. mon.setTextColor(colors.black)
  10. levels = 5 --put in your number of levels. this can be a variable.
  11. digi = levels
  12. p = 0
  13. for i = 1, levels, 2 do
  14.   p = p + 1
  15.   mon.setCursorPos(x/2,digi)
  16.   digi = digi - 1
  17.   mon.setBackgroundColor(colors.yellow)
  18.   p = tostring(p)
  19.   mon.write(" "..p.." ")
  20.   p = tonumber(p)
  21.   p = p + 1
  22.   mon.setCursorPos(x/2,digi)
  23.   digi = digi - 1
  24.   mon.setBackgroundColor(colors.orange)
  25.   p = tostring(p)
  26.   mon.write(" "..p.." ")
  27.   p = tonumber(p)
  28. end
  29. end
  30.  
  31. while true do
  32.   display()
  33.   event, side, xPos, yPos = os.pullEvent("monitor_touch")
  34.   Floor = levels - yPos + 1
  35.   if Floor > 0 then
  36.     rednet.send(45, Floor)
  37.   end
  38. end
RAW Paste Data