Advertisement
tankflo

Untitled

Apr 25th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. a=1 --initialisation des coordonée
  2. verif=0
  3. block=1
  4. compteur=0
  5. bedrock=0
  6. tour=1
  7. droitegauche=1
  8. coin=1
  9. compteur2=1
  10. x2=0
  11. z2=0
  12.  
  13. term.clear()
  14. term.setCursorPos(1,1)
  15. rednet.open("right")
  16. while x2==0 and z2==0 do --direction initial
  17. print(direction:)
  18. direction = read()
  19. if direction == "west" then
  20. x2=-1
  21. z2=0
  22. end
  23. if direction == "est" then
  24. x2=1
  25. z2=0
  26. end
  27. if direction == "nord" then
  28. x2=0
  29. z2=-1
  30. end
  31. if direction == "west" then
  32. x2=0
  33. z2=1
  34. end
  35. end
  36.  
  37. function changement_de_direction() --fonction qui change la direction
  38. if droitegauche == 1 then
  39. if direction == "nord" or direction == "sud" then
  40. x2=z2*(-1)
  41. z2=0
  42. end
  43. if direction == "est" or direction == "ouest" then
  44. x2=z
  45. z2=0
  46. end
  47. end
  48. if droitegauche == 0 then
  49. if direction == "nord" or direction == "sud" then
  50. x2=0
  51. z2=z2*(-1)
  52. end
  53. if direction == "est" or direction == "ouest" then
  54. x2=0
  55. z2=z
  56. end
  57. end
  58. end
  59.  
  60. while a==1 do --Début des préparatif
  61. turtle.select(16)
  62. turtle.refuel(3)
  63. turtle.digUp()
  64. turtle.select(13)
  65. turtle.placeUp()
  66. while bedrock==0 do --Quand la turtle dans déssendre
  67. turtle.select(8)
  68. if turtle.compareDown()then
  69. bedrock=1
  70. end
  71. turtle.digDown()
  72. turtle.down()
  73. while compteur<4 do
  74. compteur = compteur + 1
  75. while block<8 do
  76. turtle.select(block)
  77. block = block + 1
  78. if turtle.compare() then
  79. turtle.dig()
  80. end
  81. end
  82. block=1
  83. turtle.turnRight()
  84. end
  85. compteur=0
  86. turtle.select(8)
  87. end
  88.  
  89. while bedrock==1 do --quand la turtle se vide et se déplace en surface
  90. turtle.select(13)
  91. if turtle.compareUp()then
  92. while block<13 do
  93. turtle.select(block)
  94. block = block + 1
  95. turtle.dropUp(63-turtle.getItemSpace())
  96. end
  97. block=1
  98. turtle.select(12)
  99. turtle.transferTo(16,63-turtle.getItemSpace())
  100. bedrock=0
  101. else
  102. turtle.digUp()
  103. turtle.up()
  104. end
  105. if bedrock==0 then
  106. if tour==compteur2 then
  107. tour=tour+2
  108. compteur2=1
  109. if droitegauche==1 then
  110. turtle.turnRight()
  111. changement_de_direction()
  112. turtle.dig()
  113. turtle.forward()
  114. turtle.dig()
  115. turtle.forward()
  116. turtle.dig()
  117. turtle.forward()
  118. turtle.turnRight()
  119. changement_de_direction()
  120. droitegauche=0
  121. else
  122. turtle.turnLeft()
  123. changement_de_direction()
  124. turtle.dig()
  125. turtle.forward()
  126. turtle.dig()
  127. turtle.forward()
  128. turtle.dig()
  129. turtle.forward()
  130. turtle.turnLeft()
  131. changement_de_direction()
  132. droitegauche=1
  133. end
  134. else
  135. coin=(tour+2)/2
  136. if coin==compteur2 then
  137. if droitegauche==0 then
  138. turtle.turnRight()
  139. changement_de_direction()
  140. else
  141. turtle.turnLeft()
  142. changement_de_direction()
  143.  
  144. end
  145. end
  146. end
  147. compteur2=compteur2+1
  148. turtle.dig()
  149. turtle.forward()
  150. turtle.dig()
  151. turtle.forward()
  152. turtle.dig()
  153. turtle.forward()
  154. turtle.placeUp()
  155. X=x2+X
  156. Z=z2+Z
  157. rednet.send(??,X)
  158. rednet.send(??,Y)
  159. rednet.send(??,Z)
  160. end
  161. end
  162. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement