Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- create the peripheral variable --
- reactor = "BigReactors-Reactor_0"
- monitor = "monitor_4"
- r = peripheral.wrap(reactor)
- m = peripheral.wrap(monitor)
- -- Clear the moitor and picking information
- x, y = m.getSize()
- m.clear()
- m.setCursorPos(1, 1)
- --
- -- Collecting the Reactor Information --
- function react()
- status = r.getActive()
- energy = r.getEnergyStored()
- tick = r.getEnergyProducedLastTick()
- fuelT = r.getFuelTemperature()
- caseT = r.getCasingTemperature()
- fuel = r.getFuelAmount()
- end
- -- function the monitor --
- function status2()
- m.clear()
- m.setCursorPos(1, 1)
- m.setTextColor(colors.white)
- m.setTextScale(1)
- m.write("Status: ")
- if status == true then
- m.setTextColor(colors.lime)
- m.write("True")
- elseif status == false then
- m.setTextColor(colors.red)
- m.write("False")
- end
- end
- function temperature()
- m.setTextColor(colors.white)
- m.setCursorPos(1, 3)
- m.write("Fuel Heat: " .. math.floor(fuelT) .. " C")
- m.setCursorPos(1, 4)
- m.write("Casing Heat: " .. math.floor(caseT) .. " C")
- end
- function Energy()
- m.setCursorPos(1, 6)
- if math.floor(energy) < 10000000 then
- m.write("Stored: " .. math.floor(energy) .." Rf")
- elseif math.floor(energy) == 10000000 then
- m.write("Stored: ")
- m.setTextColor(colors.lime)
- m.write("Full")
- end
- m.setTextColor(colors.white)
- m.setCursorPos(1, 7)
- m.write("Making: " .. math.floor(tick) .. " Rf/t")
- end
- function fuel3()
- m.setCursorPos(1, 9)
- -- porcentagem --
- porcent = (100*fuel)/99907
- -- end --
- m.write("Fuel: " .. porcent .. "%" )
- end
- while true do
- react()
- status2()
- temperature()
- Energy()
- fuel3()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement