Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables:
- mon = peripheral.wrap("monitor_100")
- reactor = peripheral.wrap("back")
- enCell1 = peripheral.wrap("right")
- enCell2 = peripheral.wrap("cofh_thermalexpansion_energycell_2")
- 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 etat1()
- if getEnergyPercent1() == 0 then mon.setTextColor(colors.red)
- mon.write("Vide") mon.setTextColor(colors.white) mon.write(" ") end
- if getEnergyPercent1() > 0 and getEnergyPercent1() <= 25 then mon.setTextColor(colors.orange)
- mon.write("1/4") mon.setTextColor(colors.white) mon.write(" ") end
- if getEnergyPercent1() > 25 and getEnergyPercent1() <= 50 then mon.setTextColor(colors.orange)
- mon.write("2/4") mon.setTextColor(colors.white) mon.write(" ") end
- if getEnergyPercent1() > 50 and getEnergyPercent1() <= 94 then mon.setTextColor(colors.yellow)
- mon.write("3/4") mon.setTextColor(colors.white) mon.write(" ") end
- if getEnergyPercent1() >= 95 then mon.setTextColor(colors.green)
- mon.write("Plein") mon.setTextColor(colors.white) mon.write(" ") end
- end
- function etat2()
- if getEnergyPercent2() == 0 then mon.setTextColor(colors.red)
- mon.write("Vide") mon.setTextColor(colors.white) mon.write(" ") end
- if getEnergyPercent2() > 0 and getEnergyPercent2() <= 25 then mon.setTextColor(colors.orange)
- mon.write("1/4") mon.setTextColor(colors.white) mon.write(" ") end
- if getEnergyPercent2() > 25 and getEnergyPercent2() <= 50 then mon.setTextColor(colors.orange)
- mon.write("2/4") mon.setTextColor(colors.white) mon.write(" ")end
- if getEnergyPercent2() > 50 and getEnergyPercent2() <= 94 then mon.setTextColor(colors.yellow)
- mon.write("3/4") mon.setTextColor(colors.white) mon.write(" ")end
- if getEnergyPercent2() >= 95 then mon.setTextColor(colors.green)
- mon.write("Plein") mon.setTextColor(colors.white) mon.write(" ") 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åA5A5A9but conditions
- while true do
- --Condition du råA5A5A9acteur:
- if getEnergyPercent1() > 95 then reactor.setActive(false)
- elseif getEnergyPercent1() < 10 then reactor.setActive(true) end
- --Fin condition du RåA5A5A9acteur
- --DåA5A5A5A9but affichage EnergyCell RåA5A5A5A9acteur:
- 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(etat1())
- --Fin affichage EnergyCell RåA5A9acteur
- --DåA5A9but 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(etat2())
- --Fin affichage EnergyCell Base
- --Partie RåA5A9acteur:
- 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(1,11)
- mon.setTextColor(colors.white)
- mon.write("TempåA9rature Fuel:")
- mon.setTextColor(colors.green)
- mon.write(math.floor(reactor.getFuelTemperature()))
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement