Advertisement
basse

Untitled

Oct 2nd, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 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. local CurrentSteam = reactor.getHotFluidProducedLastTick()
  20. steamError = wantedSteam - CurrentSteam --
  21. temp = IPart
  22. IPart = steamError * 0.01 + temp
  23. output = IPart
  24. output = (output * -1) -- -1 max/ 0 min
  25. output = output + 1 -- 0 max / 1 min
  26. reactor.setAllControlRodLevels(output)
  27. print(output)
  28. os.queueEvent("randomEvent")
  29. os.pullEvent()
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement