DMeville

Untitled

Jul 8th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. foundMonitor = false
  2. mw, mh = 0
  3. spawners = {}
  4. spawners[0] = false
  5. spawners[1] = true
  6. red = 16384
  7. green = 32
  8. function drawBox(x,y,w,h,c)
  9.     i = x
  10.     while i < w do
  11.     j = y
  12.         while j < h do
  13.             paintutils.drawPixel(i,j,c)
  14.             j = j+1
  15.         end
  16.     i = i+1
  17.     end
  18. end
  19. function drawGUI()
  20.     mon.setCursorPos(1,1)
  21.     if spawners[0] == true then
  22.         drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 32)
  23.     else
  24.         drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 2)
  25.     end
  26.     if spawners[1] == true then
  27.         drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 32)
  28.     else
  29.         drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 2)
  30.     end
  31. end
  32. function update()
  33.  
  34. end
  35.  
  36. function init()
  37. if peripheral.isPresent("bottom") then 
  38.     mon = peripheral.wrap("bottom")
  39.     mw, mh = mon.getSize()
  40.     mon.setBackgroundColor(1)
  41.     mon.clear()
  42.     term.redirect(mon)
  43.     foundMonitor = true
  44. else
  45.     foundMonitor = false
  46.     print("Monitor not found - Aborting")
  47. end
  48. if foundMonitor == true then
  49.     --while true do
  50.         update()
  51.         drawGUI()
  52.         sleep(1)
  53.     --end
  54.     term.restore()
  55. end
  56. end
  57.  
  58. init()
Advertisement
Add Comment
Please, Sign In to add comment