Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Ce programme [créé par richie3366] est libre de droit d'édition et d'utilisation abusive ;)
- -- Cependant, si jamais vous venez à faire une présentation de celui-ci, n'hésitez pas à mentionner
- -- son auteur ;)
- -- Twitter : https://twitter.com/richie3366
- -- Susceptible d'être modifié à tout moment pour amélioration et/ou réparation.
- -- Dernière édition : 10/12/12
- -- Vidéo de présentation :
- function detecteMarqueSol()
- marque = -1
- for i = 9, 12 do
- turtle.select(i)
- if(turtle.compareDown()) then
- marque = i
- end
- end
- return marque
- end
- -- Démarrage...
- i = 1
- turtle.select(16)
- while i <= 4 do
- if turtle.compare() then
- turtle.turnLeft()
- i = 5
- else
- turtle.turnRight()
- i = i + 1
- end
- end
- while true do
- marque = detecteMarqueSol()
- if(marque > 0) then
- if marque == 12 then
- if turtle.detect() then
- turtle.turnRight()
- end
- elseif marque == 11 then
- turtle.turnLeft()
- if not turtle.detect() then
- turtle.select(1)
- turtle.place()
- end
- turtle.turnRight()
- elseif marque == 10 then
- if turtle.getFuelLevel() < 96 then
- turtle.turnLeft()
- turtle.select(5)
- turtle.suck()
- if turtle.getItemCount(5) > 2 then
- turtle.drop(turtle.getItemCount(5) - 2)
- end
- turtle.refuel(1)
- turtle.turnRight()
- end
- elseif marque == 9 then
- turtle.select(1)
- if turtle.getItemCount(1) < 13 then
- turtle.turnLeft()
- turtle.suck()
- if turtle.getItemCount(1) > 13 then
- turtle.drop(turtle.getItemCount(1) - 13)
- end
- turtle.turnRight()
- end
- end
- end
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment