Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- local running = false
- local output = true
- rednet.open("right")
- function termcls()
- term.clear()
- term.setCursorPos(1,1)
- end
- function moncls()
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextScale(2)
- end
- function rednet()
- id,message = rednet.receive(1)
- if id == ID and message == "manual" then
- running = false
- sleep(1)
- print("message")
- end
- end
- function drop()
- local drop = 0
- repeat
- drop = drop + 1
- termcls()
- moncls()
- print("Kiürítés: 54/"..drop)
- mon.write("Kiürítés: 54/"..drop)
- redstone.setBundledOutput("bottom", colors.magenta)
- sleep(0.5)
- redstone.setBundledOutput("bottom", 0)
- sleep(0.5)
- until drop == 55
- end
- function uran()
- local uran = 0
- repeat
- uran = uran + 1
- termcls()
- moncls()
- print("Urán betöltése: 47/"..uran)
- mon.write("Urán betöltése: 47/"..uran)
- redstone.setBundledOutput("bottom", colors.red)
- sleep(0.5)
- redstone.setBundledOutput("bottom", 0)
- sleep(0.5)
- until uran == 47
- end
- function ice()
- local ice = 0
- repeat
- ice = ice + 1
- term.clear()
- term.setCursorPos(1,1)
- termcls()
- moncls()
- print("Jég betöltése 22/"..ice)
- mon.write("Jég betöltése: 22/"..ice)
- redstone.setBundledOutput("bottom", colors.lime)
- sleep(0.5)
- redstone.setBundledOutput("bottom", 0)
- sleep(0.5)
- until ice== 22
- end
- function monitor()
- sleep(1)
- mon = peripheral.wrap("top")
- mon.clear()
- mon.setTextScale(2)
- ctrl = sensors.getController()
- data = sensors.getSensors(ctrl)
- reactorSensor = data[1]
- data = sensors.getSensorInfo(ctrl,reactorSensor)
- sensors.setSensorRange(ctrl,reactorSensor,"2")
- data = sensors.getProbes(ctrl,reactorSensor)
- reactorProbe = data[2]
- data = sensors.getAvailableTargetsforProbe(ctrl,reactorSensor,reactorProbe)
- reactorTarget = data[1]
- sensors.setTarget(ctrl,reactorSensor,reactorTarget)
- data = sensors.getSensorReadingAsDict(ctrl,reactorSensor,reactorTarget,reactorProbe)
- mon.setCursorPos(1, 1) mon.write("Reactor TMP: "..data.heat.." C")
- mon.setCursorPos(1, 2) mon.write("Reactor EU Out:"..data.output)
- heat = data.heat
- out = data.output
- data = sensors.getProbes(ctrl,reactorSensor)
- euProbe = data[3]
- data = sensors.getAvailableTargetsforProbe(ctrl,reactorSensor,euProbe)
- mfsuTarget = data[1]
- sensors.setTarget(ctrl,reactorSensor,mfsuTarget)
- data = sensors.getSensorReadingAsDict(ctrl,reactorSensor,mfsuTarget,euProbe)
- energy = data.energy
- mon.setCursorPos(1, 5) mon.write("MFSU energy:"..energy.."/10M")
- if heat > 1000 or energy < 512 then
- mon.setCursorPos(4, 4) mon.write("Reaktor leállítva")
- output = false
- running = true
- else
- mon.setCursorPos(1, 3) mon.write("Hömérséklet rendben")
- mon.setCursorPos(4, 4) mon.write("Reaktor elindítva")
- end
- if out > 1 and out < 99 then
- mon.setCursorPos(1, 6)
- mon.write("Teljesítmény alacsony")
- end
- if energy > 9999999 then
- redstone.setBundledOutput("bottom", colors.black)
- mon.setCursorPos(4, 4) mon.write("Reaktor leállítva")
- else
- redstone.setBundledOutput("bottom", colors.brown)
- mon.setCursorPos(4, 4) mon.write("Reaktor elindítva")
- end
- if heat > 4500 then
- mon.setCursorPos(1, 3) mon.write("Hömérséklet magas")
- end
- if energy > 9999999 then
- mon.setCursorPos(1, 3) mon.write("MFSU Full")
- end
- end
- while true do
- if running == true then
- redstone.setBundledOutput("bottom", colors.black)
- sleep(2)
- drop()
- sleep(0.1)
- uran()
- sleep(5)
- ice()
- redstone.setBundledOutput("bottom", colors.brown)
- running = false
- output = true
- elseif output == true then
- monitor()
- sleep(0.1)
- else
- term.clear()
- term.setCursorPos(1,1)
- print("debug")
- sleep(0.1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement