Advertisement
Leonardvdj

JungleTreeFarm

Nov 19th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. function plantTree()
  2.     turtle.select(16)
  3.     turtle.forward()
  4.     turtle.forward()
  5.     turtle.turnRight()
  6.     turtle.place()
  7.     turtle.turnLeft()
  8.     turtle.back()
  9.     turtle.turnRight()
  10.     turtle.place()
  11.     turtle.turnLeft()
  12.     turtle.back()
  13.     turtle.place()
  14.     turtle.select(1)
  15. end
  16.  
  17. function cutTree()
  18.     turtle.dig()
  19.     turtle.forward()
  20.     turtle.dig()
  21.     turtle.forward()
  22.     turtle.turnRight()
  23.     turtle.dig()
  24.     turtle.forward()
  25.     turtle.turnRight()
  26.     turtle.dig()
  27.     turtle.forward()
  28.     turtle.turnRight()
  29.     turtle.forward()
  30.     turtle.turnRight()
  31.     while turtle.detectUp() do
  32.         turtle.digUp()
  33.         turtle.up()
  34.         turtle.dig()
  35.         turtle.forward()
  36.         turtle.turnRight()
  37.         turtle.dig()
  38.         turtle.forward()
  39.         turtle.turnRight()
  40.         turtle.dig()
  41.         turtle.forward()
  42.         turtle.turnRight()
  43.         turtle.forward()
  44.         turtle.turnRight()
  45.     end
  46.     while not turtle.detectDown() do
  47.         turtle.down()
  48.     end
  49.     turtle.back()
  50.     plantTree()
  51. end
  52.  
  53. function checkGrowth()
  54.     turtle.up()
  55.     if turtle.detect() then
  56.         cutTree()
  57.     else
  58.         turtle.down()
  59.     end
  60. end
  61.  
  62. function loop()
  63.     if not turtle.detect() then
  64.         plantTree()
  65.     end
  66.     checkGrowth()
  67.     sleep(10)
  68.     loop()
  69. end
  70.  
  71. loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement