Advertisement
HappySunChild

logFarm

Mar 6th, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. local currentYPosition = 0
  2.  
  3. --[[
  4.     This program will assume that the turtle is located at the bottom left of the tree
  5.     this program only works for jungle trees(sorta) and huge spruce trees
  6.  
  7.     LL
  8.     LL
  9.     T
  10.  
  11.     L is log
  12.     T is turtle
  13. ]]
  14.  
  15. function chopTree()
  16.     turtle.dig()
  17.     turtle.forward()
  18.  
  19.     repeat
  20.         turtle.dig()
  21.         turtle.digUp()
  22.         turtle.up()
  23.         currentYPosition = currentYPosition + 1
  24.     until not turtle.detect()
  25.  
  26.     turtle.turnRight()
  27.     turtle.dig()
  28.     turtle.forward()
  29.     turtle.turnLeft()
  30.  
  31.     for i = currentYPosition-1,0,-1 do
  32.         turtle.dig()
  33.         turtle.digDown()
  34.         turtle.down()
  35.     end
  36.  
  37.     turtle.dig()
  38.     turtle.back()
  39.     turtle.turnLeft()
  40.     turtle.forward()
  41.     turtle.turnRight()
  42. end
  43.  
  44. while true do
  45.     turtle.select(16)
  46.     if turtle.compare() then
  47.         chopTree()
  48.  
  49.         turtle.turnLeft()
  50.         turtle.turnLeft()
  51.  
  52.         for i = 1,15 do
  53.             turtle.select(i)
  54.             turtle.drop()
  55.         end
  56.  
  57.         turtle.select(16)
  58.  
  59.         turtle.drop(turtle.getItemCount()-1)
  60.  
  61.         turtle.up()
  62.  
  63.         turtle.select(1)
  64.         turtle.suck(4)
  65.  
  66.         turtle.turnRight()
  67.         turtle.turnRight()
  68.  
  69.         turtle.forward()
  70.         turtle.placeDown()
  71.         turtle.forward()
  72.         turtle.placeDown()
  73.         turtle.turnRight()
  74.         turtle.forward()
  75.         turtle.placeDown()
  76.         turtle.turnLeft()
  77.         turtle.back()
  78.         turtle.placeDown()
  79.         turtle.back()
  80.         turtle.down()
  81.         turtle.turnRight()
  82.         turtle.back()
  83.         turtle.turnLeft()
  84.     end
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement