Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Hardware Variables---------------------------------------
- local cm1 = peripheral.wrap("monitor_25")
- local rm1 = peripheral.wrap("monitor_58")
- local rm2 = peripheral.wrap("monitor_59")
- local rm3 = peripheral.wrap("monitor_60")
- local tm1 = peripheral.wrap("monitor_3")
- local tm2 = peripheral.wrap("monitor_23")
- local tm3 = peripheral.wrap("monitor_22")
- local r1 = peripheral.wrap("BigReactors-Reactor_2")
- local t1 = peripheral.wrap("BigReactors-Turbine_13")
- local t2 = peripheral.wrap("BigReactors-Turbine_14")
- local t3 = peripheral.wrap("BigReactors-Turbine_15")
- --Button Toggle variables-----------------------------------
- local r1auto = true
- local t1auto = true
- local t2auto = true
- local t3auto = true
- --Control Button Toggle ------------------------------------
- function btn(y,state)
- if state == "on" then
- cm1.setCursorPos(18,y)
- cm1.setBackgroundColor(colors.green)
- cm1.write(" ON ")
- cm1.setCursorPos(25,y)
- cm1.setBackgroundColor(colors.gray)
- cm1.write(" OFF ")
- cm1.setBackgroundColor(colors.black)
- if y == 1 then
- r1auto = true
- elseif y == 2 then
- t1auto = true
- elseif y == 3 then
- t2auto = true
- elseif y == 4 then
- t3auto = true
- end
- elseif state == "off" then
- cm1.setCursorPos(18,y)
- cm1.setBackgroundColor(colors.gray)
- cm1.write(" ON ")
- cm1.setCursorPos(25,y)
- cm1.setBackgroundColor(colors.red)
- cm1.write(" OFF ")
- cm1.setBackgroundColor(colors.black)
- if y == 1 then
- r1auto = false
- elseif y == 2 then
- t1auto = false
- elseif y == 3 then
- t2auto = false
- elseif y == 4 then
- t3auto = false
- end
- end
- end
- --Start Program--------------------------------------------------
- print("Running ReactorOS..")
- --Control panel initialize----------------------------------------
- cm1.setBackgroundColor(colors.black)
- cm1.clear()
- --Reactor
- cm1.setCursorPos(1,1)
- cm1.write("Reactor")
- btn(1,"on")
- r1.setActive(true)
- r1.setAllControlRodLevels(100)
- --Turbine 1
- cm1.setCursorPos(1,2)
- cm1.write("Turbine 1")
- btn(2,"on")
- t1.setActive(true)
- --Turbine 2
- cm1.setCursorPos(1,3)
- cm1.write("Turbine 2")
- btn(3,"on")
- t2.setActive(true)
- --Turbine 3
- cm1.setCursorPos(1,4)
- cm1.write("Turbine 3")
- btn(4,"on")
- t3.setActive(true)
- --Blast door
- cm1.setCursorPos(1,5)
- cm1.write("Blast Door")
- btn(5,"off")
- redstone.setOutput("top",false)
- --Program Loop----------------------------------------------------
- while true do
- --Reactor monitor 1 status display------------------------------------------------
- rm1.setBackgroundColor(colors.black)
- rm1.setTextColor(colors.white)
- rm1.clear()
- rm1.setTextColor(colors.white)
- rm1.setCursorPos(1,1)
- rm1.write("Reactor Core")
- --Status----
- rm1.setCursorPos(15,1)
- rm1.write("Status:")
- rm1.setCursorPos(23,1)
- if r1.getActive() == true then
- rm1.setTextColor(colors.green)
- rm1.write("ONLINE")
- else
- rm1.setTextColor(colors.red)
- rm1.write("OFFLINE")
- end
- --Reactor monitor 2 temp/rod/fuel rate display------------------------------------------------
- --Temp------------------------------------------
- local temp = math.floor(r1.getFuelTemperature())
- rm2.setBackgroundColor(colors.black)
- rm2.setTextColor(colors.white)
- rm2.clear()
- rm2.setCursorPos(1,1)
- rm2.write("Reactor Control")
- rm2.setTextColor(colors.white)
- rm2.setCursorPos(1,3)
- rm2.write("Temp:")
- --color coding
- if temp >= 2000 then
- rm2.setTextColor(colors.red)
- elseif temp >= 1500 then
- rm2.setTextColor(colors.orange)
- elseif temp >= 1000 then
- rm2.setTextColor(colors.yellow)
- elseif (temp < 1000) and (temp >= 500) then
- rm2.setTextColor(colors.green)
- elseif temp < 500 then
- rm2.setTextColor(colors.cyan)
- end
- --adjust cursor
- if temp >= 1000 then
- rm2.setCursorPos(19,3)
- elseif (temp < 1000) and (temp >= 100) then
- rm2.setCursorPos(20,3)
- elseif (temp < 100) and (temp >= 10) then
- rm2.setCursorPos(21,3)
- elseif temp < 10 then
- rm2.setCursorPos(22,3)
- end
- rm2.write(temp)
- rm2.setTextColor(colors.white)
- rm2.setCursorPos(25,3)
- rm2.write(" C")
- --Rods-------------------------------
- local rods = r1.getControlRodLevel(0)
- rm2.setTextColor(colors.white)
- rm2.setCursorPos(1,4)
- rm2.write("Output:")
- --adjust cursor
- if (100 - rods) >= 10 then
- rm2.setCursorPos(23,4)
- elseif (100 - rods) < 10 then
- rm2.setCursorPos(24,4)
- end
- rm2.setTextColor(colors.white)
- rm2.write(100 - rods)
- rm2.setCursorPos(25,4)
- rm2.write(" %")
- --Fuel Rate------------------------------------
- local r1fuelrate = r1.getFuelConsumedLastTick()
- rm2.setTextColor(colors.white)
- rm2.setCursorPos(1,5)
- rm2.write("Fuel Rate:")
- if r1fuelrate > 0 then
- rm2.setCursorPos(19,5)
- else
- rm2.setCursorPos(22,5)
- end
- rm2.write(r1fuelrate)
- rm2.setCursorPos(25,5)
- rm2.write(" MB/T")
- --Reactor monitor 3 water/steam/steam rate display------------------------------------------------------
- rm3.setBackgroundColor(colors.black)
- rm3.setTextColor(colors.white)
- rm3.clear()
- rm3.setCursorPos(1,1)
- rm3.write("Reactor Coolant")
- --Coolant amount----------------------------
- local r1waterlvl = r1.getCoolantAmount()
- local r1waterper = math.floor((r1waterlvl / 21800) * 100)
- rm3.setTextColor(colors.white)
- rm3.setCursorPos(1,3)
- rm3.write("Coolant:")
- --adjust cursor
- if r1waterper >= 10 then
- rm3.setCursorPos(23,3)
- elseif r1waterper < 10 then
- rm3.setCursorPos(24,3)
- end
- rm3.setTextColor(colors.white)
- rm3.write(r1waterper)
- rm3.setCursorPos(25,3)
- rm3.write(" %")
- --Steam amount------------------------------
- local r1steamlvl = r1.getHotFluidAmount()
- local r1steamper = math.floor((r1steamlvl / 21800) * 100)
- rm3.setTextColor(colors.white)
- rm3.setCursorPos(1,4)
- rm3.write("Steam:")
- --adjust cursor
- if r1steamper >= 10 then
- rm3.setCursorPos(23,4)
- elseif r1steamper < 10 then
- rm3.setCursorPos(24,4)
- end
- rm3.setTextColor(colors.white)
- rm3.write(r1steamper)
- rm3.setCursorPos(25,4)
- rm3.write(" %")
- --Steam Gen---------------------------------
- local r1steam = math.floor(r1.getHotFluidProducedLastTick())
- rm3.setTextColor(colors.white)
- rm3.setCursorPos(1,5)
- rm3.write("Steam Gen:")
- --adjust cursor----
- if r1steam >= 1000 then
- rm3.setCursorPos(19,5)
- elseif (r1steam < 1000) and (r1steam >= 100) then
- rm3.setCursorPos(20,5)
- elseif (r1steam < 100) and (r1steam >= 10) then
- rm3.setCursorPos(21,5)
- elseif r1steam < 10 then
- rm3.setCursorPos(22,5)
- end
- rm3.setTextColor(colors.white)
- rm3.write(r1steam)
- rm3.setCursorPos(25,5)
- rm3.write(" MB/T")
- --Turbine 1 display----------------------------------------------------
- tm1.clear()
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(1,1)
- tm1.write("Turbine 1")
- --status----
- tm1.setCursorPos(14,1)
- tm1.write("Status:")
- tm1.setCursorPos(22,1)
- if t1.getActive() == true then
- tm1.setTextColor(colors.green)
- tm1.write("ONLINE")
- else
- tm1.setTextColor(colors.red)
- tm1.write("OFFLINE")
- end
- --coils----
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(15,3)
- tm1.write("Coils:")
- tm1.setCursorPos(22,3)
- if t1.getInductorEngaged() == true then
- tm1.setTextColor(colors.green)
- tm1.write("ACTIVE")
- else
- tm1.setTextColor(colors.red)
- tm1.write("INACTIVE")
- end
- --Percent capacitor filled----
- local t1per = math.floor((t1.getEnergyStored() / 1000000) * 100)
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(1,5)
- tm1.write("Power:")
- --color coding
- if t1per >= 75 then
- tm1.setTextColor(colors.green)
- elseif (t1per < 75) and (t1per >= 50) then
- tm1.setTextColor(colors.yellow)
- elseif (t1per <50) and (t1per >= 25) then
- tm1.setTextColor(colors.orange)
- elseif t1per < 25 then
- tm1.setTextColor(colors.red)
- end
- --adjust cursor
- if t1per >= 100 then
- tm1.setCursorPos(20,5)
- elseif (t1per < 100) and (t1per >= 10) then
- tm1.setCursorPos(21,5)
- elseif t1per < 10 then
- tm1.setCursorPos(22,5)
- end
- tm1.write(t1per)
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(25,5)
- tm1.write(" %")
- --Power output----
- local t1powertick = t1.getEnergyProducedLastTick()
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(1,7)
- tm1.write("Rate:")
- if t1powertick >= 10000 then
- tm1.setCursorPos(18,7)
- elseif (t1powertick < 10000) and (t1powertick >= 1000) then
- tm1.setCursorPos(19,7)
- elseif (t1powertick < 1000) and (t1powertick >= 100) then
- tm1.setCursorPos(20,7)
- elseif (t1powertick < 100) and (t1powertick >= 10) then
- tm1.setCursorPos(21,7)
- elseif t1powertick < 10 then
- tm1.setCursorPos(22,7)
- end
- tm1.write(t1powertick)
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(25,7)
- tm1.write(" RF/T")
- --RPM----
- local t1rpm = math.floor(t1.getRotorSpeed())
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(1,9)
- tm1.write("RPM:")
- --color coding
- if t1rpm >= 2000 then
- tm1.setTextColor(colors.red)
- elseif (t1rpm < 2000) and (t1rpm >= 1900) then
- tm1.setTextColor(colors.orange)
- elseif (t1rpm < 1900) and (t1rpm > 1825) then
- tm1.setTextColor(colors.yellow)
- elseif (t1rpm <= 1825) and (t1rpm >= 1775) then
- tm1.setTextColor(colors.green)
- elseif (t1rpm < 1775) and (t1rpm > 925) then
- tm1.setTextColor(colors.cyan)
- elseif (t1rpm <= 925) and (t1rpm >= 875) then
- tm1.setTextColor(colors.green)
- elseif (t1rpm < 875) and (t1rpm >= 500) then
- tm1.setTextColor(colors.cyan)
- elseif t1rpm < 500 then
- tm1.setTextColor(colors.white)
- end
- --adjust cursor
- if t1rpm >= 1000 then
- tm1.setCursorPos(19,9)
- elseif (t1rpm < 1000) and (t1rpm >= 100) then
- tm1.setCursorPos(20,9)
- elseif (t1rpm < 100) and (t1rpm >= 10) then
- tm1.setCursorPos(21,9)
- elseif t1rpm < 10 then
- tm1.setCursorPos(22,9)
- end
- tm1.write(t1rpm)
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(25,9)
- tm1.write(" RPM ")
- --Steam flow----
- local t1steam = t1.getFluidFlowRateMax()
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(1,11)
- tm1.write("Steam Flow:")
- --adjust cursor
- if t1.getActive() == true then
- tm1.setCursorPos(19,11)
- tm1.write(t1steam)
- else
- tm1.setCursorPos(22,11)
- tm1.write("0.0")
- end
- tm1.setTextColor(colors.white)
- tm1.setCursorPos(25,11)
- tm1.write(" MB/T")
- --Turbine 2 display----------------------------------------------------
- tm2.clear()
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(1,1)
- tm2.write("Turbine 2")
- --status----
- tm2.setCursorPos(14,1)
- tm2.write("Status:")
- tm2.setCursorPos(22,1)
- if t2.getActive() == true then
- tm2.setTextColor(colors.green)
- tm2.write("ONLINE")
- else
- tm2.setTextColor(colors.red)
- tm2.write("OFFLINE")
- end
- --coils----
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(15,3)
- tm2.write("Coils:")
- tm2.setCursorPos(22,3)
- if t2.getInductorEngaged() == true then
- tm2.setTextColor(colors.green)
- tm2.write("ACTIVE")
- else
- tm2.setTextColor(colors.red)
- tm2.write("INACTIVE")
- end
- --Percent capacitor filled----
- local t2per = math.floor((t2.getEnergyStored() / 1000000) * 100)
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(1,5)
- tm2.write("Power:")
- --color coding
- if t2per >= 75 then
- tm2.setTextColor(colors.green)
- elseif (t2per < 75) and (t2per >= 50) then
- tm2.setTextColor(colors.yellow)
- elseif (t2per <50) and (t2per >= 25) then
- tm2.setTextColor(colors.orange)
- elseif t2per < 25 then
- tm2.setTextColor(colors.red)
- end
- --adjust cursor
- if t2per >= 100 then
- tm2.setCursorPos(20,5)
- elseif (t2per < 100) and (t2per >= 10) then
- tm2.setCursorPos(21,5)
- elseif t2per < 10 then
- tm2.setCursorPos(22,5)
- end
- tm2.write(t2per)
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(25,5)
- tm2.write(" %")
- --Power output----
- local t2powertick = t2.getEnergyProducedLastTick()
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(1,7)
- tm2.write("Rate:")
- if t2powertick >= 10000 then
- tm2.setCursorPos(18,7)
- elseif (t2powertick < 10000) and (t2powertick >= 1000) then
- tm2.setCursorPos(19,7)
- elseif (t2powertick < 1000) and (t2powertick >= 100) then
- tm2.setCursorPos(20,7)
- elseif (t2powertick < 100) and (t2powertick >= 10) then
- tm2.setCursorPos(21,7)
- elseif t2powertick < 10 then
- tm2.setCursorPos(22,7)
- end
- tm2.write(t2powertick)
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(25,7)
- tm2.write(" RF/T")
- --RPM----
- local t2rpm = math.floor(t2.getRotorSpeed())
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(1,9)
- tm2.write("RPM:")
- --color coding
- if t2rpm >= 2000 then
- tm2.setTextColor(colors.red)
- elseif (t2rpm < 2000) and (t2rpm >= 1900) then
- tm2.setTextColor(colors.orange)
- elseif (t2rpm < 1900) and (t2rpm > 1825) then
- tm2.setTextColor(colors.yellow)
- elseif (t2rpm <= 1825) and (t2rpm >= 1775) then
- tm2.setTextColor(colors.green)
- elseif (t2rpm < 1775) and (t2rpm > 925) then
- tm2.setTextColor(colors.cyan)
- elseif (t2rpm <= 925) and (t2rpm >= 875) then
- tm2.setTextColor(colors.green)
- elseif (t2rpm < 875) and (t2rpm >= 500) then
- tm2.setTextColor(colors.cyan)
- elseif t2rpm < 500 then
- tm2.setTextColor(colors.white)
- end
- --adjust cursor
- if t2rpm >= 1000 then
- tm2.setCursorPos(19,9)
- elseif (t2rpm < 1000) and (t2rpm >= 100) then
- tm2.setCursorPos(20,9)
- elseif (t2rpm < 100) and (t2rpm >= 10) then
- tm2.setCursorPos(21,9)
- elseif t2rpm < 10 then
- tm2.setCursorPos(22,9)
- end
- tm2.write(t2rpm)
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(25,9)
- tm2.write(" RPM ")
- --Steam flow----
- local t2steam = t2.getFluidFlowRateMax()
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(1,11)
- tm2.write("Steam Flow:")
- --adjust cursor
- if t2.getActive() == true then
- tm2.setCursorPos(19,11)
- tm2.write(t2steam)
- else
- tm2.setCursorPos(22,11)
- tm2.write("0.0")
- end
- tm2.setTextColor(colors.white)
- tm2.setCursorPos(25,11)
- tm2.write(" MB/T")
- --Turbine 3 display----------------------------------------------------
- tm3.clear()
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(1,1)
- tm3.write("Turbine 3")
- --status----
- tm3.setCursorPos(14,1)
- tm3.write("Status:")
- tm3.setCursorPos(22,1)
- if t3.getActive() == true then
- tm3.setTextColor(colors.green)
- tm3.write("ONLINE")
- else
- tm3.setTextColor(colors.red)
- tm3.write("OFFLINE")
- end
- --coils----
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(15,3)
- tm3.write("Coils:")
- tm3.setCursorPos(22,3)
- if t3.getInductorEngaged() == true then
- tm3.setTextColor(colors.green)
- tm3.write("ACTIVE")
- else
- tm3.setTextColor(colors.red)
- tm3.write("INACTIVE")
- end
- --Percent capacitor filled----
- local t3per = math.floor((t3.getEnergyStored() / 1000000) * 100)
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(1,5)
- tm3.write("Power:")
- --color coding
- if t3per >= 75 then
- tm3.setTextColor(colors.green)
- elseif (t3per < 75) and (t3per >= 50) then
- tm3.setTextColor(colors.yellow)
- elseif (t3per <50) and (t3per >= 25) then
- tm3.setTextColor(colors.orange)
- elseif t3per < 25 then
- tm3.setTextColor(colors.red)
- end
- --adjust cursor
- if t3per >= 100 then
- tm3.setCursorPos(20,5)
- elseif (t3per < 100) and (t3per >= 10) then
- tm3.setCursorPos(21,5)
- elseif t3per < 10 then
- tm3.setCursorPos(22,5)
- end
- tm3.write(t3per)
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(25,5)
- tm3.write(" %")
- --Power output----
- local t3powertick = t3.getEnergyProducedLastTick()
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(1,7)
- tm3.write("Rate:")
- if t3powertick >= 10000 then
- tm3.setCursorPos(18,7)
- elseif (t3powertick < 10000) and (t3powertick >= 1000) then
- tm3.setCursorPos(19,7)
- elseif (t3powertick < 1000) and (t3powertick >= 100) then
- tm3.setCursorPos(20,7)
- elseif (t3powertick < 100) and (t3powertick >= 10) then
- tm3.setCursorPos(21,7)
- elseif t3powertick < 10 then
- tm3.setCursorPos(22,7)
- end
- tm3.write(t3powertick)
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(25,7)
- tm3.write(" RF/T")
- --RPM----
- local t3rpm = math.floor(t3.getRotorSpeed())
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(1,9)
- tm3.write("RPM:")
- --color coding
- if t3rpm >= 2000 then
- tm3.setTextColor(colors.red)
- elseif (t3rpm < 2000) and (t3rpm >= 1900) then
- tm3.setTextColor(colors.orange)
- elseif (t3rpm < 1900) and (t3rpm > 1825) then
- tm3.setTextColor(colors.yellow)
- elseif (t3rpm <= 1825) and (t3rpm >= 1775) then
- tm3.setTextColor(colors.green)
- elseif (t3rpm < 1775) and (t3rpm > 925) then
- tm3.setTextColor(colors.cyan)
- elseif (t3rpm <= 925) and (t3rpm >= 875) then
- tm3.setTextColor(colors.green)
- elseif (t3rpm < 875) and (t3rpm >= 500) then
- tm3.setTextColor(colors.cyan)
- elseif t3rpm < 500 then
- tm3.setTextColor(colors.white)
- end
- --adjust cursor
- if t3rpm >= 1000 then
- tm3.setCursorPos(19,9)
- elseif (t3rpm < 1000) and (t3rpm >= 100) then
- tm3.setCursorPos(20,9)
- elseif (t3rpm < 100) and (t3rpm >= 10) then
- tm3.setCursorPos(21,9)
- elseif t3rpm < 10 then
- tm3.setCursorPos(22,9)
- end
- tm3.write(t3rpm)
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(25,9)
- tm3.write(" RPM ")
- --Steam flow----
- local t3steam = t3.getFluidFlowRateMax()
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(1,11)
- tm3.write("Steam Flow:")
- --adjust cursor
- if t3.getActive() == true then
- tm3.setCursorPos(19,11)
- tm3.write(t2steam)
- else
- tm3.setCursorPos(22,11)
- tm3.write("0.0")
- end
- tm3.setTextColor(colors.white)
- tm3.setCursorPos(25,11)
- tm3.write(" MB/T")
- --Automatic System Control------------------------------------------------------
- --Turbine 1 Automatic Controls----
- if t1auto == true then
- --toggle turbine 1
- if t1per >= 95 then
- t1.setActive(false)
- elseif t1per <= 0 then
- t1.setActive(true)
- end
- --toggle coils 1
- if t1.getActive() == true then
- if t1.getRotorSpeed() >= 500 then
- t1.setInductorEngaged(true)
- else
- t1.setInductorEngaged(false)
- end
- else
- t1.setInductorEngaged(true)
- end
- else
- t1.setActive(false)
- end
- --Turbine 2 Automatic Controls----
- if t2auto == true then
- --toggle turbine 2
- if t2per >= 95 then
- t2.setActive(false)
- elseif t2per <= 0 then
- t2.setActive(true)
- end
- --toggle coils 2
- if t2.getActive() == true then
- if t2.getRotorSpeed() >= 500 then
- t2.setInductorEngaged(true)
- else
- t2.setInductorEngaged(false)
- end
- else
- t2.setInductorEngaged(true)
- end
- else
- t2.setActive(false)
- end
- --Turbine 3 Automatic Controls----
- if t3auto == true then
- --toggle turbine 3
- if t3per >= 95 then
- t3.setActive(false)
- elseif t3per <= 0 then
- t3.setActive(true)
- end
- --toggle coils 3
- if t3.getActive() == true then
- if t3.getRotorSpeed() >= 500 then
- t3.setInductorEngaged(true)
- else
- t3.setInductorEngaged(false)
- end
- else
- t3.setInductorEngaged(true)
- end
- else
- t3.setActive(false)
- end
- --Reactor Automatic Controls----
- if r1auto == true then
- --toggle reactor
- if (t1.getActive() == false) and (t2.getActive() == false) then
- r1.setActive(false)
- else
- r1.setActive(true)
- r1.setAllControlRodLevels(100)
- end
- --rod control
- if temp >= 2000 then
- if rods <= 98 then
- rods = rods + 2
- end
- elseif (temp < 2000) and (temp >= 1500) then
- if rods <= 99 then
- rods = rods + 1
- end
- elseif (temp < 1500) and (temp >= 1000) then
- if rods <= 99 then
- rods = rods + 1
- end
- elseif (temp < 1000) and (temp >= 500) then
- --ideal
- elseif temp < 500 then
- if rods >= 0 then
- rods = rods - 1
- end
- end
- r1.setAllControlRodLevels(rods)
- else
- r1.setAllControlRodLevels(100)
- r1.setActive(false)
- end
- --Button Press--------------------------------------------------------
- os.startTimer(1)
- while true do
- local evt = {os.pullEvent()}
- if evt[1]=="timer" then
- break
- elseif evt[1]=="monitor_touch" then
- local x,y = evt[3],evt[4]
- if evt[2] == "monitor_25" then
- --ON--
- if x>=18 and x<=22 then
- btn(y,"on")
- if y==1 then
- r1.setActive(true)
- r1auto = true
- elseif y==2 then
- t1.setActive(true)
- t1auto = true
- elseif y==3 then
- t2.setActive(true)
- t2auto = true
- elseif y==4 then
- t3.setActive(true)
- t3auto = true
- elseif y==5 then
- redstone.setOutput("top",true)
- end
- --OFF--
- elseif x>25 and x<=30 then
- btn(y,"off")
- if y==1 then
- r1.setActive(false)
- r1auto = false
- elseif y==2 then
- t1.setActive(false)
- t1auto = false
- elseif y==3 then
- t2.setActive(false)
- t2auto = false
- elseif y==4 then
- t3.setActive(false)
- t3auto = false
- elseif y==5 then
- redstone.setOutput("top",false)
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement