Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.wrap("bottom")
- local max = 10000000
- local upper = 0.65
- local lower = 0.35
- local upperTotal = max * upper
- local lowerTotal = max * lower
- local iterations = 0
- while (true) do
- local energy = reactor.getEnergyStored()
- if energy > upperTotal then
- reactor.setActive(false)
- end
- if energy < lowerTotal then
- reactor.setActive(true)
- end
- if iterations % 60 == 0 then
- print(string.format("Running for %d minutes", iterations/60))
- end
- sleep(1)
- iterations = iterations + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment