Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Monitors Variables
- local monL = peripheral.wrap("left")
- local monR = peripheral.wrap("right")
- local monT = peripheral.wrap("monitor_4")
- -- Turbines Variables
- local turb1 = peripheral.wrap("BigReactors-Turbine_3")
- local turb2 = peripheral.wrap("BigReactors-Turbine_2")
- local turb3 = peripheral.wrap("BigReactors-Turbine_4")
- local turb4 = peripheral.wrap("BigReactors-Turbine_5")
- -- Getting Monitors (Right / Left) Size
- local w, h = monL.getSize()
- -- Main Program
- while true do
- -- Clearing Monitors
- monL.clear()
- monR.clear()
- monT.clear()
- -- Creating a middle Line on
- -- (Right and Left) monitors
- for x = 1,w do
- monL.setCursorPos(x, 10)
- monL.setBackgroundColor(colors.yellow)
- monL.write(" ")
- monR.setCursorPos(x, 10)
- monR.setBackgroundColor(colors.yellow)
- monR.write(" ")
- end
- -- Reset of Background Color on
- -- (Right and Left) monitors
- monL.setBackgroundColor(colors.black)
- monR.setBackgroundColor(colors.black)
- -- Titles Left
- monL.setTextColor(colors.lime)
- monL.setCursorPos(math.ceil(w/2) - 5,2)
- monL.write("Turbine N-1")
- monL.setCursorPos(math.ceil(w/2) - 5,12)
- monL.write("Turbine N-2")
- -- Titles Right
- monR.setTextColor(colors.lime)
- monR.setCursorPos(2,2)
- monR.write("Turbine N-3")
- monR.setCursorPos(2,12)
- monR.write("Turbine N-4")
- -- Title Top
- monT.setTextColor(colors.lime)
- monT.setCursorPos(2,2)
- monT.write("Overall Stats")
- -- Set Right/Left monitors text Color
- monL.setTextColor(colors.red)
- monR.setTextColor(colors.red)
- -- Left Monitor / Turbines Stats
- ---- Turbine N-1
- monL.setCursorPos(2,4)
- monL.write(" Status:")
- monL.setCursorPos(2,6)
- monL.write("Rotor Speed:")
- monL.setCursorPos(2,8)
- monL.write(" Production:")
- monL.setTextColor(colors.yellow)
- monL.setCursorPos(15,4)
- if turb1.getActive() then
- if turb1.getInductorEngaged() then
- monL.write("Producing")
- else
- monL.write("Speeding Up")
- end
- else
- monL.write("Shutdown")
- end
- monL.setCursorPos(15,6)
- rotorSpeed = math.floor(turb1.getRotorSpeed() * 100) / 100
- monL.write(rotorSpeed .. " RPM")
- monL.setCursorPos(15,8)
- energyProduced = math.floor(turb1.getEnergyProducedLastTick() * 100) / 100
- monL.write(energyProduced .. " RF/t")
- ---- Turbine N-3
- monL.setCursorPos(2,14)
- monL.write(" Status:")
- monL.setCursorPos(2,16)
- monL.write("Rotor Speed:")
- monL.setCursorPos(2,18)
- monL.write(" Production:")
- monL.setTextColor(colors.yellow)
- monL.setCursorPos(15,14)
- if turb2.getActive() then
- if turb2.getInductorEngaged() then
- monL.write("Producing")
- else
- monL.write("Speeding Up")
- end
- else
- monL.write("Shutdown")
- end
- monL.setCursorPos(15,16)
- rotorSpeed = math.floor(turb2.getRotorSpeed() * 100) / 100
- monL.write(rotorSpeed .. " RPM")
- monL.setCursorPos(15,18)
- energyProduced = math.floor(turb2.getEnergyProducedLastTick() * 100) / 100
- monL.write(energyProduced .. " RF/t")
- -- Right Monitor / Turbines Stats
- ---- Turbine N-4
- monR.setCursorPos(2,4)
- monR.write(" Status:")
- monR.setCursorPos(2,6)
- monR.write("Rotor Speed:")
- monR.setCursorPos(2,8)
- monR.write(" Production:")
- monR.setTextColor(colors.yellow)
- monR.setCursorPos(15,4)
- if turb3.getActive() then
- if turb3.getInductorEngaged() then
- monR.write("Producing")
- else
- monR.write("Speeding Up")
- end
- else
- monR.write("Shutdown")
- end
- monR.setCursorPos(15,6)
- rotorSpeed = math.floor(turb3.getRotorSpeed() * 100) / 100
- monR.write(rotorSpeed .. " RPM")
- monR.setCursorPos(15,8)
- energyProduced = math.floor(turb3.getEnergyProducedLastTick() * 100) / 100
- monR.write(energyProduced .. " RF/t")
- ---- Turbine N-4
- monR.setCursorPos(2,14)
- monR.write(" Status:")
- monR.setCursorPos(2,16)
- monR.write("Rotor Speed:")
- monR.setCursorPos(2,18)
- monR.write(" Production:")
- monR.setTextColor(colors.yellow)
- monR.setCursorPos(15,14)
- if turb4.getActive() then
- if turb4.getInductorEngaged() then
- monR.write("Producing")
- else
- monR.write("Speeding Up")
- end
- else
- monR.write("Shutdown")
- end
- monR.setCursorPos(15,16)
- rotorSpeed = math.floor(turb4.getRotorSpeed() * 100) / 100
- monR.write(rotorSpeed .. " RPM")
- monR.setCursorPos(15,18)
- energyProduced = math.floor(turb4.getEnergyProducedLastTick() * 100) / 100
- monR.write(energyProduced .. " RF/t")
- sleep(0.5)
- --break
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement