Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CouperArbre()
- i = 0
- while turtle.detect() == true do
- turtle.dig()
- if turtle.detectUp() == true then
- turtle.digUp()
- end
- turtle.up()
- i = i + 1
- end
- while i ~= 0 do
- turtle.down()
- i = i - 1
- end
- end
- function TestArbre()
- detect, bloc = turtle.inspect()
- if turtle.inspect() == false then
- return "vide"
- end
- if string.find(bloc.name, "sapling") ~= nil then
- return "sapling"
- end
- if string.find(bloc.name, "wood") ~= nil then
- return "wood"
- end
- end
- function Planter()
- turtle.select(12)
- turtle.place()
- end
- function SlotWood()
- for slot=1, 4 do
- turtle.select(slot)
- if turlte.getItemSpace() ~= 0 then
- slot = 4
- end
- end
- end
- function EviterSapling()
- if turtle.detectUp() == true then
- turtle.digUp()
- end
- turtle.up()
- if turtle.detect() == true then
- turtle.dig()
- end
- turtle.forward()
- if turtle.detect() == true then
- turtle.dig()
- end
- turtle.forward()
- if turtle.detectDown() == true then
- turtle.digDown()
- end
- turtle.down()
- end
- function CouperLigne(NbArbre)
- repeat
- if TestArbre() == "vide" then
- turtle.forward()
- end
- if TestArbre() == "wood" then
- SlotWood()
- CouperArbre()
- end
- until NbArbre == 0
- end
- EviterSapling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement