Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = peripheral.wrap("bottom")
- max_power = 2400
- max_flux = 2250
- max_thermal = 2320
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- while true do
- u, f, d, b1 = s.get(1)
- u, f, d, b2 = s.get(2)
- u, f, d, b3 = s.get(3)
- u, f, d, besm = s.get(4)
- u, f, d, p = s.get(5)
- kW = p["average"]
- batmaxp_1 = b1["maxStorageL"]
- batmaxp_2 = b2["maxStorageL"]
- batmaxp_3 = b3["maxStorageL"]
- batmaxp_ESM = besm["maxStorageL"]
- batcurlev_1 = b1["energyL"]
- batcurlev_2 = b2["energyL"]
- batcurlev_3 = b3["energyL"]
- batcurlev_ESM = besm["energyL"]
- batv_1 = math.floor(201.6+((268.8 - 201.6)/batmaxp_1)*batcurlev_1)
- batv_2 = math.floor(201.6+((268.8 - 201.6)/batmaxp_2)*batcurlev_2)
- batv_3 = math.floor(201.6+((268.8 - 201.6)/batmaxp_3)*batcurlev_3)
- batv_ESM = math.floor(21+((28.8 - 21)/batmaxp_ESM)*batcurlev_ESM)
- clear()
- ---------------------------------------------------
- print(" Selex ES - Monitoraggio Alimentazione\n")
- print("Banco 1: "..batv_1.. " V ")
- print("Banco 2: "..batv_2.. " V ")
- print("Banco 3: "..batv_3.. " V")
- print("Banco ESM: "..batv_ESM.. " V")
- print("")
- print("Diesel dritta: 0 kW")
- print("Diesel sinistra: 0 kW")
- print("Cella combustibile: "..kW.. " kW")
- if batv_1 < 210 or batv_2 < 210 or batv_3 < 210 or batv_ESM < 23 then
- term.setCursorPos(1, 19)
- term.setBackgroundColour(colors.white)
- term.setTextColor(colors.black)
- term.write(" UNA O PIU' BATTERIE SONO TROPPO SCARICHE ")
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- end
- sleep(1)
- end
Add Comment
Please, Sign In to add comment