Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local colors = { blue = 0x4286F4, purple = 0xB673d6, red = 0xC14141, green = 0xDA841,
- black = 0x000000, white = 0xFFFFFF, grey = 0x47494C, lightGrey = 0xBBBBBB, lime = 0x7DFF86}
- local r = component.br_reactor
- local mon = component.gpu
- mon.setResolution(54,18)
- --mon.setResolution(150,40)
- local w, h = mon.getResolution()
- mon.setBackground(colors.black)
- while true do
- local reactorOnline = r.getActive() --Boolean
- local energyProduction = r.getEnergyProducedLastTick() --RF/t
- local energyStored = r.getEnergyStored() --RF
- local fuelTemp = r.getFuelTemperature() --C
- local caseTemp = r.getCasingTemperature() --C
- local fuelAmount = r.getFuelAmount() --mB
- local wasteAmount = r.getWasteAmount() --mB
- local fuelReact = r.getFuelReactivity() --%
- local rodLevel = r.getControlRodLevel(0) --%
- local fuelCons = r.getFuelConsumedLastTick() --mB
- mon.fill(1,1,w,h," ")
- --Reactor Online
- mon.setForeground(colors.white)
- mon.set(1,1, "Active: ")
- if reactorOnline then
- mon.setForeground(colors.lime)
- else
- mon.setForeground(colors.red)
- end
- if reactorOnline then
- mon.set(9,1,"True")
- else
- mon.set(9,1,"False")
- end
- --RF/t Production
- mon.setForeground(colors.white)
- mon.set(1,2,"RF/t: ")
- if energyProduction <= 99 then
- mon.setForeground(colors.red)
- else
- mon.setForeground(colors.lime)
- end
- mon.set(7,2, math.ceil(energyProduction).." RF/t")
- --Energy Stored
- --mon.setCursor(1,3)
- mon.setForeground(colors.white)
- mon.set(1,3,"Energy Stored: ")
- if energyStored < 1000000 then
- mon.setForeground(colors.red)
- else
- mon.setForeground(colors.lime)
- end
- mon.set(16,3, math.ceil(energyStored).." RF")
- --Fuel Temp
- --mon.setCursor(1,4)
- mon.setForeground(colors.white)
- mon.set(1,4, "Fuel Temp: ")
- mon.setForeground(colors.lime)
- mon.set(12,4, math.ceil(fuelTemp).." C")
- --Case Temp
- --mon.setCursor(1,5)
- mon.setForeground(colors.white)
- mon.set(1,5, "Case Temp: ")
- mon.setForeground(colors.lime)
- mon.set(12,5, math.ceil(caseTemp).." C")
- --Fuel Reactivity
- --mon.setCursor(1,6)
- mon.setForeground(colors.white)
- mon.set(1,6, "Fuel React: ")
- mon.setForeground(colors.lime)
- mon.set(13,6, math.ceil(fuelReact).."%")
- --Fuel Amount
- --mon.setCursor(1,7)
- mon.setForeground(colors.white)
- mon.set(1,7, "Fuel: ")
- mon.setForeground(colors.lime)
- mon.set(6,7, math.ceil(fuelAmount).." mB")
- --Fuel Consumption
- --mon.setCursor(1,8)
- mon.setForeground(colors.white)
- mon.set(1,8, "Fuel Use: ")
- mon.setForeground(colors.lime)
- if fuelCons > 0 then
- mon.set(11,8, "~")
- end
- mon.set(12,8, math.ceil(fuelCons * 100 / 10).." mB/t")
- --Waste Amount
- --mon.setCursor(1,9)
- mon.setForeground(colors.white)
- mon.set(1,9, "Waste: ")
- if wasteAmount >= 900 then
- mon.setForeground(colors.red)
- else
- mon.setForeground(colors.lime)
- end
- mon.set(8,9, math.ceil(wasteAmount).." mB")
- --Activation Button Display
- if reactorOnline then
- mon.set(19,1, "De-Activate")
- else
- mon.set(22,1, "Activate")
- end
- --Rod Controller Display
- --mon.setCursor(24,7)
- mon.setForeground(colors.white)
- mon.set(24,7, "Rods")
- if rodLevel == 0 then
- --mon.setCursor(25,8)
- mon.set(25,8, rodLevel.."%")
- else
- --mon.setCursor(24,8)
- mon.set(24,8, rodLevel.."%")
- end
- --mon.setCursor(22,8)
- mon.set(22,8, "<")
- --mon.setCursor(29,8)
- mon.set(29,8, ">")
- function blank()
- end
- --Button Timers
- local name, _, x, y = event.pull("touch")
- if y == 1 and x < 30 and x > 18 and reactorOnline then
- r.setActive(false)
- elseif y == 1 and x < 30 and x > 21 then
- r.setActive(true)
- elseif y == 8 and x == 21 or x == 22 then
- r.setAllControlRodLevels(rodLevel - 10)
- elseif y == 8 and x == 28 or x == 29 then
- r.setAllControlRodLevels(rodLevel + 10)
- end
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement