Advertisement
Heroj04

DoorOpener

Sep 11th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. --[[ this program is for having a door in a wall eg.
  2. Cross section  g=wall. t=turtle. b=button
  3. ggbgggg
  4. ggtgggg
  5. ]]--
  6.  
  7. --[[ rename the program startup and put it on a mining turtle in
  8. The configuration above
  9. ]]--
  10.  
  11. function waiting()
  12.  os.pullEvent("redstone")
  13.  openDoor()
  14. end
  15.  
  16. function openDoor()
  17.  turtle.dig()
  18.  turtle.forward()
  19.  turtle.dig()
  20.  turtle.digUp()
  21.  turtle.back()
  22.  turtle.digUp()
  23.  turtle.back()
  24.  wait(5)
  25.  closeDoor()
  26. end
  27.  
  28. function closeDoor()
  29.  turtle.forward()
  30.  turtle.placeUp()
  31.  turtle.forward()
  32.  turtle.placeUp()
  33.  turtle.back()
  34.  turtle.place()
  35.  turtle.back()
  36.  turtle.place()
  37.  waiting()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement