Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c = peripheral.wrap("back")
- if not c then shell.exit() end
- term.clear()
- term.setCursorPos(1,1)
- minimum = 17
- function first()
- if f == nil then
- f = true
- return true
- end
- return false
- end
- function pulse(rside, delay)
- if delay == 0 then delay = 1 end
- rs.setOutput(rside, true)
- sleep(delay/2)
- rs.setOutput(rside, false)
- sleep(delay/2)
- end
- function update()
- term.clear()
- term.setCursorPos(1,1)
- print("The pressure is okay. "..c.getPressure().." bars")
- sleep(0.5)
- end
- function problem()
- print("Problem: The pressure is low. "..c.getPressure().." bars")
- print("Starting up...")
- pulse("front", 0.5)
- end
- while true do
- if c.getPressure() < minimum then
- problem()
- else
- if first() then
- print("Starting up...")
- sleep(3)
- else
- update()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement