Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doDoor(close)
- if not(close) then
- for i=1,3 do
- turtle.dig()
- turtle.forward()
- end
- turtle.dig()
- for i=1,3 do
- turtle.back()
- end
- turtle.place()
- else
- turtle.dig()
- for i=1,3 do
- turtle.forward()
- end
- for i=1,3 do
- turtle.place()
- turtle.back()
- end
- turtle.place()
- end
- end
- turtle.select(1)
- local state = (turtle.getItemCount(1) >= 3)
- -- true:open false:closed
- while true do
- os.pullEvent("redstone")
- doDoor(state)
- state = not(state)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement