Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slot = 1
- slot_bois = 1
- h= 0
- a = true
- while true do
- --Les trucs indispensables au début :D
- turtle.forward()
- turtle.select(1)
- function recherche(param) -- FONCTION FUEL2
- while slot <16 do
- while turtle.getItemCount() == 0 do
- if slot == 16 then
- slot = 0
- end
- slot = slot +1
- turtle.select(slot)
- end
- local data = turtle.getItemDetail(slot)
- if data.name == param then
- turtle.select(slot)
- return 0
- end
- slot = slot +1
- turtle.select(slot)
- end
- end
- function fuel() -- FONCTION FUEL1
- turtle.select(1)
- recherche("minecraft:coal")
- turtle.refuel(1)
- print("[x] Refuel terminé !")
- slot = 1
- end
- function recolte() --RECOLTE
- turtle.dig()
- turtle.forward()
- local success, bloc = turtle.inspectUp()
- if bloc.name == "minecraft:log" then
- while turtle.detectUp() == true do
- turtle.digUp()
- turtle.up()
- end
- end
- while turtle.detectDown() == false do
- recherche("minecraft:sapling")
- turtle.down()
- end
- if turtle.detectDown() == true then
- recherche("minecraft:sapling")
- turtle.up()
- turtle.placeDown()
- turtle.forward()
- turtle.digDown()
- turtle.down()
- end
- end
- function esquive() --ESQUIVE
- turtle.digUp()
- turtle.up()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.down()
- end
- function creation() --CREATION
- while turtle.detect() == true do --A COMPLETER :D
- turtle.up()
- end
- turtle.up()
- if turtle.getItemCount(slot_bois) > 5 then
- turtle.drop()
- end
- while turtle.detectDown() == false do
- turtle.down()
- end
- end
- function tourne_droite()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- function tourne_gauche()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- function drop()
- recherche("minecraft:log")
- turtle.drop()
- turtle.turnRight()
- end
- --TRUC RIGOLOS
- if turtle.getFuelLevel() == 0 then --Y'A ENCORE DU FUEL OU PAS ?
- fuel()
- end
- if turtle.detect() == true then
- local success, data = turtle.inspect()
- if data.name == "minecraft:log" then --Y'A DU BOIS ?
- recolte()
- end
- local success, data = turtle.inspect()
- if data.name =="minecraft:leaves" then
- turtle.dig()
- turtle.forward()
- end
- local success, data = turtle.inspect()
- if data.name == "minecraft:sapling" then -- Y'A UNE SAPLING ?
- esquive()
- end
- local success, data = turtle.inspect()
- if data.name == "minecraft:furnace" then -- Y'A UN FURNACE ?
- creation()
- end
- local success, data = turtle.inspect() -- EST-CE QU'IL Y A UN MUR ?
- if data.name == "minecraft:stone" then
- tourne_droite()
- end
- local success, data = turtle.inspect() -- EST-CE QU'IL Y A UN MUR ?
- if data.name == "minecraft:planks" then
- tourne_gauche()
- end
- local success, data = turtle.inspect()
- if data.name == "minecraft:hopper" then
- drop()
- end
- end
- while turtle.detectDown() == false do
- turtle.down()
- end
- --Trucs a faire a la toute fin
- turtle.suck()
- end
Advertisement
Add Comment
Please, Sign In to add comment