Advertisement
Alakazard12

turtle

Dec 1st, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1. print("Creating plot")
  2.  
  3. local dir = 1
  4.  
  5. local curl = 1
  6.  
  7. local curt = 15
  8.  
  9. local dirt = 0
  10.  
  11. turtle.select(curl)
  12.  
  13. turtle.digDown()
  14. turtle.down()
  15.  
  16. for i = 1, 4 do
  17.     if i > 1 then
  18.         turtle.turnLeft()
  19.     end
  20.     for i = 1, 21 do
  21.         if turtle.getItemCount(curl) == 0 then
  22.             curl = curl + 1
  23.         end
  24.         if turtle.detect() then
  25.             turtle.dig()
  26.         end
  27.         if not turtle.detectDown() then
  28.             turtle.placeDown()
  29.         end
  30.         turtle.forward()
  31.     end
  32. end
  33.  
  34. turtle.turnLeft()
  35. turtle.up()
  36.  
  37. turtle.select(curt)
  38.  
  39. for i = 1, 4 do
  40.     if i > 1 then
  41.         turtle.turnLeft()
  42.     end
  43.     for t = 1, 21 do
  44.         if turtle.getItemCount(curt) == 0 then
  45.             turtle.select(curt + 1)
  46.         end
  47.         if not turtle.detectDown() or not turtle.compareDown() then
  48.             turtle.digDown()
  49.             turtle.placeDown()
  50.         end
  51.         if turtle.detect() then
  52.             turtle.dig()
  53.         end
  54.         turtle.forward()
  55.     end
  56. end
  57.  
  58. turtle.turnLeft()
  59. turtle.forward()
  60. turtle.turnLeft()
  61. turtle.forward()
  62. turtle.turnRight()
  63. turtle.down()
  64. turtle.select(curl)
  65.  
  66. for i = 1, 19 do
  67.     for t = 1, 19 do
  68.         if turtle.compareDown(1) == false then
  69.             turtle.digDown()
  70.         end
  71.         if turtle.detectDown() == false then
  72.             if turtle.getItemCount(curl) == 0 then
  73.                 curl = curl + 1
  74.                 turtle.select(curl)
  75.             end
  76.             turtle.placeDown()
  77.         end
  78.         if turtle.detect() then
  79.             turtle.dig()
  80.         end
  81.         turtle.forward()
  82.     end
  83.     if dir == 1 then
  84.         turtle.turnLeft()
  85.         turtle.dig()
  86.         turtle.forward()
  87.         turtle.turnLeft()
  88.         dir = 2
  89.     elseif dir == 2 then
  90.         turtle.turnRight()
  91.         turtle.dig()
  92.         turtle.forward()
  93.         turtle.turnRight()
  94.         dir = 1
  95.     end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement