Guest User

reactor

a guest
Feb 6th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. p = peripheral.wrap("top")
  2. maxHeat = 8500
  3. eu = p.getEUOutput()
  4. rednet.open("back")
  5. safeHeat = maxHeat * .48
  6.  
  7. rs.setOutput("top", true)
  8.  
  9. term.clear()
  10.  
  11. function checkHeat()
  12.     if heat > safeHeat then
  13.       rs.setOutput("top", false)
  14.     else
  15.       rs.setOutput("top", true)
  16.     end
  17. end
  18.  
  19. function displayHeat()
  20.     heat = p.getHeat()
  21.    
  22.     print(heat.."/"..maxHeat)
  23.     os.sleep(1)
  24.     term.clear()
  25.     term.setCursorPos(1,1)  
  26. end
  27.  
  28. function sendInfo()
  29.   rednet.send(108,heat,eu)
  30. end  
  31.  
  32. while true do
  33.   displayHeat()
  34.   checkHeat()
  35.   sendInfo()
  36.   os.sleep(.8)
  37. end
Advertisement
Add Comment
Please, Sign In to add comment