Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rodLevels = 0
- local reactorOutputControl = 0
- local quarryOutputControl = 0
- solar = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_1")
- main_power = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_4")
- reactor = peripheral.wrap("back")
- while true do
- if solar.getEnergyStored() > 40000000 then
- reactorOutputControl = 0
- print("Reactor Output: Disabled")
- else
- if solar.getEnergyStored() < 10000000 then
- reactorOutputControl = 1
- print("Reactor Output: Enabled")
- end
- end
- if main_power.getEnergyStored() > ( main_power.getMaxEnergyStored() * .9 ) then
- quarryOutputControl = 1
- else
- quarryOutputControl = 0
- end
- rodLevels = math.min( math.floor( ( reactor.getEnergyStored() / 10000000 ) * 80 ) + 40 , 100 )
- if reactor.getEnergyStored() > 8000000 then
- rodLevels = 100
- end
- if reactor.getEnergyStored() < 1000000 then
- rodLevels = 0
- end
- if reactor.getEnergyStored() == 10000000 then
- reactor.setActive(false)
- else
- reactor.setActive(true)
- end
- print("Rod Levels: "..rodLevels)
- reactor.setAllControlRodLevels(rodLevels)
- redstone.setBundledOutput("right", ( reactorOutputControl * colors.red ) + ( quarryOutputControl * colors.green ) )
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment