Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. while true do
  2. steamreq = 0
  3. for add, proxy in pairs(turbines) do
  4. if proxy.getActive() then
  5. proxy.setFluidFlowRateMax(proxy.getFluidFlowRateMaxMax())
  6. proxy.setInductorEngaged(true)
  7. turbines[add].rpm = math.floor(proxy.getRotorSpeed())
  8. steamreq = steamreq + proxy.getFluidFlowRateMax()
  9. if steamreq ~= laststeam then
  10. steamchange = 1
  11. end
  12. end
  13. end
  14. for add, proxy in pairs(reactors) do
  15. if proxy.getActive() then
  16. if steamchange == 1 then
  17. proxy.setAllControlRodLevels(100 - (steamreq / proxy.getHotFluidAmountMax()) * 100)
  18. os.sleep(5)
  19. if proxy.getHotFluidProducedLastTick() < steamreq then
  20. for i = 0, (proxy.getNumberOfControlRods() - 1) do
  21. if proxy.getControlRodLevel(i) > 0 then
  22. proxy.setControlRodLevel(i, proxy.getControlRodLevel(i) - 1)
  23. os.sleep(1.5)
  24. if proxy.getHotFluidProducedLastTick() > steamreq then
  25. steamchange = 0
  26. <<here is where I want to break out, back to where it checks for steamchange == 1>>
  27. end
  28. end
  29. end
  30. elseif proxy.getHotFluidProducedLastTick() > steamreq then
  31. for i = 0, (proxy.getNumberOfControlRods() - 1) do
  32. if proxy.getControlRodLevel(i) < 100 then
  33. proxy.setControlRodLevel(i, proxy.getControlRodLevel(i) + 1)
  34. os.sleep(1.5)
  35. if proxy.getHotFluidProducedLastTick() < steamreq then
  36. steamchange = 0
  37. <<here is where I want to break out, back to where it checks for steamchange == 1>>
  38. end
  39. end
  40. end
  41. end
  42. end
  43. end
  44. end
  45. os.sleep(1)
  46. laststeam = steamreq
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement