Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m = peripheral.wrap("monitor_0")
- local r = peripheral.wrap("back")
- local epp
- local estored
- local eproz
- local heatcasing
- local heatcore
- local fuel
- local fproz
- local waste
- local wproz
- local ractive
- fg("ControlRodAnpassung")
- function check()
- ractive = r.getActive()
- estored = r.getEnergyStored()
- epp = r.getEnergyProducedLastTick()
- heatcasing = r.getCasingTemperature()
- heatcore = r.getFuelTemperature()
- fuel = r.getFuelAmount()
- waste = r.getWasteAmount()
- end
- function rechnen()
- eproz = (estored / 10000000) * 100
- eps = math.ceil(eproz * 0.5)
- fproz = (fuel / 1152000) * 100
- fps = math.ceil(fproz * 0.5)
- wproz = (waste / 1152000) * 100
- wps = math.ceil(wproz * 0.5)
- end
- function display()
- m.setTextScale(1)
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setCursorPos(23,2)
- m.write("Reaktor Monitor")
- m.setCursorPos(7,4)
- m.write("Fuel Temperature: "..math.floor(heatcore + 0.5).."¥B0C")
- m.setCursorPos(43,4)
- if ractive == true then
- m.setTextColor(colors.green)
- m.write("Aktiviert")
- else
- m.setTextColor(colors.red)
- m.write("Deaktiviert")
- end
- m.setTextColor(colors.white)
- m.setCursorPos(7,6)
- m.write("Casing Temperature: "..math.floor(heatcasing + 0.5).."¥B0C")
- m.setCursorPos(43,6)
- m.write("Producing: "..math.floor(epp + 0.5).."RF/T")
- m.setCursorPos(7,10)
- m.write("Energy Stored")
- m.setCursorPos(52,12.5)
- m.write(math.floor(estored + 0.5).."RF")
- m.setCursorPos(7,19)
- m.write("Fuel/Waste")
- m.setCursorPos(52,15.5)
- m.write(math.floor(eproz + 0.5).."%")
- m.setCursorPos(52,21.5)
- m.write(math.floor(fproz + 0,5).."%")
- m.setCursorPos(52,24.5)
- m.write(math.floor(wproz + 0,5).."%")
- box(0,11,50,16,colors.red)
- box(0,11,eps,16,colors.green) --Gespeicherte Energie Graph
- box(0,20,50,25,colors.red)
- box(0,20,fps,22,colors.green) --Fuel
- box(0,23,wps,25,colors.blue) --Waste
- end
- function box(xa,ya,xe,ye,col)
- m.setTextScale(1)
- m.setBackgroundColor(col)
- for y = ya, ye do
- for x = xa, xe do
- m.setCursorPos(x,y)
- m.write(" ")
- end
- end
- end
- --shell.run("bg ReaktorAnzeigeGraphen")
- while true do
- check()
- rechnen()
- display()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement