Advertisement
Guest User

draconic

a guest
Feb 9th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. reactor = peripheral.wrap("back")
  2. fluxIn = peripheral.wrap("flux_gate_1")
  3. fluxOut = peripheral.wrap("flux_gate_0")
  4. alert = 0
  5.  
  6. reactor.activateReactor()
  7.  
  8. while true do
  9. alert = 0
  10. print("fluxIN= "..fluxIn.getSignalLowFlow())
  11. print("fluxOut= "..fluxOut.getSignalLowFlow())
  12.  
  13.  
  14. daten = reactor.getReactorInfo()
  15. feldstart = daten.fieldStrength/1000000
  16. temperatur = daten.temperature
  17. puffer = daten.energySaturation/10000000
  18. rate = daten.generationRate
  19.  
  20. if (feldstart < 40) then
  21.  fluxIn.setSignalLowFlow(fluxIn.getSignalLowFlow()+10000)
  22.  alert = 1
  23. end
  24. if (feldstart > 70) then
  25.  fluxIn.setSignalLowFlow(fluxIn.getSignalLowFlow()+10000)
  26.  alert = 1
  27. end
  28.  
  29. if (temperatur > 7000) then
  30.  reactor.stopReactor()
  31. end
  32. if (temperatur > 6000) then
  33.  fluxOut.setSignalLowFlow(fluxOut.getSignalLowFlow()+10000)
  34.  alert = 1
  35. end
  36.  
  37. if (puffer > 70 and temperatur < 6000) then
  38.  fluxOut.setSignalLowFlow(fluxOut.getSignalLowFlow()+10000)
  39.  alert = 1
  40. end
  41. if (puffer < 40 and temperatur < 6000) then
  42.  fluxOut.setSignalLowFlow(fluxOut.getSignalLowFlow()-10000)
  43.  alert = 1
  44. end
  45.  
  46. if (rate > fluxOut.getSignalLowFlow() and alert == 0) then
  47.  fluxOut.setSignalLowFlow(fluxOut.getSignalLowFlow()+10000
  48. end
  49.  
  50. sleep(1)
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement