Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --syngas
- local r0 = peripheral.wrap("redstone_integrator_4")
- --rs output
- local r1 = peripheral.wrap("redstone_integrator_1")
- --coal
- local r2 = peripheral.wrap("redstone_integrator_5")
- --rs input
- local r3 = peripheral.wrap("redstone_integrator_3")
- --term clear
- local function clear()
- if term.isColor and term.isColor() then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.orange)
- end
- term.clear()
- term.setCursorPos(1, 1)
- end
- --*****************************
- --coal level
- --*****************************
- function coal()
- if r2.getAnalogInput("down") <= 1 then
- while r2.getAnalogInput("down") < 12 do
- r1.setOutput("north", false)
- clear()
- print("refual coal")
- sleep(1)
- end
- else
- r1.setOutput("north", true)
- end
- end
- --*****************************
- --syngas production
- --*****************************
- function syngas()
- if r0.getAnalogInput("down") <= 1 then
- while r0.getAnalogInput("down") < 12 do
- coal()
- clear()
- write("Syngas refuel")
- end
- else
- coal()
- end
- if r3.getAnalogInput("north") < 14 then
- clear()
- write("Power generator offline")
- end
- end
- end
- --*****************************
- --generator
- --*****************************
- function generator()
- if r3.getAnalogInput("north") > 14 and r2.getAnalogInput("down") > 1 and r0.getAnalogInput("down") > 1 then
- r1.setOutput("north", true)
- else
- r1.setOutput("north", false)
- end
- end
- --*****************************
- --program starter
- --*****************************
- while true do
- generator()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement