Advertisement
schwiti100

turtleDown

Jul 13th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. j=0
  2.  
  3. function ddown()
  4.     while(not turtle.down()) do
  5.         turtle.digDown()
  6.     end
  7.     if not turtle.detectDown() then
  8.         turtle.select(1)
  9.         turtle.placeDown()
  10.     end
  11.     j=j+1
  12. end
  13.  
  14. function fforward()
  15.     while(not turtle.forward()) do
  16.         turtle.dig()
  17.     end
  18. end
  19.  
  20.  
  21. while(true) do
  22.     ddown()
  23.     fforward()
  24.     if(j==8) then
  25.         turtle.turnRight()
  26.         turtle.turnRight()
  27.         turtle.select(2)
  28.         turtle.place()
  29.         turtle.turnRight()
  30.         turtle.turnRight()     
  31.     end
  32.     if turtle.detectUp() then
  33.         turtle.digUp()
  34.     end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement