Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slotCharbon = 7
- slotWood = 1
- slotPlastic = 2
- slotTree = 3
- slotWaypoint = 8
- slotChest = 9
- slotBonemeal = 10
- function reEnergy()
- turtle.select(slotCharbon)
- if turtle.getFuelLevel() < 800 then
- turtle.suck()
- turtle.refuel()
- end
- end
- function deposeItem(itemSlotName)
- turtle.select(itemSlotName)
- turtle.drop(turtle.getItemCount(itemSlotName)-1)
- end
- function reItem(itemSlotName, count, suckType)
- turtle.select(itemSlotName)
- if turtle.getItemCount(itemSlotName) < count then
- if suckType == "suckUp" then
- turtle.suckUp()
- else
- turtle.suck()
- end
- end
- end
- function isBlockType(type)
- turtle.select(type)
- return turtle.compare()
- end
- --Replante un arbre
- function rePlant()
- turtle.select(slotTree)
- turtle.place()
- end
- function reAndFill(init)
- if not init then
- turtle.turnLeft()
- turtle.turnLeft()
- while true do
- turtle.forward()
- end
- end
- turtle.turnLeft()
- reEnergy()
- turtle.turnRight()
- deposeItem(slotWood)
- deposeItem(slotPlastic)
- turtle.turnRight()
- reItem(slotTree, 2, "suck")
- turtle.turnRight()
- reItem(slotBonemeal, 5, "suckUp")
- i = 0
- while isBlockType(slotWaypoint) do
- i = i+1
- turtle.forward()
- if i > 10 then
- break
- end
- else
- turtle.back()
- end
- rePlant()
- os.sleep(200)
- turtle.select(slotBonemeal)
- for i=0,4 do
- turtle.place()
- end
- end
- function decoupeArbre()
- turtle.select(slotWood)
- while turtle.detect() do
- turtle.dig()
- turtle.digUp()
- turtle.up()
- end
- while not isBlockType(slotWaypoint) do
- turtle.down()
- end
- end
- function init()
- turtle.select(slotCharbon)
- turtle.refuel(1)
- while true do
- if not isBlockType(slotWaypoint) then
- if not turtle.down() then
- break
- end
- else
- break
- end
- end
- while true do
- if not turtle.forward() then
- if isBlockType(slotChest) then
- break
- else
- turtle.turnLeft()
- end
- else
- if isBlockType(slotWaypoint) then
- break
- else
- turtle.back()
- turtle.turnLeft()
- end
- end
- end
- while turtle.forward() do
- if not isBlockType(slotWaypoint) then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- end
- end
- tourne()
- end
- function tourne()
- reAndFill(true)
- while true do
- decoupeArbre()
- reAndFill()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement