Willibilly19

Branch

Jan 22nd, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. tArgs = {...}
  2. length = tArgs[1]
  3.  
  4. if #tArgs ~= 1 then
  5.   print("Usage: branch <length>")
  6. end
  7.  
  8.  
  9. local function forward()
  10.   while not turtle.forward() do
  11.     turtle.digDown()
  12.     turtle.dig()
  13.     turtle.digUp()
  14.     turtle.attack()
  15.   end
  16. end
  17.  
  18.  
  19. local function tunnel()
  20.   forward()
  21.   if not turtle.detectDown() then
  22.     turtle.select(1)
  23.     turtle.placeDown()
  24.   end
  25. end
  26.  
  27.  
  28. for i = 1,length do
  29.   tunnel()
  30. end
  31. turtle.digUp()
  32. turtle.digDown()
  33.  
  34. for i = 1,length do
  35.   turtle.back()
  36. end
Advertisement
Add Comment
Please, Sign In to add comment