Guest User

Chop

a guest
Jun 26th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. function FindTree
  2.   turtle.select(1)
  3.   if turtle.compare() == true then
  4.         return true
  5.   else
  6.         return false
  7.   end
  8. end
  9.  
  10. function cut
  11.   while turtle.detectUp() do
  12.   turtle.digUp()
  13.   turtle.up()
  14. end
  15.   while not turtle.detectDown() do
  16.   turtle.down()
  17. end
  18.  
  19. function plant()
  20.   turtle.select(16)
  21.   turtle.place()
  22. end
  23.  
  24. function fuel()
  25.   if turtle.getFuelLevel <10 then
  26.   turtle.select(15)
  27.   turtle.refuel(1)
  28. end
  29.  
  30. fuel()
  31. plant()
  32. fuel()
  33. if findTree() == false then
  34.   cut()
  35. else
  36.   print ("error")
Advertisement
Add Comment
Please, Sign In to add comment