Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Title: ComputerCraft BigReactor automatic throttling software for Active reactors.
- -- Author: MyrddinE
- --
- -- Throttles the reactor based on the level of hot fluid. Because the hot fluid buffer
- -- is small compared to the generation speed, it updates several times a second to
- -- maintain the proper temperature.
- -- Update this to match your reactor's steam volume.
- maxSteam = 17200
- -- Set this to the side your monitor is on, or blank for no monitor. If the monitor is
- -- connected via a wired modem, set this to the full name of the monitor.
- monitor = 'top'
- -- monitor = 'right'
- -- Stick the computer right on the port. If the reactor is attached via a wired modem,
- -- change the wrap to the full name of the Reactor.
- reactor = peripheral.wrap('back')
- -- Sets the monitor to a wrapped peripheral if you have one.
- if #monitor > 0 then
- monitor = peripheral.wrap(monitor)
- width,height = monitor.getSize()
- monitor.setCursorPos(1,height)
- else
- monitor = false
- end
- local rod = 70
- targetSteam = math.ceil(maxSteam*0.5)
- -- Run forever.
- while true do
- -- The important part of the loop is just three lines, very simple.
- steam = reactor.getHotFluidAmount()
- rod = (reactor.getControlRodLevel(1) - 1/targetSteam*(targetSteam - steam))
- reactor.setAllControlRodLevels(rod)
- -- Everything below just drives a scrolling monitor display.
- if monitor then
- temp = math.floor(reactor.getCasingTemperature()).."C"
- monitor.scroll(2)
- monitor.setCursorPos(1,height)
- monitor.write(rod.."%")
- monitor.scroll(1)
- monitor.setCursorPos(1+width-#temp,height)
- monitor.write(temp)
- end
- -- Sleep for a moment.
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement