Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local mon = peripheral.wrap("front")
- -- reactor id = 43
- -- turbine1 id = 47
- -- turbine2 id = 48
- -- turbine3 id = 49
- -- turbine4 id = 50
- while true do
- local id,mes = rednet.receive()
- if id = 43 then
- reactor = {
- active = mes.active,
- casetemp = mes.casingtemp,
- steamtick = mes.energylasttick,
- fuel = mes.fuelamount,
- fuelmax = mes.fuelmax,
- fueleat = mes.fueleatlasttick,
- temp = mes.fueltemp,
- waste = mes.wasteamount,
- }
- elseif id = 47 then
- t1 = {
- active = mes.active,
- rotorspeed = mes.rotorspeed,
- stored = math.floor(mes.stored,0),
- produce = math.floor(mes.produce,0),
- }
- elseif id = 48 then
- t2 = {
- active = mes.active,
- rotorspeed = mes.rotorspeed,
- stored = math.floor(mes.stored,0),
- produce = math.floor(mes.produce,0),
- }
- elseif id = 49 then
- t3 = {
- active = mes.active,
- rotorspeed = mes.rotorspeed,
- stored = math.floor(mes.stored,0),
- produce = math.floor(mes.produce,0),
- }
- elseif id = 50 then
- t4 = {
- active = mes.active,
- rotorspeed = mes.rotorspeed,
- stored = math.floor(mes.stored,0),
- produce = math.floor(mes.produce,0),
- }
- end
- totalproduce = t1.produce + t2.produce + t3.produce + t4.produce
- totalstored = t1.stored + t2.stored + t3.stored + t4.stored
- --monitor x = 82
- --monitor y = 19
- term.clear()
- term.redirect(mon)
- mon.setTextScale(0.5)
- -- reactor status
- print("~~~~~~~~~~~~~~~~~~~~ Reactor Status ~~~~~~~~~~~~~~~~~~~~")
- print()
- write("REACTOR: ")
- if reactor.active == true then
- mon.setTextColour(colors.lime)
- write("ACTIVE")
- elseif reactor.active == false then
- mon.setTextColour(colors.red)
- write("OFFLINE")
- end
- mon.setTextColour(colors.white)
- print()
- print()
- print("Steam: " .. math.floor(reactor.steamtick,0) .. " mB/t")
- print()
- print("Fuel: " .. reactor.fuel .. "/" .. reactor.fuelmax .. " mB")
- print("Fuel Usage: " .. math.ceil(reactor.fueleat*100)/100 .. " mB/t")
- print("Fuel Temp: " .. math.floor(reactor.temp,1) .. " C")
- print("Waste: " .. reactor.waste .. " mB")
- print()
- print("~~~~~~~~~~~~~~~~~~~~ Turbine Status ~~~~~~~~~~~~~~~~~~~~")
- print()
- write("Turbine 1: ")
- if t1.active == true then
- mon.setTextColour(colors.lime)
- write("ACTIVE")
- elseif t1.active == false then
- mon.setTextColour(colors.red)
- write("OFFLINE")
- end
- mon.setTextColour(colors.white)
- print()
- print("Rotor Speed: " .. t1.rotorspeed .. " RPM")
- print("Energy Production: " .. t1.produce .." RF/t")
- print("Energy Stored: " .. t1.stored .." RF")
- print()
- write("Turbine 2: ")
- if t2.active == true then
- mon.setTextColour(colors.lime)
- write("ACTIVE")
- elseif t2.active == false then
- mon.setTextColour(colors.red)
- write("OFFLINE")
- end
- mon.setTextColour(colors.white)
- print()
- print("Rotor Speed: " .. t2.rotorspeed .. " RPM")
- print("Energy Production: " .. t2.produce .." RF/t")
- print("Energy Stored: " .. t2.stored .." RF")
- print()
- write("Turbine 3: ")
- if t3.active == true then
- mon.setTextColour(colors.lime)
- write("ACTIVE")
- elseif t3.active == false then
- mon.setTextColour(colors.red)
- write("OFFLINE")
- end
- mon.setTextColour(colors.white)
- print()
- print("Rotor Speed: " .. t3.rotorspeed .. " RPM")
- print("Energy Production: " .. t3.produce .." RF/t")
- print("Energy Stored: " .. t3.stored .." RF")
- print()
- write("Turbine 4: ")
- if t4.active == true then
- mon.setTextColour(colors.lime)
- write("ACTIVE")
- elseif t4.active == false then
- mon.setTextColour(colors.red)
- write("OFFLINE")
- end
- mon.setTextColour(colors.white)
- print()
- print("Rotor Speed: " .. t4.rotorspeed .. " RPM")
- print("Energy Production: " .. t4.produce .." RF/t")
- print("Energy Stored: " .. t4.stored .." RF")
- print()
- print("~~~~~~~~~~~~~~~~~~~~ Total Stats ~~~~~~~~~~~~~~~~~~~~")
- print()
- print("Total Energy Production: " .. totalproduce .." RF/t")
- print("Energy Stored: " .. totalstored .." RF")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement