View difference between Paste ID: g4s2MRnT and XMyAEq0d
SHOW: | | - or go back to the newest paste.
1
s = peripheral.wrap("bottom")
2
3
max_power = 2400
4
max_flux = 2250
5
max_thermal = 2320
6
7
8
function clear()
9
    term.clear()
10
    term.setCursorPos(1,1)
11
end
12
13
while true do
14-
    u, f, d, t1 = s.get(1)
14+
    u, f, d, b1 = s.get(1)
15-
    u, f, d, t2 = s.get(2)
15+
    u, f, d, b2 = s.get(2)
16
	u, f, d, b3 = s.get(3)
17-
    current_power = t2.average
17+
	u, f, d, besm = s.get(4)
18-
    neutron_flux = math.floor((current_power/flux)*100)
18+
	u, f, d, p = s.get(5)
19-
    thermal_power = math.floor((current_power/max_flux)*100)
19+
20-
    
20+
	kW = p["average"]
21-
    if thermal_power == 0 then
21+
	
22-
        thermal_power = 1.25
22+
	batmaxp_1 = b1["maxStorageL"]
23-
    end
23+
	batmaxp_2 = b2["maxStorageL"]
24
	batmaxp_3 = b3["maxStorageL"]
25-
    loop1_flow = math.random(18100, 18250)/10
25+
	batmaxp_ESM = besm["maxStorageL"]
26-
    condenser_flow = math.random(18100, 18250)/10
26+
27
	batcurlev_1 = b1["energyL"]
28-
    sea_in_temp = 13.3
28+
	batcurlev_2 = b2["energyL"]
29-
    sea_out_temp = math.floor(13.40 + (current_power/1000))
29+
	batcurlev_3 = b3["energyL"]
30
	batcurlev_ESM = besm["energyL"]
31-
    voltage = math.floor(385-(current_power/1000))
31+
32
	batv_1 = math.floor(201.6+((268.8 - 201.6)/batmaxp_1)*batcurlev_1)
33-
    if t1.reactorPoweredB == true then
33+
	batv_2 = math.floor(201.6+((268.8 - 201.6)/batmaxp_2)*batcurlev_2)
34-
        loop1_in = math.random(2982, 3002)/10
34+
	batv_3 = math.floor(201.6+((268.8 - 201.6)/batmaxp_3)*batcurlev_3)
35-
        loop1_out = math.random(3352, 3367)/10
35+
	batv_ESM = math.floor(21+((28.8 - 21)/batmaxp_ESM)*batcurlev_ESM)
36-
        steam_generator = math.random(3331, 3363)/10
36+
37-
        condenser = math.random(569, 577)/10
37+
38-
        turbine = math.random(2436, 2477)/10
38+
39-
        turbine_speed = 3000
39+
    print("      Selex ES - Monitoraggio Alimentazione\n")
40-
        frequency = 50.0
40+
    print("Banco 1:   "..batv_1.. " V ")
41-
        condenser_vacuum = math.random(85, 91)
41+
    print("Banco 2:   "..batv_2.. " V ")
42-
    else 
42+
    print("Banco 3:   "..batv_3.. " V")
43-
        loop1_in = math.random(1982, 1992)/10
43+
    print("Banco ESM: "..batv_ESM.. " V")
44-
        loop1_out = math.random(1352, 1367)/10
44+
45-
        steam_generator = math.random(931, 963)/10
45+
    print("Diesel dritta:      0 kW")
46-
        condenser = math.random(369, 377)/10
46+
    print("Diesel sinistra:    0 kW")
47-
        turbine = math.random(336, 2477)/10
47+
    print("Cella combustibile: "..kW.. " kW")
48-
        turbine_speed = 0
48+
49-
        condenser_vacuum = 0
49+
    if batv_1 < 210 or batv_2 < 210 or batv_3 < 210 or batv_ESM < 23 then
50-
        voltage = 0
50+
51-
        frequency = 0
51+
        term.setBackgroundColour(colors.white)
52-
    end
52+
		term.setTextColor(colors.black)
53
        term.write("  UNA O PIU' BATTERIE SONO TROPPO SCARICHE   ")
54-
    cosphi = math.random(89,92)/100
54+
55-
    
55+
		term.setTextColor(colors.white)
56-
    current = math.floor(current_power/voltage)
56+
57
sleep(1)
58
end
59
60-
    print("            Reactor system \"OK-300\"\n")
60+