TheCountryGamer

Branch Mine

Aug 20th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. -- dig a 1x2 tunnel for x number of blocks, if null default of 10
  2. -- Functions
  3. function dedif(tf)
  4.    if turtle.detect() then
  5.       turtle.dig()
  6.       if turtle.detectUp() then
  7.          turtle.digUp()
  8.       end
  9.    end
  10.    if tf then
  11.       turtle.forward()
  12.    end
  13. end
  14.  
  15. -- Main Program
  16. local length = 10
  17. print("Please enter length of tunnel. If input is 0, will default to length of 10")
  18. numRed = read()
  19. if not numRed==0 then
  20.    length = numRed
  21. end
  22. for i=1, length do -- dig the # of blocks in length
  23.    dedif(true)
  24. end
  25. turtle.turnRight()
  26. turtle.turnRight()
  27. for i=1, length do -- go back
  28.    turtle.forward()
  29. end
  30. for inv=1, 16 do -- drop all items
  31.    turtle.select(i)
  32.    turtle.drop()
  33. end
Advertisement
Add Comment
Please, Sign In to add comment