Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local r = peripherial.wrap("back")
  2.  
  3. local insertion = 0
  4.  
  5. local minRF = 1028
  6.  
  7. function TestRodLevel(reactor, ins)
  8. reactor.setActive(true)
  9. sleep(15)
  10. local RfPerTick = reactor.getEnergyProducedLastTick()
  11.  
  12. print("RF Produced at " .. ins .. "% insertion: " .. RfPerTick)
  13.  
  14. reactor.setActive(false)
  15. sleep(15)
  16.  
  17. if RfPerTick < minRF then
  18. return true
  19. else
  20. return false
  21. end
  22.  
  23. end
  24.  
  25. function DropRod(reactor, ins)
  26. reactor.setAllControlRodLevels(ins)
  27. end
  28.  
  29. while TestRodLevel(r, insertion) == false do
  30. insertion = insertion + 1
  31. DropRod(r, insertion)
  32. end
  33.  
  34. insertion = insertion - 1
  35. DropRod(r, insertion)
  36.  
  37. print("Completed. Best Rod Level for " .. minRF .. "/t is " .. insertion "%." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement