Guest User

terra.lua

a guest
Jan 25th, 2020
287
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s = read()
  2. level = 0
  3.  
  4. function terrinha()
  5. level2 = 0
  6. while(turtle.detectUp()) do
  7. level2 = level2+1
  8. turtle.digUp()
  9. turtle.up()
  10. end
  11. for t = 0, level2, 1 do
  12. turtle.down()
  13. end
  14.  
  15. end
  16.  
  17. for i = 0, s, 1 do
  18.    
  19.  
  20.     for j = 0, s, 1 do
  21.         if(turtle.getFuelLevel() < 20) then
  22.             turtle.select(16)
  23.             turtle.refuel(1)
  24.             turtle.select(1)
  25.         end
  26.         turtle.dig()
  27.         turtle.forward()
  28.         while(turtle.detectUp()) do
  29.             turtle.digUp()
  30.             level = level + 1
  31.             turtle.up()
  32.         end
  33.         for w = 0, level, 1 do
  34.         turtle.down()
  35.         end    
  36.     end
  37.     if((i+2)%2 == 0) then
  38.     turtle.turnLeft()
  39.     turtle.dig()
  40.     turtle.forward()
  41.     turtle.turnLeft()
  42.     terrinha()
  43.     else
  44.     turtle.turnRight()
  45.     turtle.dig()
  46.     turtle.forward()
  47.     turtle.turnRight()
  48.    terrinha()
  49.      end
  50. end
RAW Paste Data