Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local data
- local fuelSlot = 1
- local turnCount = 0
- local treeHeight = 1
- local fuelLevel = turtle.getFuelLevel()
- local woodSlot = 2
- local rootSlot = 3
- local barkSlot = 4
- local slotCount = 0
- local moveHeight = 0
- local moveCount = 0
- while treeHeight < 250 do
- if fuelLevel < turtle.getFuelLimit() then
- turtle.turnLeft()
- while fuelLevel < turtle.getFuelLimit() do
- turtle.select(fuelSlot)
- slotCount = turtle.getItemCount()
- turtle.suck(math.floor(64-slotCount))
- turtle.refuel()
- fuelLevel = turtle.getFuelLevel()
- end
- end
- turtle.suck(math.floor(64-slotCount))
- turtle.select(woodSlot)
- if turtle.getItemCount() == 0 then
- print('Please insert wood into slot 2')
- treeHeight = 250
- end
- if turtle.compare() == true then
- turtle.dig()
- turtle.forward()
- moveCount = 0
- moveHeight = 0
- elseif turtle.compare() == false then
- if moveCount < 10 then
- turtle.select(rootSlot)
- if turtle.getItemCount() == 0 then
- print('Please insert roots or wood into slot 3')
- treeHeight = 250
- end
- if turtle.compare() == true then
- turtle.dig()
- turtle.forward()
- moveCount = 0
- moveHeight = 0
- elseif turtle.compare() == false then
- turtle.select(barkSlot)
- if turtle.getItemCount() == 0 then
- print('Please insert roots, wood or bark into slot 4')
- treeHeight = 250
- end
- if turtle.compare() == true then
- turtle.dig()
- turtle.forward()
- moveCount = 0
- moveHeight = 0
- elseif turtle.compare() == false then
- if turnCount < 4 then
- turtle.turnRight()
- turnCount = turnCount + 1
- elseif moveCount == 10 then
- if turtle.up() then
- if moveHeight == 5 then
- treeHeight = 250
- else
- turtle.turnRight()
- turtle.turnRight()
- turnCount = 0
- treeHeight = treeHeight + 1
- moveHeight = moveHeight + 1
- end
- else
- turtle.digUp()
- end
- else
- turtle.forward()
- moveCount = moveCount + 1
- end
- end
- end
- else
- turtle.digUp()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment