Advertisement
Yahve83

Monitoring

Jul 31st, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. reactor = peripheral.find("BigReactors-Reactor")
  2. mon = peripheral.wrap("top")
  3. mon.clear()
  4. mon.setBackgroundColor(colors.blue)
  5. color = blue
  6.  
  7. --fuel = 0
  8. --maxFuel = 0
  9. function draw(color)
  10.   mon.clear()
  11.  
  12.   mon.setCursorPos(28,1)
  13.   mon.write("Reactor")
  14.  
  15.   mon.setCursorPos(2,10)
  16.   mon.write("Fuel:")
  17.   mon.setCursorPos(1,11)
  18.   mon.write(math.floor((fuel/maxFuel)*100).."%")
  19.  
  20.   progress(fuel,maxFuel,7,9)
  21.  
  22.   if reactor.getActive() == true then
  23.     mon.setBackgroundColor(colors.blue)
  24.   else
  25.     mon.setBackgroundColor(colors.red)
  26.   end
  27. end
  28.   sleep(2)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement