DMeville

Untitled

Jul 8th, 2013
137
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, j = 0
  10.     for i = x, w do
  11.         for j = y, h do
  12.             paintutils.drawPixel(i,j,c)
  13.         end
  14.     end
  15. end
  16. function drawGUI()
  17.     mon.setCursorPos(1,1)
  18.     if spawners[0] == true then
  19.         drawBox(mw - mw/2, mh - mh/2, 5,2, 32)
  20.     else
  21.         drawBox(mw - mw/2, mh - mh/2, 5,2, 2)
  22.     end
  23.     if spawners[1] == true then
  24.         drawBox(mw - mw/2, mh + mh/2, 5,2, 32)
  25.     else
  26.         drawBox(mw - mw/2, mh + mh/2, 5,2, 2)
  27.     end
  28. end
  29. function update()
  30.  
  31. end
  32.  
  33. function init()
  34. if peripheral.isPresent("top") then
  35.     mon = peripheral.wrap("top")
  36.     mw, mh = mon.getSize()
  37.     term.redirect(mon)
  38.     foundMonitor = true
  39. else
  40.     foundMonitor = false
  41.     print("Monitor not found - Aborting")
  42. end
  43. if foundMonitor == true then
  44.     while true do
  45.         update()
  46.         drawGUI()
  47.         sleep(1)
  48.     end
  49. end
  50. end
  51.  
  52. init()
Advertisement
Add Comment
Please, Sign In to add comment