birdini

treefarmer

Dec 31st, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. while true do
  2.     --plant the sapling
  3.     turtle.select(15)
  4.     turtle.place()
  5.  
  6.     turtle.select(16)
  7.    
  8.     --while the tree isn't grown, sleep
  9.     while not turtle.compare() do
  10.         os.sleep(2)
  11.     end
  12.    
  13.     --we've found a tree block, now separate it for collection
  14.     turtle.select(1)
  15.    
  16.     --go up the tree and break the blocks
  17.     while turtle.detect() or turtle.detectUp() do
  18.         turtle.dig()
  19.         turtle.digUp()
  20.         turtle.up()
  21.     end
  22.  
  23.     while not turtle.detectDown() do
  24.         turtle.down()
  25.     end
  26.    
  27.     --place the items in the chest behind the turtle
  28.     turtle.turnRight()
  29.     turtle.turnRight()
  30.     turtle.drop()
  31.     turtle.turnRight()
  32.     turtle.turnRight()
  33. end
Add Comment
Please, Sign In to add comment