Advertisement
Guest User

stripMine

a guest
Oct 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. function stripMine()
  2.     turtle.refuel()
  3.     for i = 0, 10,1 do
  4.         threeTimesThree()
  5.         if turtle.getFuelLevel() == 0 then
  6.             return        
  7.         end
  8.     end
  9.     -- Return
  10.     turtle.turnRight()
  11.     turtle.turnRight()
  12.     for i = 0, 10,1 do
  13.         fwd()
  14.     end
  15. end
  16.  
  17. function threeTimesThree()
  18.     --0 1 2
  19.     --3 4 5
  20.     --6 7 8
  21.     --Start 4
  22.     digFwd()  
  23.     -- 3
  24.     turtle.turnLeft()
  25.     digFwd()
  26.     -- 0
  27.     digUp()
  28.  
  29.     turtle.turnRight()
  30.     turtle.turnRight()
  31.     -- 1
  32.     digFwd()
  33.     -- 2
  34.     digFwd()
  35.     -- 5
  36.     digDown()
  37.     -- 8
  38.     digDown()
  39.     turtle.turnLeft()
  40.     turtle.turnLeft()
  41.     -- 7
  42.     digFwd()
  43.     -- 6
  44.     digFwd()
  45.     turtle.turnRight()
  46.     turtle.up()
  47.     turtle.turnRight()
  48.     fwd()
  49.     turtle.turnLeft()
  50. end
  51.  
  52. function fwd()
  53.     if turtle.detect() then
  54.         return
  55.     else
  56.         turtle.forward()
  57.     end
  58. end
  59.  
  60. function digFwd()
  61.     if turtle.detect() then
  62.         turtle.dig()
  63.     end  
  64.     turtle.forward()  
  65. end
  66.  
  67. function digUp()
  68.     if turtle.detectUp() then
  69.         turtle.digUp()
  70.     end
  71.     turtle.up()
  72. end
  73.  
  74. function digDown()
  75.     if turtle.detectDown() then
  76.         turtle.digDown()
  77.     end
  78.     turtle.down()
  79. end
  80.  
  81. stripMine()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement