Advertisement
Guest User

startup

a guest
Mar 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. os.loadAPI("/charts")
  2. comp = peripheral.wrap("right")
  3. monitor = peripheral.wrap("top")
  4.  
  5. color = colors.green
  6.  
  7. monitor.setTextScale(0.5)
  8. monitor.setBackgroundColor(colors.black)
  9. monitor.clear()
  10.  
  11.  
  12. term.redirect(monitor)
  13.  
  14. while true do
  15.  
  16. pressure = comp.getPressure()
  17. maxPressure = comp.getCriticalPressure()
  18.  
  19. if 100*(pressure/maxPressure) >= 70 then
  20.   color = colors.red
  21.  else
  22.   color = colors.green
  23.  end
  24.  
  25. charts.lineColor("",1,1,45,pressure,maxPressure,color,colors.white,false)
  26.  
  27. sleep(1)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement