Guest User

Untitled

a guest
Oct 8th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. --
  2. -- Control an active cooled reactor from Big reactors (http://big-reactors.com/).
  3. -- Profiler
  4. -- run this script before running the reactor control script
  5. -- run this script every time you change your reactor layout
  6. --
  7. -- Author: El_Loko_
  8. --
  9. -- Save as "startup"
  10. --
  11. --
  12. --
  13. -- Constant values (configuration)
  14. -- ===============================
  15.  
  16. local rodLevel = 100
  17. local reactor
  18. reactor = peripheral.wrap("bottom")
  19. local hold = 20 -- as higher the hold value that more accurate are the values
  20. local profile = fs.open("profile.txt", "w")
  21.  
  22. reactor.setActive(true)
  23. rod = 100
  24. repeat
  25.     reactor.setAllControlRodLevels(rod)
  26.     sleep(hold)
  27.  
  28.     print("R: " .. rod .. " Heat: " .. reactor.getFuelTemperature() .. " Steam: " .. reactor.getEnergyProducedLastTick())
  29.     profile.writeLine(rod .. ";" .. reactor.getFuelTemperature() .. ";" .. reactor.getEnergyProducedLastTick())
  30.     rod = rod - 1
  31.     if(reactor.getEnergyProducedLastTick() > 8000) then
  32.         rod = 0
  33.     end
  34. until rod == 0
  35.  
  36. reactor.setActive(false)
  37. profile.close()
Add Comment
Please, Sign In to add comment