Guest User

Minecraft clearArea Clean

a guest
Jan 16th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. lenght = 3
  2. rows = 3
  3. height = 3
  4. yAlt = 1
  5.  
  6. function clearLine()
  7.     for i=1, lenght - 1 do
  8.         turtle.dig()
  9.         turtle.forward()
  10.     end
  11. end
  12.  
  13. function clearLayer()
  14.     for i=1, rows do
  15.         clearLine()
  16.         if rows%2 == 0 and yAlt%2 == 0 then
  17.             if i%2 == 1 and i < rows then
  18.                 turtle.turnLeft()
  19.                 turtle.dig()
  20.                 turtle.forward()
  21.                 turtle.turnLeft()
  22.             elseif i < rows then
  23.                 turtle.turnRight()
  24.                 turtle.dig()
  25.                 turtle.forward()
  26.                 turtle.turnRight()
  27.             end
  28.         else
  29.             if i%2 == 1 and i < rows then
  30.                 turtle.turnRight()
  31.                 turtle.dig()
  32.                 turtle.forward()
  33.                 turtle.turnRight()
  34.             elseif i < rows then
  35.                 turtle.turnLeft()
  36.                 turtle.dig()
  37.                 turtle.forward()
  38.                 turtle.turnLeft()
  39.             end
  40.         end
  41.     end
  42. end
  43.  
  44. function clearPlatformArea()
  45.     while height > 0 do
  46.         clearLayer()
  47.         height = height - 1
  48.         yAlt = yAlt + 1
  49.         if height > 0 then
  50.             turtle.digUp()
  51.             turtle.up()
  52.             turtle.turnRight()
  53.             turtle.turnRight()
  54.         end
  55.     end
  56. end
  57.  
  58. turtle.dig()
  59. turtle.forward()
  60. clearPlatformArea()
Advertisement
Add Comment
Please, Sign In to add comment