Lion_Kor

simple tree harvest function

Apr 6th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. function harvest()
  2.     turtle.select(1)
  3.  
  4.     local success, data = turtle.inspect()
  5.     wood = data.name
  6.     print(wood)
  7.    
  8.     while turtle.detect() do
  9.         turtle.dig()
  10.     end
  11.    
  12.     turtle.forward()
  13.    
  14.     while true do
  15.         local success, data = turtle.inspectUp()
  16.         if data.name == wood then
  17.             turtle.digUp()
  18.             turtle.up()
  19.         else
  20.             break
  21.         end
  22.     end
  23.    
  24.     while not turtle.detectDown() do
  25.         turtle.down()
  26.     end
  27.     turtle.back()
  28. end
Advertisement
Add Comment
Please, Sign In to add comment