SHARE
TWEET

Tunnel_2

abilnf Mar 26th, 2019 (edited) 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function dig()
  2.    while turtle.detect() do
  3.       turtle.dig()
  4.    end
  5. end
  6.  
  7. function digDown()
  8.    turtle.digDown()
  9. end
  10.  
  11. function left()
  12.    turtle.turnLeft()
  13. end
  14.  
  15. function right()
  16.    turtle.turnRight()
  17. end
  18.  
  19. function around()
  20.    turtle.turnLeft()
  21.    turtle.turnLeft()
  22. end
  23.  
  24. function forward()
  25.    turtle.forward()
  26. end
  27.  
  28. function placeDown()
  29.    turtle.placeDown()
  30. end
  31.  
  32. function down()
  33.    turtle.down()
  34. end
  35.  
  36. function up()
  37.    turtle.up()
  38. end
  39. function select(number)
  40.    turtle.select(number)
  41. end
  42. function dropDown()
  43.    turtle.dropDown()
  44. end
  45. local function getItemCount(number)
  46.    return turtle.getItemCount(number)
  47. end
  48.  
  49. print("Wie viele Bloecke soll die Turtle graben?")
  50. print("")
  51. blocks = tonumber(read())
  52.  
  53. local b = 0
  54.  
  55. for i=1,blocks do
  56.    b = b + 1
  57.    dig()
  58.    forward()
  59.    left()
  60.    dig()
  61.    around()
  62.    dig()
  63.    digDown()
  64.    down()
  65.    dig()
  66.    around()
  67.    dig()
  68.    digDown()
  69.    down()
  70.    dig()
  71.    around()
  72.    dig()
  73.    left()
  74.    up()
  75.    if getItemCount(16) > 0 then
  76.       select(2)
  77.       placeDown()
  78.       for s=3,16 do
  79.          select(s)
  80.          dropDown()
  81.       end
  82.       select(1)
  83.    elseif b == 10 then
  84.       placeDown()
  85.       b = 0
  86.    end
  87.    up()
  88. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top