Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=1 --initialisation des coordonée
- verif=0
- block=1
- compteur=0
- bedrock=0
- tour=1
- droitegauche=1
- coin=1
- compteur2=1
- x2=0
- z2=0
- term.clear()
- term.setCursorPos(1,1)
- rednet.open("right")
- while x2==0 and z2==0 do --direction initial
- print(direction:)
- direction = read()
- if direction == "west" then
- x2=-1
- z2=0
- end
- if direction == "est" then
- x2=1
- z2=0
- end
- if direction == "nord" then
- x2=0
- z2=-1
- end
- if direction == "west" then
- x2=0
- z2=1
- end
- end
- function changement_de_direction() --fonction qui change la direction
- if droitegauche == 1 then
- if direction == "nord" or direction == "sud" then
- x2=z2*(-1)
- z2=0
- end
- if direction == "est" or direction == "ouest" then
- x2=z
- z2=0
- end
- end
- if droitegauche == 0 then
- if direction == "nord" or direction == "sud" then
- x2=0
- z2=z2*(-1)
- end
- if direction == "est" or direction == "ouest" then
- x2=0
- z2=z
- end
- end
- end
- while a==1 do --Début des préparatif
- turtle.select(16)
- turtle.refuel(3)
- turtle.digUp()
- turtle.select(13)
- turtle.placeUp()
- while bedrock==0 do --Quand la turtle dans déssendre
- turtle.select(8)
- if turtle.compareDown()then
- bedrock=1
- end
- turtle.digDown()
- turtle.down()
- while compteur<4 do
- compteur = compteur + 1
- while block<8 do
- turtle.select(block)
- block = block + 1
- if turtle.compare() then
- turtle.dig()
- end
- end
- block=1
- turtle.turnRight()
- end
- compteur=0
- turtle.select(8)
- end
- while bedrock==1 do --quand la turtle se vide et se déplace en surface
- turtle.select(13)
- if turtle.compareUp()then
- while block<13 do
- turtle.select(block)
- block = block + 1
- turtle.dropUp(63-turtle.getItemSpace())
- end
- block=1
- turtle.select(12)
- turtle.transferTo(16,63-turtle.getItemSpace())
- bedrock=0
- else
- turtle.digUp()
- turtle.up()
- end
- if bedrock==0 then
- if tour==compteur2 then
- tour=tour+2
- compteur2=1
- if droitegauche==1 then
- turtle.turnRight()
- changement_de_direction()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- changement_de_direction()
- droitegauche=0
- else
- turtle.turnLeft()
- changement_de_direction()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- changement_de_direction()
- droitegauche=1
- end
- else
- coin=(tour+2)/2
- if coin==compteur2 then
- if droitegauche==0 then
- turtle.turnRight()
- changement_de_direction()
- else
- turtle.turnLeft()
- changement_de_direction()
- end
- end
- end
- compteur2=compteur2+1
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.placeUp()
- X=x2+X
- Z=z2+Z
- rednet.send(??,X)
- rednet.send(??,Y)
- rednet.send(??,Z)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement