DMeville

Untitled

Jul 8th, 2013
148
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] == false then
  22.         drawBox(3,3,10,6, red)
  23.     else
  24.         drawBox(3,3,10,6, green)
  25.     end
  26.  
  27.     if spawners[1] == false then
  28.         drawBox(3,12,10,6, red)
  29.     else
  30.         drawBox(3,12,10,6, green)
  31.     end
  32.  
  33. end
  34. function update()
  35.  
  36. end
  37.  
  38. function init()
  39. if peripheral.isPresent("bottom") then 
  40.     mon = peripheral.wrap("bottom")
  41.     mw, mh = mon.getSize()
  42.     mon.setBackgroundColor(1)
  43.     mon.clear()
  44.     term.redirect(mon)
  45.     foundMonitor = true
  46. else
  47.     foundMonitor = false
  48.     print("Monitor not found - Aborting")
  49. end
  50. if foundMonitor == true then
  51.     --while true do
  52.         update()
  53.         drawGUI()
  54.         sleep(1)
  55.     --end
  56.     term.restore()
  57. end
  58. end
  59.  
  60. init()
Advertisement
Add Comment
Please, Sign In to add comment