Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local h = 0
  2. local t = 0
  3. function TreeGrown()
  4.     turtle.up()
  5.     while t<1 do
  6.         turtle.detect()
  7.         sleep (10)
  8.         if turtle.detect(true) then x=1 end
  9.         if turtle.detect(false) then x=0 end
  10.     end
  11.     turtle.down()
  12. end
  13.  
  14. function TreeUp()
  15.     h=0
  16.     while turtle.detectUp() do
  17.             turtle.digUp()
  18.             turtle.up()
  19.             h=h+1
  20.    end
  21.  
  22. end
  23.  
  24. function TreeDown()
  25.     while h>-1 do
  26.     turtle.down()
  27.     if h>0 then turtle.digDown() end
  28.     h=h-1
  29.     end  
  30. end
  31.  
  32. function TreePlant1x1()
  33.     turtle.up()
  34.     turtle.forward()
  35.     turtle.select(1)
  36.     turtle.placeDown()
  37.     turtle.back()
  38.     turtle.down()
  39.     sleep(10)
  40. end
  41.  
  42.  
  43. function TreePlant2x2()
  44.     turtle.up()
  45.     turtle.forward()
  46.     turtle.select(1)
  47.     turtle.placeDown()
  48.         turtle.forward()
  49.         turtle.placeDown()
  50.             turtle.turnRight()
  51.             turtle.forward()
  52.             turtle.placeDown()
  53.                 turtle.turnRight()
  54.                 turtle.forward()
  55.                 turtle.placeDown()
  56.                     turtle.turnRight()
  57.                     turtle.forward()
  58.                         turtle.turnLeft()
  59.                         turtle.forward()
  60.                         turtle.down()
  61.                         turtle.turnRight()
  62.                         turtle.turnRight()
  63.     sleep(10)
  64. end
  65.  
  66. while turtle.getFuelLevel() > 350 do
  67.     h=0
  68.     turtle.select(2)
  69.     turtle.dig()
  70.     turtle.forward()
  71.     if turtle.detect(true) then
  72.         TreeUp()
  73.         turtle.dig()
  74.         turtle.forward()
  75.         TreeDown()
  76.         turtle.turnRight()
  77.         turtle.dig()
  78.         turtle.forward()
  79.         TreeUp()
  80.         turtle.turnRight()
  81.         turtle.dig()
  82.         turtle.forward()   
  83.         TreeDown()
  84.         turtle.turnRight()
  85.         turtle.forward()
  86.         turtle.turnLeft()
  87.         turtle.forward()   
  88.         turtle.turnRight()
  89.         turtle.turnRight()
  90.         TreePlant2x2()
  91.         TreeGrown()
  92.     else
  93.         TreeUp()
  94.         TreeDown()
  95.         turtle.forward()   
  96.         turtle.turnRight()
  97.         turtle.turnRight()
  98.         TreePlant1x1()
  99.         TreeGrown()
  100.     end
  101. print("out of fuel")
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement