Advertisement
Tatantyler

Automatic Tree Farmer

Sep 13th, 2012
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local saplingSlot = 1
  2. local woodBlockSlot = 9
  3.  
  4. while true do
  5.     term.clear()
  6.     term.setCursorPos(1,1)
  7.     turtle.select(saplingSlot)
  8.     turtle.place()
  9.     turtle.select(woodBlockSlot)
  10.     while true do
  11.         if turtle.compare() then
  12.             print("Growth detected.")
  13.             break
  14.         end
  15.     end
  16.     turtle.dig()
  17.     os.sleep(0.1)
  18.     print("Moving forward...")
  19.     turtle.forward()
  20.     while turtle.detectUp() do
  21.         turtle.digUp()
  22.         turtle.up()
  23.     end
  24.     print("End of tree, returning to dump items...")
  25.     while not turtle.detectDown() do
  26.         turtle.down()
  27.     end
  28.     turtle.back()
  29.     for itr=1, 12 do
  30.           turtle.select(itr)
  31.           if itr ~= saplingSlot then
  32.               if itr == woodBlockSlot then
  33.                    turtle.dropDown(turtle.getItemCount(itr)-1)
  34.               else
  35.                    turtle.dropDown()
  36.               end
  37.           end
  38.     end
  39.     print("All done here, returning to top of loop...")
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement