SHARE
TWEET

reaktor

a guest Aug 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Input Gate")
  2. local gate_input = read()
  3. gate_input = "flux_gate_6"
  4. local input = peripheral.wrap(gate_input)
  5. if input==nil then
  6.     error("Gate not found")
  7. end
  8. print("Output Gate")
  9. local gate_output = read()
  10. gate_output = "flux_gate_7"
  11. local output = peripheral.wrap(gate_output)
  12. if output==nil then
  13.     error("Gate not found")
  14. end
  15. local reactor = peripheral.find("draconic_reactor")
  16. if reactor==nil then
  17.     error("no reactor connected to network")
  18. end
  19. input.setOverrideEnabled(true)
  20. output.setOverrideEnabled(true)
  21. output.setFlowOverride(0)
  22. input.setFlowOverride(1000000)
  23. reactor.chargeReactor()
  24. print("Charging")
  25. while reactor.activateReactor()==false do
  26.     os.sleep(1)
  27.     write(".")
  28. end
  29. input.setFlowOverride(10000)
  30. print("Charging complete")
  31. os.sleep(0.2)
  32. print("press Enter to start")
  33. read()
  34. print("reactor starting")
  35. local fieldperc
  36. abwsum = 0
  37. while 1==1 do
  38.     info = reactor.getReactorInfo()
  39.     fieldperc = info.fieldStrength/info.maxFieldStrength
  40.     abw = - fieldperc + 0.3
  41.     abwsum = abwsum + abw
  42.     xe = abw*10000 + abwsum*10000
  43.     if xe<0 then abwsum =0 end
  44.     input.setFlowOverride(xe+1000)
  45.     os.sleep(0.1)
  46.     print(input.getFlow())
  47. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top