Advertisement
leons1999

Notaus

Feb 25th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2.  
  3.  
  4. reactor = peripheral.find("draconic_reactor")
  5. gate = peripheral.find("flux_gate")
  6. gate.setOverrideEnabled(true)
  7.  
  8. function NotStop()
  9.   reactor.stopReactor()
  10. end
  11.  
  12. while true do
  13.   info = reactor.getReactorInfo()
  14.   term.clear()
  15.   term.setCursorPos(1,1)
  16.   print("-------------------------")
  17.   print("Reaktor Sicherheitssystem")
  18.   print("-------------------------")
  19.   print()
  20.   print("Reactor Status: ",info["status"])
  21.   print()
  22.   print()
  23.  
  24.  
  25.   if info["status"] == "online" then
  26.     print("-----------------------------")
  27.     print("Sicherheitsueberwachung Aktiv")
  28.     print("-----------------------------")
  29.     print()
  30.     print("Temperatur: ",info["temperature"])
  31.     print("Feld Staerke: ",info["fieldStrength"])
  32.     print("Energie Saettigung: ",info["energySaturation"])
  33.     if (info["temperature"] > 8000) or (info["fieldStrength"] < 20000000) or (info["energySaturation"] < 120000000) then
  34.      
  35.       NotStop()
  36.     end
  37.   elseif info["status"] == "stopping" then
  38.     print("----------------------------")
  39.     print("Sicherheitsabschaltung Aktiv")
  40.     print("----------------------------")
  41.     print()
  42.     drainRate = info["fieldDrainRate"]
  43.     gate.setFlowOverride(drainRate * 1.2)
  44.     print("Benoetigte Schildenergie: ",math.floor(drainRate * 1.2),"Rf/t")
  45.    
  46.   elseif info["status"] == "charging" then
  47.     gate.setFlowOverride(500000)
  48.   elseif info["status"] == "charged" then
  49.     print("-------------------")
  50.     print("Reaktor wird gladen")
  51.     print("-------------------")
  52.     gate.setFlowOverride(0)
  53.     reactor.activateReactor()
  54.   else
  55.     gate.setFlowOverride(0)
  56.   end
  57.  
  58.   os.sleep(0.2)
  59.  
  60. end
  61. read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement