Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local todo = tonumber(tArgs[1])
- todo = todo or 1
- local j = tonumber(1)
- local z = tonumber(1)
- turtle.select(1)
- function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function tFuel(amount)
- if turtle.getFuelLevel() < 5 then
- turtle.select(16)
- turtle.refuel(amount)
- if turtle.getItemCount(16) < 5 then
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.suckDown()
- turnaround()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.select(1)
- end
- end
- function plant()
- tFuel(1)
- turtle.place()
- turtle.up()
- print("Planting Tree #"..z)
- z = z+1
- repeat
- os.sleep(30)
- until turtle.detect() == true
- turtle.down()
- turtle.select(1)
- end
- function chop()
- repeat
- tFuel(1)
- turtle.dig()
- turtle.digUp()
- turtle.up()
- j = j + 1
- until turtle.detect() == false
- for i = 1, j do
- tFuel(1)
- turtle.down()
- end
- j = 1
- for l = 3, 15 do
- turtle.select(l)
- turtle.dropDown()
- turtle.select(1)
- end
- end
- for k = 1, todo do
- plant()
- chop()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement