Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.wrap("BigReactors-Reactor_2")
- local mon = peripheral.wrap("left")
- local energy = 0
- local fuel = 0
- local freak_out = false
- local insertion_level = 76
- while true do
- reactor.setAllControlRodLevels(insertion_level)
- --Energy in energy buffer
- energy = getEnergyStored
- --Is the fuel in mb
- fuel = reactor.getFuelAmount()
- --Percentages
- percent_fuel = fuel/240000
- percent_energy = energy/10000000
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,1)
- --Freak out will keep the insertion level 0 until we hit 98%
- if percent_energy >= 98 then
- insertion_level = 76
- freak_out = false
- --Above 50% and below 90% insertion level 60
- elseif percent_energy < 90 and freak_out == false and percent_energy > 50 then
- mon.setTextColor(colors.yellow)
- insertion_level = 60
- --Below 50% insertion level 0
- elseif percent_energy < 50 then
- mon.setTextColor(colors.red)
- freak_out = true
- insertion_level = 0
- end
- mon.write("Reactor Status")
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.lightGray)
- mon.write("===========================")
- --RF/T Display
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("RF/T: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(energy + 0.5))
- --Fuel Amount
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("Fuel: ")
- mon.setTextColor(colors.lime)
- mon.write(percent_fuel)
- os.sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement