Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c1 = peripheral.wrap("left")
- c2 = peripheral.wrap("right")
- function pressure_checkON()
- redstone.setOutput("left", true)
- redstone.setOutput("right", true)
- end
- function pressure_checkOFF()
- redstone.setOutput("left", false)
- redstone.setOutput("right", false)
- end
- while true do
- pressurec1 = c1.getPressure()
- pressurec2 = c2.getPressure()
- total_pressure = pressurec1 + pressurec2
- if total_pressure < 4 then
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.lime)
- textutils.slowPrint("Limit Not Reached")
- term.setCursorPos(1,2)
- term.setTextColor(colors.green)
- textutils.slowPrint("Activating Air Compressor")
- term.setCursorPos(1,3)
- term.setTextColor(colors.blue)
- print("Pressure Left Compressor:",pressurec1)
- term.setCursorPos(1,4)
- term.setTextColor(colors.blue)
- print("Pressure Right Compressor:",pressurec2)
- term.setCursorPos(1,5)
- term.setTextColor(colors.lightBlue)
- print("Total Pressure:",total_pressure)
- pressure_checkON()
- sleep(5)
- end
- if total_pressure > 4 then
- term.clear()
- term.setTextColor(colors.red)
- term.setCursorPos(1,1)
- textutils.slowPrint("Limit Reached")
- term.setCursorPos(1,2)
- term.setTextColor(colors.purple)
- textutils.slowPrint("Deactivating Air Compressor")
- term.setCursorPos(1,3)
- term.setTextColor(colors.blue)
- print("Pressure Left Compressor:",pressurec1)
- term.setCursorPos(1,4)
- term.setTextColor(colors.blue)
- print("Pressure Right Compressor:",pressurec2)
- term.setCursorPos(1,5)
- term.setTextColor(colors.lightBlue)
- print("Total Pressure:",total_pressure)
- pressure_checkOFF()
- sleep(10)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement