Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- _____
- -- | ___| _ _ __ ___
- -- | |_ | | | | '_ \ / __|
- -- | _|| |_| | | | | (__
- -- |_| \__,_|_| |_|\___|
- --
- left = function()
- return turtle.turnLeft()
- end
- right = function()
- return turtle.turnRight()
- end
- fuel = function()
- return turtle.getFuelLevel()
- end
- select = function(id)
- return turtle.select(id)
- end
- count = function(id)
- return turtle.getItemCount(id)
- end
- move = function(id, nb)
- return turtle.transferTo(id, nb)
- end
- -- _____
- -- | ___| _ _ __ ___
- -- | |_ | | | | '_ \ / __|
- -- | _|| |_| | | | | (__
- -- |_| \__,_|_| |_|\___|
- --
- function init()
- if(count(16) == 0)then
- print("Pas de livre dans le slot 16")
- --return false
- end
- return true
- end
- function clear_inventory()
- for i = 1,15 do
- if(count(i)>0)then
- turtle.select(i)
- turtle.dropDown()
- end
- end
- select(1)
- end
- -- __ __ _ ____
- -- | \/ | __ _(_)_ __ / /\ \
- -- | |\/| |/ _` | | '_ \| | | |
- -- | | | | (_| | | | | | | | |
- -- |_| |_|\__,_|_|_| |_| | | |
- -- \_\/_/
- args = { ... }
- if( args[1]==null)then
- args[1] = 16
- --print("Début de 'tree', par defaut, "..args[1].." blocks")
- else
- --print("Début de 'tree', "..args[1].." blocks")
- end
- stop=false
- if(init()==false) then
- stop=true
- end
- xp=peripheral.wrap("right")
- xp.setAutoCollect(true)
- xplevel = xp.getLevels()
- while(stop==false)do
- turtle.attack()
- repeat
- turtle.suck()
- until turtle.suck() == false
- turtle.attack()
- if(count(16) > 1)then
- if(xplevel ~= xp.getLevels())then
- xplevel = xp.getLevels()
- print("Level "..xplevel)
- if(xplevel > 29) then
- clear_inventory()
- select(16)
- move(1,1)
- select(1)
- xp.enchant(30,30)
- turtle.dropDown()
- end
- end
- end
- turtle.attack()
- repeat
- turtle.suck()
- until turtle.suck() == false
- turtle.attack()
- sleep(1)
- if(count(2) > 0)then
- clear_inventory()
- end
- end
- print('End')
- if(fuel() == 0) then
- print('Ya plus de coco mon coco !')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement