Advertisement
purxiz

Untitled

Jun 2nd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local vars = {...};
  2.  
  3. height = tonumber(vars[1]);
  4.  
  5. function Forward()
  6.   while turtle.forward() == false do
  7.     if turtle.detect() == false then
  8.       turtle.attack()
  9.     else
  10.       turtle.dig()
  11.     end
  12.   end
  13. end
  14.  
  15. function Up()
  16.   while turtle.up() == false do
  17.     if turtle.detectUp() == false then
  18.       turtle.attackUp()
  19.     else
  20.       turtle.digUp()
  21.     end
  22.   end
  23. end
  24.  
  25. function Down()
  26.   while turtle.down() == false do
  27.     if turtle.detectDown() == false then
  28.       turtle.attackDown()
  29.     else
  30.       turtle.digDown()
  31.     end
  32.   end
  33. end
  34.  
  35. local currentHeight = 0;
  36.  
  37. while currentHeight < height do
  38.     Forward();
  39.     Up();
  40.     Up();
  41.     turtle.digUp();
  42.     Down();
  43. end
  44.  
  45. turtle.turnLeft();
  46. turtle.turnLeft();
  47.  
  48. while currentHeight >= 0 do
  49.     Down();
  50.     Forward();
  51.     currentHeight = currentHeight - 1;
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement