Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------//Initilisation
- local monitor = peripheral.wrap("right")
- monitor.setTextScale(1)
- term.redirect(monitor)
- local ptc = "reactorNetwork"
- local hostname = "rcScreen"
- rednet.open("top")
- rednet.host(ptc, hostname)
- local info = {}
- local color = {}
- local res
- print("Connection ...")
- -------------------------------------------------//getInfo()
- function getInfo()
- res, info = rednet.receive(ptc, 10)
- end
- -------------------------------------------------//serialize()
- function serialize()
- fuelAPerc = ((info.fuelAmount/100000)*47)
- wasteAPerc = ((info.wasteAmount/100000)*47)
- fuelTPerc = ((info.fuelTemp/2500)*47)
- caseTPerc = ((info.caseTemp/2500)*47)
- end
- -------------------------------------------------//affichage()
- function affichage()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(21, 2)
- term.write("REACTEUR")
- term.setCursorPos(21, 4)
- term.write((info.rcActive and "POWER ON" or "POWER OFF"))
- paintutils.drawFilledBox(1, 6, 50, 33, colors.lightGray)
- term.setCursorPos(2, 7)
- term.write("Fuel Amount : "..(math.floor(info.fuelAmount/100)/10))
- term.setCursorPos(2, 14)
- term.write("Waste Amount : "..(math.floor(info.wasteAmount/100)/10))
- term.setCursorPos(2, 21)
- term.write("Fuel Temperature : "..math.floor(info.fuelTemp))
- term.setCursorPos(2, 28)
- term.write("Casing Temperature : "..math.floor(info.caseTemp))
- paintutils.drawFilledBox(2, 9, 2 + fuelAPerc, 11, colors.yellow)
- paintutils.drawFilledBox(2, 16, 2 + wasteAPerc, 18, colors.yellow)
- paintutils.drawFilledBox(2, 23, 2 + fuelTPerc, 25, colors.yellow)
- paintutils.drawFilledBox(2, 30, 2 + caseTPerc, 32, colors.yellow)
- end
- while(true)do
- getInfo()
- serialize()
- affichage()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement