basse

Untitled

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