Advertisement
basse

Untitled

Oct 2nd, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1.  
  2. local wantedSteam = 4000
  3. -- pick mode
  4. -- max power mode
  5. -- aim for 1800 rpm, or steam output of turbines * 2000mb
  6. -- buffer full mode(later)
  7. -- Find info about connect devices
  8. -- turbines
  9. -- reactors
  10. -- control loop
  11.  
  12.  
  13. -- first stage
  14. -- Aim for a fixed amount of steam
  15. local IPart = 0.0
  16. while true do
  17. print("Hello World!")
  18. local reactor = peripheral.wrap('BigReactors-Reactor_0')
  19. print(reactor)
  20. local CurrentSteam = reactor.getHotFluidProducedLastTick()
  21. print(CurrentSteam)
  22. steamError = wantedSteam - CurrentSteam --
  23. print(steamError)
  24. print(IPart)
  25. temp = IPart
  26. IPart = steamError * 0.01 + temp
  27. output = IPart
  28. output = (output * -1) -- -1 max/ 0 min
  29. output = output + 1 -- 0 max / 1 min
  30. reactor.setAllControlRodLevels(output)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement