Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateInfo()
- --Reactor Info = RI
- RI = peripheral.wrap("back")
- Info = RI.getReactorInfo()
- --Energysaturation
- ES = math.floor(tonumber(Info.energySaturation)/100000+0.5)/100
- --FuelConversionRate
- FCR = math.floor(tonumber(Info.fuelConversionRate)+0.5)
- --Temperature
- Temp = math.floor(tonumber(Info.temperature)+0.5)
- --Status
- Stat = Info.status
- --Fuel%
- FuelPerc = math.floor((tonumber(Info.fuelConversion)/tonumber(Info.maxFuelConversion)*10000)+0.5)/100
- --RF/T
- RFout = Info.generationRate
- --Shield Strength
- sS = math.floor(tonumber(Info.fieldStrength)/10000+0.5)/100-0.1
- --tBar = Temperatur Bar
- tBar = math.floor(tonumber(Temp)/8000*100/3.25+0.5)
- --sSBar = Shield Stregth Bar
- sSBar = tonumber(sS)*0.38
- --ESBar = Energy Saturation Bar
- ESBar = tonumber(ES)*0.38
- --Fuel Conversion Bar
- FCBar = tonumber(FuelPerc)*0.38
- --function end
- end
- --Screen
- while true do
- updateInfo()
- sleep(1)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- --Status
- if Stat == "online" then
- term.setCursorPos(34,1)
- term.setTextColor(colors.green)
- print("Online")
- else
- term.setCursorPos(33,1)
- term.setTextColor(colors.red)
- print("Offline")
- end
- --Temperature
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Temperatur: ",Temp," C")
- paintutils.drawLine(2,2,38,2,colors.gray)
- --Color of Temperatur Bar
- if tonumber(Temp) < 2000 then
- paintutils.drawLine(2,2,tonumber(tBar),2,colors.blue)
- elseif tonumber(Temp) > 2000 and tonumber(Temp) <= 4000 then
- paintutils.drawLine(2,2,tonumber(tBar),2,colors.yellow)
- elseif tonumber(Temp) > 4000 and tonumber(Temp) <= 6000 then
- paintutils.drawLine(2,2,tonumber(tBar),2,colors.orange)
- elseif tonumber(Temp) > 6000 and tonumber(Temp) <= 8000 then
- paintutils.drawLine(2,2,tonumber(tBar),2,colors.green)
- else
- paintutils.drawLine(2,2,tonumber(tBar),2,colors.red)
- end
- --Shield Strength
- term.setCursorPos(1,4)
- term.setBackgroundColor(colors.black)
- print("Shield Strength: ",sS,"%")
- paintutils.drawLine(2,5,38,5,colors.gray)
- --Color of Shield Strength Bar
- if tonumber(sS) >= 0 and tonumber(sS) < 20 then
- paintutils.drawLine(2,5,sSBar,5,colors.red)
- elseif tonumber(sS) >= 20 and tonumber(sS) < 40 then
- paintutils.drawLine(2,5,sSBar,5,colors.orange)
- elseif tonumber(sS) >= 40 and tonumber(sS) < 60 then
- paintutils.drawLine(2,5,sSBar,5,colors.green)
- elseif tonumber(sS) >= 60 and tonumber(sS) < 80 then
- paintutils.drawLine(2,5,sSBar,5,colors.lightBlue)
- else
- paintutils.drawLine(2,5,sSBar,5,colors.blue)
- end
- --Energy Saturation
- term.setCursorPos(1,7)
- term.setBackgroundColor(colors.black)
- print("Energy Saturation: ",ES,"%")
- paintutils.drawLine(2,8,38,8,colors.gray)
- --Energy Saturation Bar
- if tonumber(ES) >= 0 and tonumber(ES) < 10 then
- paintutils.drawLine(2,8,ESBar,8,colors.red)
- elseif tonumber(ES) >= 10 and tonumber(ES) < 25 then
- paintutils.drawLine(2,8,ESBar,8,colors.green)
- elseif tonumber(ES) >= 25 and tonumber(ES) < 50 then
- paintutils.drawLine(2,8,ESBar,8,colors.lime)
- elseif tonumber(ES) >= 50 and tonumber(ES) < 75 then
- paintutils.drawLine(2,8,ESBar,8,colors.lightBlue)
- else
- paintutils.drawLine(2,8,ESBar,8,colors.blue)
- end
- --Fuel Conversion
- term.setCursorPos(1,10)
- term.setBackgroundColor(colors.black)
- print("Fuel Conversion Level: ",FuelPerc,"%")
- paintutils.drawLine(2,11,38,11,colors.gray)
- --Fuel Conversion Bar
- if tonumber(FuelPerc) >= 0 and tonumber(FuelPerc) < 20 then
- paintutils.drawLine(2,11,FCBar,11,colors.lightBlue)
- elseif tonumber(FuelPerc) >= 20 and tonumber(FuelPerc) < 40 then
- paintutils.drawLine(2,11,FCBar,11,colors.lime)
- elseif tonumber(FuelPerc) >= 40 and tonumber(FuelPerc) < 60 then
- paintutils.drawLine(2,11,FCBar,11,colors.green)
- elseif tonumber(FuelPerc) >= 60 and tonumber(FuelPerc) < 80 then
- paintutils.drawLine(2,11,FCBar,11,colors.orange)
- else
- paintutils.drawLine(2,11,FCBar,11,colors.red)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement