Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap("back")
- -- get basic details of the targets the sensor has detected
- local count = 0
- sale="right"
- --position start stop reactor signal
- repeat
- --reactor cord -1 0 1
- local details = sensor.getTargetDetails("-1,0,1")
- --for wire
- --cable cord 0 -1 1
- local CABLE = sensor.getTargetDetails("0,-1,1")
- --mfsu cord 2 -1 1
- local MFSU = sensor.getTargetDetails("2,-1,1")
- sleep(1)
- -- 1 sec = 20 (for me) not lineal value
- local MABLE = sensor.getTargetDetails("0,-1,1")
- local NFSU = sensor.getTargetDetails("2,-1,1")
- -- EU for wire
- SALIDA = (tonumber(MABLE.EnergyConducted ) - tonumber(CABLE.EnergyConducted))/20
- MFLIDA = (tonumber(NFSU.EnergyConducted ) - tonumber(MFSU.EnergyConducted))/20
- -- EU for mfsu
- local menor = tonumber(8500)
- -- temp cut off
- term.clear()
- oldx, oldy = term.getCursorPos()
- term.setCursorPos(oldx,1)
- print("---------------------")
- local AbaJo = tonumber(details.Heat)
- if AbaJo <= menor then
- -- print("es menor")
- print("Reactor Encendido")
- redstone.setOutput(sale, true)
- local ENLINEA = 1
- else
- -- print("es mayor")
- print("Reactor Apagado")
- print("Se alcanzo temperatura critica")
- redstone.setOutput(sale, false)
- local ENLINEA = 0
- end
- print("---------------------")
- print("Temperatura: "..tostring(details.Heat).." MAX: "..tostring(details.MaxHeat))
- print("Salida wire: "..SALIDA.." EU/t")
- print("Total : "..MABLE.EnergyConducted.." EU")
- print("Salida NFSU: "..MFLIDA.." EU/t para MAX "..NFSU.Output)
- print("Total : "..NFSU.EnergyConducted.." EU")
- print("Almacenado : "..NFSU.Stored.." / "..NFSU.Capacity)
- count = count + 1
- if count == 600 then
- redstone.setOutput(sale, false)
- sleep(1)
- redstone.setOutput(sale, true)
- local count = 0
- end
- print("---------------------")
- if SALIDA == 0 then
- print("-SIN-CARGA-ESPERANDO-")
- print("---------------------")
- if ENLINEA == 1 then
- redstone.setOutput(sale, false)
- sleep(20)
- redstone.setOutput(sale, true)
- end
- end
- sleep(1)
- until proces_kill
Advertisement
Add Comment
Please, Sign In to add comment