Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables:
- mon = peripheral.wrap("back")
- reactor = peripheral.wrap("BigReactors-Reactor_84")
- enCell1 = peripheral.wrap("cofh_thermalexpansion_energycell_3")
- enCell2 = peripheral.wrap("left")
- actif = reactor.getActive()
- mon.clear()
- --Fonction:
- function getEnergy1()
- return enCell1.getEnergyStored("unknow")
- end
- function getEnergy2()
- return enCell2.getEnergyStored("unknow")
- end
- function getMaxEnergy1()
- return enCell1.getMaxEnergyStored("unknow")
- end
- function getMaxEnergy2()
- return enCell2.getMaxEnergyStored("unknow")
- end
- function getEnergyPercent1()
- return math.floor(getEnergy1()/getMaxEnergy1()*100)
- end
- function getEnergyPercent2()
- return math.floor(getEnergy2()/getMaxEnergy2()*100)
- end
- function quart1()
- return math.floor(getEnergyPercent1()/25)
- end
- function quart2()
- return math.floor(getEnergyPercent2()/25)
- end
- function affQuart1()
- if quart1() == 0 then
- mon.setTextColor(colors.red) mon.write("Vide")
- elseif quart1() >= 1 then
- mon.setTextColor(colors.orange) mon.write(quart1().. "/4 ")
- elseif quart1() >= 2 then
- mon.setTextColor(colors.orange) mon.write(quart1().. "/4 ")
- elseif quart1() >= 3 then
- mon.setTextColor(colors.yellow) mon.write(quart1().. "/4 ")
- elseif quart1() == 4 then
- mon.setTextColor(colors.green) mon.write("Plein") end
- end
- function affQuart2()
- if quart2() == 0 then
- mon.setTextColor(colors.red) mon.write("Vide")
- elseif quart2() >= 1 then
- mon.setTextColor(colors.orange) mon.write(quart2().. "/4 ")
- elseif quart2() >= 2 then
- mon.setTextColor(colors.orange) mon.write(quart2().. "/4 ")
- elseif quart2() >= 3 then
- mon.setTextColor(colors.yellow) mon.write(quart().. "/4 ")
- elseif quart2() == 4 then
- mon.setTextColor(colors.green) mon.write("Plein") end
- end
- function fonction()
- if reactor.getActive() == false then mon.setTextColor(colors.red)
- mon.write("Arrêt") mon.setTextColor(colors.white) mon.write(" ")
- else mon.setTextColor(colors.green)
- mon.write("Marche") end
- end
- --DåA9but conditions
- while true do
- --Condition du råA9acteur:
- if getEnergyPercent1() > 95 then reactor.setActive(false)
- elseif getEnergyPercent1() < 10 then reactor.setActive(true) end
- --Fin condition du RåA9acteur
- --DåA9but affichage EnergyCell RåA9acteur:
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("EnergyCell RåA9acteur:")
- mon.setTextColor(colors.green)
- mon.write(getEnergyPercent1())
- mon.setCursorPos(25,2)
- mon.setTextColor(colors.white)
- mon.write("% RF")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("Etat:")
- mon.write(affQuart1())
- --Fin affichage EnergyCell RåA9acteur
- --DåA9but affichage EnergyCell Base:
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("EnergyCell Base:")
- mon.setTextColor(colors.green)
- mon.write(getEnergyPercent2())
- mon.setCursorPos(21,4)
- mon.setTextColor(colors.white)
- mon.write("% RF")
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.white)
- mon.write("Etat:")
- mon.write(affQuart2())
- --Fin affichage EnergyCell Base
- --Partie RåA9acteur:
- mon.setCursorPos(22,7)
- mon.setTextColor(colors.red)
- mon.write("RåA9acteur:")
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.white)
- mon.write("ActivitåA9:")
- mon.write(fonction())
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.white)
- mon.write("Production:")
- mon.setTextColor(colors.green)
- mon.write(math.floor(reactor.getEnergyProducedLastTick()))
- mon.setCursorPos(16,9)
- mon.setTextColor(colors.white)
- mon.write("RF/t:")
- mon.setCursorPos(1,10)
- mon.setTextColor(colors.white)
- mon.write("TempåA9rature RåA9acteur:")
- mon.setTextColor(colors.green)
- mon.write(math.floor(reactor.getCasingTemperature()))
- mon.setCursorPos(27,10)
- mon.setTextColor(colors.white)
- mon.write("C")
- mon.setCursorPos(1,11)
- mon.setTextColor(colors.white)
- mon.write("TempåA9rature Fuel:")
- mon.setTextColor(colors.green)
- mon.write(math.floor(reactor.getFuelTemperature()))
- mon.setCursorPos(23,11)
- mon.setTextColor(colors.white)
- mon.write("C")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement