SHARE
TWEET

3x3 tunnel by anti krisis(edit. lOOigi)

lOOigi Mar 2nd, 2013 23 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tArgs={...}
  2. len=tonumber(tArgs[1])
  3.  
  4. i=0
  5. k=0
  6. m=0
  7. h=0
  8. svet=1
  9.  
  10. function digi(k)
  11.  
  12. if k==1 then
  13. m=1
  14. while m==1 do
  15. if turtle.detect() then
  16. turtle.dig()
  17. sleep(0.5)
  18. end
  19. if turtle.detect()==false then
  20. m=0
  21. end
  22. end
  23. end
  24.  
  25. if k==2 then
  26. m=1
  27. while m==1 do
  28. if turtle.detectUp() then
  29. turtle.digUp()
  30. sleep(0.5)
  31. end
  32. if turtle.detectUp()==false then
  33. m=0
  34. end
  35. end
  36. end
  37.  
  38. if k==3 then
  39. m=1
  40. while m==1 do
  41. if turtle.detectDown() then
  42. turtle.digDown()
  43. sleep(0.5)
  44. end
  45. if turtle.detectDown()==false then
  46. m=0
  47. end
  48. end
  49. end
  50.  
  51. end
  52.  
  53. while i~=len do
  54. digi(1)
  55. turtle.forward()
  56. digi(2)
  57. digi(3)
  58. turtle.turnLeft()
  59. digi(1)
  60. turtle.forward()
  61. digi(2)
  62. digi(3)
  63. turtle.turnRight()
  64. turtle.turnRight()
  65. turtle.forward()
  66. digi(1)
  67. turtle.forward()
  68. digi(2)
  69. digi(3)
  70. turtle.turnLeft()
  71. turtle.turnLeft()
  72. turtle.forward()
  73. if svet==7 then
  74. turtle.select(1)
  75. turtle.place()
  76. svet=0
  77. end
  78. turtle.turnRight()
  79.  
  80. if turtle.getItemCount(16)>0 then
  81. turtle.turnLeft()
  82. turtle.down()
  83. turtle.select(2)
  84. turtle.place()
  85.  
  86. for h=1,14 do
  87. turtle.select(h+2)
  88. turtle.drop()
  89. end
  90. turtle.select(3)
  91. turtle.turnRight()
  92. turtle.up()
  93. end
  94.  
  95.  
  96.  
  97. i=i+1
  98. svet=svet+1
  99.  
  100. 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