daily pastebin goal
27%
SHARE
TWEET

stripmine.lua

a guest Jul 12th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local depth = 20
  2. local placeTorch = 5
  3. local switch = false
  4.  
  5. function digForward()
  6.     while turtle.detect() == true
  7.     do
  8.         turtle.dig()
  9.     end
  10. end
  11.  
  12. function digDepth()
  13.     for i = 1, depth
  14.     do
  15.         dig2by1()
  16.     end
  17. end
  18.  
  19. function dig2by1()
  20.     turtle.up()
  21.     placeTorchPlease()
  22.     digForward()
  23.     turtle.forward()
  24.     turtle.digDown()
  25.     turtle.down()
  26. end
  27.  
  28. function placeTorchPlease()
  29.     if placeTorch == 5
  30.     then
  31.         turtle.placeDown()
  32.         placeTorch = 1
  33.     else
  34.         placeTorch = placeTorch + 1
  35.     end
  36. end
  37.  
  38. function moveNextStrip()
  39.     turtle.turnRight()
  40.     turtle.forward()
  41.     turtle.forward()
  42.     turtle.forward()
  43.     turtle.turnLeft()
  44.     turtle.turnLeft()    
  45. end
  46.  
  47. function dig1by5()
  48.     for i = 1, 5
  49.     do
  50.         digForward()
  51.         if i == 5
  52.         then
  53.             print("dont move forward")
  54.         else
  55.             turtle.forward()
  56.         end
  57.     end
  58.     for i = 1, 4
  59.     do
  60.         turtle.back()
  61.     end
  62. end
  63.  
  64. function mineStrip()
  65.     turtle.turnLeft()
  66.     dig1by5()
  67.     turtle.turnLeft()
  68.     turtle.turnLeft()
  69.     dig1by5()
  70. end
  71.  
  72. function mineStrips()
  73.     for i = 1, 7
  74.     do
  75.         mineStrip()
  76.         moveNextStrip()
  77.     end
  78. end
  79.  
  80. --START MAIN PROCEDURE
  81.  
  82. digDepth()
  83. turtle.up()
  84. dig1by5()
  85. mineStrips()
  86. turtle.forward()
  87.  
  88. --END MAIN PROCEDURE
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