Advertisement
thekazador

Untitled

Dec 10th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. x = 0
  2. y = 0
  3. z = 0
  4. o = 1
  5.  
  6. function dejotodo()
  7. tempx = x
  8. tempy = y
  9. tempz = z
  10. tempo = o
  11.  
  12. if z > 1 then
  13. if o == 4 then
  14. turtle.turnLeft()
  15. o = 3
  16. else
  17. repeat
  18. turtle.turnRight()
  19. o = o + 1
  20. until o == 3
  21. end
  22.  
  23. repeat
  24. repeat
  25. turtle.dig()
  26. until turtle.forward() == true
  27. z = z - 1
  28. until z == 1
  29. end
  30.  
  31. if y > 0 then
  32. repeat
  33. repeat
  34. turtle.digDown()
  35. until turtle.down() == true
  36. y = y - 1
  37. until y == 0
  38. end
  39.  
  40. turtle.turnRight()
  41. o = 4
  42.  
  43. if x > 0 then
  44. repeat
  45. repeat
  46. turtle.dig()
  47. until turtle.forward() == true
  48. x = x - 1
  49. until x == 0
  50. end
  51.  
  52. turtle.turnLeft()
  53. o = 3
  54. turtle.forward()
  55. z = 0
  56.  
  57. for i=1,14 do
  58. turtle.select(i)
  59. turtle.drop()
  60. end
  61.  
  62. turtle.turnLeft()
  63. turtle.turnLeft()
  64. o = 1
  65.  
  66. turtle.forward()
  67. z = 1
  68. turtle.turnRight()
  69. o = o + 1
  70.  
  71. if x < tempx then
  72. repeat
  73. repeat
  74. turtle.dig()
  75. until turtle.forward() == true
  76. x = x + 1
  77. until x == tempx
  78. end
  79.  
  80. if y < tempy then
  81. repeat
  82. repeat
  83. turtle.digUp()
  84. until turtle.up() == true
  85. y = y + 1
  86. until y == tempy
  87. end
  88.  
  89. turtle.turnLeft()
  90. o = o - 1
  91.  
  92. if z < tempz then
  93. repeat
  94. repeat
  95. turtle.dig()
  96. until turtle.forward() == true
  97. z = z + 1
  98. until z == tempz
  99. end
  100.  
  101. if tempo == 4 then
  102. turtle.turnLeft()
  103. o = 4
  104. else
  105. repeat
  106. turtle.turnRight()
  107. o = o + 1
  108. until o == tempo
  109. end
  110.  
  111. end
  112.  
  113. function paraarriba ()
  114. for o=1,arriba do
  115. repeat
  116. turtle.digUp()
  117. until turtle.up() == true
  118. y = y + 1
  119. turtle.select(15)
  120. if turtle.compareTo(14) == false then
  121. dejotodo()
  122. end
  123. end
  124. end
  125.  
  126. function paraabajo ()
  127. for p=1,arriba do
  128. repeat
  129. turtle.digDown()
  130. until turtle.down() == true
  131. y = y - 1
  132. end
  133. end
  134.  
  135. function pasada (derecha, arriba)
  136. b = false
  137. for j=1,derecha do
  138.  
  139. if b == true then
  140. paraabajo(arriba)
  141. b = false
  142. else
  143. paraarriba(arriba)
  144. b = true
  145. end
  146.  
  147. if derecha ~= j then
  148. repeat
  149. turtle.dig()
  150. until turtle.forward() == true
  151. if o == 2 then
  152. x = x + 1
  153. else
  154. x = x - 1
  155. end
  156. end
  157. end
  158. end
  159.  
  160. term.clear()
  161. term.setCursorPos(1,3)
  162. write("Cuanto va a picar hacia la derecha? ")
  163. derecha = tonumber(read())
  164.  
  165. term.clear()
  166. term.setCursorPos(1,3)
  167. write("Cuanto va a picar hacia arriba? ")
  168. arriba = tonumber(read())
  169. arriba = arriba - 1
  170.  
  171. term.clear()
  172. term.setCursorPos(1,3)
  173. write("Cuanto va a picar de profundo? ")
  174. profundo = tonumber(read())
  175.  
  176. if derecha%2 == 1 then
  177. impar = true
  178. else
  179. impar = false
  180. end
  181.  
  182. side = false
  183.  
  184. for i=1,profundo do
  185. turtle.dig()
  186. turtle.forward()
  187. z = z + 1
  188.  
  189. if side == false then
  190. turtle.turnRight()
  191. o = o + 1
  192. if o > 4 then 0 = 1 end
  193. else
  194. turtle.turnLeft()
  195. o = o - 1
  196. if o < 1 then 0 = 4 end
  197. end
  198.  
  199. pasada(derecha, arriba)
  200.  
  201. if impar == true then
  202. for i=1,arriba do
  203. repeat
  204. turtle.digDown()
  205. until turtle.down() == true
  206. end
  207. end
  208.  
  209. if side == false then
  210. turtle.turnLeft()
  211. o = o - 1
  212. if o < 1 then 0 = 4 end
  213. side = true
  214. else
  215. turtle.turnRight()
  216. o = o + 1
  217. if o > 4 then 0 = 1 end
  218. side = false
  219. end
  220. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement