tompy90

Torcher

May 5th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. depth = 64
  2.  
  3. function down()
  4. while not turtle.down() do
  5. turtle.digDown()
  6. end
  7. end
  8.  
  9. function up()
  10. while not turtle.up() do
  11. turtle.digUp()
  12. end
  13. end
  14.  
  15. function forward()
  16. while not turtle.forward() do
  17. turtle.dig()
  18. end
  19. end
  20.  
  21. function back()
  22. while not turtle.back() do
  23. turtle.turnLeft()
  24. turtle.turnLeft()
  25. turtle.dig()
  26. turtle.turnLeft()
  27. turtle.turnLeft()
  28. end
  29. end
  30.  
  31. function dig()
  32. turtle.dig()
  33. end
  34.  
  35. function downColumn()
  36. for i=1,depth do
  37. down()
  38. dig()
  39. end
  40. end
  41.  
  42. function upColumn()
  43. for i=1,depth do
  44. dig()
  45. up()
  46. end
  47. end
  48.  
  49. function left()
  50. turtle.turnLeft()
  51. end
  52.  
  53. function right()
  54. turtle.turnRight()
  55. end
  56.  
  57. function setup()
  58. for i=1,4 do
  59. downColumn()
  60. forward()
  61. left()
  62. upColumn()
  63. right()
  64. forward()
  65. right()
  66. end
  67. end
  68.  
  69. function centre()
  70. forward()
  71. right()
  72. downColumn()
  73. forward()
  74. turtle.select(1)
  75. for i=1,depth do
  76. up()
  77. turtle.placeDown()
  78. end
  79. end
  80.  
  81. function placeTorch()
  82. back()
  83. back()
  84. for i=1,depth do
  85. down()
  86. turtle.place()
  87. end
  88. for i=1,depth do
  89. up()
  90. end
  91. forward()
  92. forward()
  93. end
  94.  
  95.  
  96. left()
  97. forward()
  98. left()
  99. forward()
  100. left()
  101. left()
  102. setup()
  103. centre()
  104.  
  105. for i=2,5 do
  106. turtle.select(i)
  107. placeTorch()
  108. left()
  109. end
  110. left()
Advertisement
Add Comment
Please, Sign In to add comment