Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. - Inventory = Array 1 - 16
  2. - Slot: 13 - What to axe
  3. - Slot: 14 - Fuel
  4. - Slot: 15 - Torch
  5. - Slot: 16 - Sappling
  6.  
  7. function moveForward()
  8. i = 1
  9. while i <= 5 do
  10. turtle.forward()
  11. end
  12. end
  13.  
  14. function woodAbove()
  15. if turtle.compareTo(13) then
  16. turtle.dig()
  17. turtle.up()
  18. return true
  19. else
  20. return false
  21.  
  22. function plantTree()
  23. turtle.turnLeft()
  24. turtle.forward()
  25. local height = 0
  26. if turtle.detect() then
  27. if turtle.compareTo(13) then
  28. turtle.dig()
  29. turtle.forward()
  30. while woodAbove() do
  31. height = height + 1
  32. woodAbove()
  33. end
  34. while height > 0 do
  35. turtle.down()
  36. height = height - 1
  37. end
  38. turtle.back()
  39. turtle.back()
  40. else
  41. turtle.back()
  42. end
  43. else
  44. turtle.select(16)
  45. turtle.place()
  46. turtle.back()
  47. end
  48. end
  49.  
  50.  
  51. local numberOfTrees = 3
  52.  
  53. while numberOfTrees > 0 do
  54. moveForward()
  55. plantTree()
  56. turtle.turnLeft()
  57. plantTree()
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement