basse

Untitled

Oct 16th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. local wantedSteam = 0.5
  2. -- pick mode
  3. -- max power mode
  4. -- aim for 1800 rpm, or steam output of turbines * 2000mb
  5. -- buffer full mode(later)
  6. -- Find info about connect devices
  7. -- turbines
  8. -- reactors
  9. -- control loop
  10.  
  11.  
  12. -- first stage
  13. -- Aim for a fixed amount of steam
  14. local IPart = 0.0
  15. while true do
  16. print("Hello World!")
  17. local reactor = peripheral.wrap('BigReactors-Reactor_0')
  18. local CurrentSteam = reactor.getHotFluidAmount()/50000.0
  19. steamError = CurrentSteam - wantedSteam --
  20. print(steamError)
  21. temp = IPart
  22. IPart = steamError * 0.0001 + temp
  23. print(IPart)
  24. if IPart > 1 then
  25. IPart = 1
  26. end
  27. if IPart < -1 then
  28. IPart = -1
  29. end
  30.  
  31. tempOutput = IPart
  32. output = (1 - (tempOutput*-1) )*100
  33. reactor.setAllControlRodLevels(output)
  34. print(output)
  35. os.queueEvent("randomEvent")
  36. os.pullEvent()
  37. sleep(0.5)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment