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, t1 = s.get(1)
- u, f, d, t2 = s.get(2)
- current_power = t2.average
- neutron_flux = math.floor((current_power/flux)*100)
- thermal_power = math.floor((current_power/max_flux)*100)
- if thermal_power == 0 then
- thermal_power = 1.25
- end
- loop1_flow = math.random(18100, 18250)/10
- condenser_flow = math.random(18100, 18250)/10
- sea_in_temp = 13.3
- sea_out_temp = math.floor(13.40 + (current_power/1000))
- voltage = math.floor(385-(current_power/1000))
- if t1.reactorPoweredB == true then
- loop1_in = math.random(2982, 3002)/10
- loop1_out = math.random(3352, 3367)/10
- steam_generator = math.random(3331, 3363)/10
- condenser = math.random(569, 577)/10
- turbine = math.random(2436, 2477)/10
- turbine_speed = 3000
- frequency = 50.0
- condenser_vacuum = math.random(85, 91)
- else
- loop1_in = math.random(1982, 1992)/10
- loop1_out = math.random(1352, 1367)/10
- steam_generator = math.random(931, 963)/10
- condenser = math.random(369, 377)/10
- turbine = math.random(336, 2477)/10
- turbine_speed = 0
- condenser_vacuum = 0
- voltage = 0
- frequency = 0
- end
- cosphi = math.random(89,92)/100
- current = math.floor(current_power/voltage)
- clear()
- ---------------------------------------------------
- print(" Reactor system \"OK-300\"\n")
- print("Neutron Flux: "..neutron_flux .. " % ")
- print("Thermal Power: "..thermal_power .. " % ")
- print("Electric Power: "..current_power .. " kW")
- print("Turbine speed: "..turbine_speed .. " rpm")
- print("")
- print("Loop 1 Flow: "..loop1_flow)
- print("Loop 1 Input: "..loop1_in .. " 'C")
- print("Loop 1 Output: "..loop1_out.. " 'C")
- print("")
- print("Sea input: "..sea_in_temp .. " 'C")
- term.setCursorPos(27, 3)
- term.write("Voltage: "..voltage.." V")
- term.setCursorPos(27, 4)
- term.write("Current: "..current.." kA")
- term.setCursorPos(27, 5)
- term.write("Frequency: "..frequency.." Hz")
- term.setCursorPos(27, 6)
- term.write("Cos.phi: "..cosphi)
- term.setCursorPos(27, 8)
- term.write("Steam generator: " ..steam_generator .. " 'C")
- term.setCursorPos(27, 9)
- term.write("Condenser: " ..condenser .. " 'C")
- term.setCursorPos(27, 10)
- term.write("Condenser vac.: " .. condenser_vacuum .. " mmHg")
- term.setCursorPos(27, 12)
- term.write("Sea output: " .. sea_out_temp .. " 'C")
- if voltage == 0 then
- term.setCursorPos(1, 19)
- term.setBackgroundColour(colors.red)
- term.write(" REACTOR SCRAM !!! REACTOR SCRAM ")
- term.setBackgroundColor(colors.black)
- end
- sleep(1)
- end
Add Comment
Please, Sign In to add comment