basse

Untitled

Oct 2nd, 2014
186
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. print(steamError)
  22. temp = IPart
  23. IPart = steamError * 0.001 + temp
  24. print(IPart)
  25. if IPart > 1 then
  26. IPart = 1
  27. end
  28. if IPart < -1 then
  29. IPart = -1
  30. end
  31. output = (1 - (IPart*-1) )*100
  32. reactor.setAllControlRodLevels(output)
  33. print(output)
  34. os.queueEvent("randomEvent")
  35. os.pullEvent()
  36. sleep(0.5)
  37. end
Advertisement
Add Comment
Please, Sign In to add comment