Advertisement
ordenix

Untitled

Mar 27th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.02 KB | None | 0 0
  1. print("Wprowac dlugosc boku")
  2. local x=read()
  3. a=5*x+5
  4. b=2*x+3
  5. c=5*x+4
  6. d=2*x+3-1
  7. local l=0
  8. local j=1
  9. local bl=0
  10.  
  11. function inv()
  12. bl=0
  13. while bl==0 do
  14. local lv=turtle.getFuelLevel()
  15. print(lv)
  16. --napelnienie
  17. if lv<100 then
  18. turtle.select(16)
  19. turtle.refuel()
  20. end
  21. turtle.select(j)
  22. l=turtle.getItemCount(j)
  23. if l==0 then
  24. j=j+1
  25. else
  26. bl=1
  27. end
  28. if j==16 then
  29. j=1
  30. end
  31. end
  32. end
  33.  
  34.  
  35.  
  36. for i=1,a do
  37. inv()
  38. turtle.placeDown()
  39. turtle.forward()
  40. end
  41. inv()
  42. turtle.placeDown()
  43. turtle.turnRight()
  44. turtle.forward()
  45.  
  46. for i=1,b do
  47. inv()
  48. turtle.placeDown()
  49. turtle.forward()
  50. end
  51. inv()
  52. turtle.placeDown()
  53. turtle.turnRight()
  54. turtle.forward()
  55.  
  56. for i=1,c do
  57. inv()
  58. turtle.placeDown()
  59. turtle.forward()
  60. end
  61. inv()
  62. turtle.placeDown()
  63. turtle.turnRight()
  64. turtle.forward()
  65.  
  66. for i=1,d do
  67. inv()
  68. turtle.placeDown()
  69. turtle.forward()
  70. end
  71. inv()
  72. turtle.placeDown()
  73. --Zakonczenie ramy
  74. --Obrut i pozycja m1
  75. turtle.turnRight()
  76. turtle.forward()
  77.  
  78.  
  79. --pierwsze klockimarkerowe
  80. for i=1,5 do
  81. inv()
  82. turtle.placeDown()
  83. krss=x-1
  84. for krs=1,krss do
  85. turtle.forward()
  86. end
  87. inv()
  88. turtle.placeDown()
  89. --i=i+1
  90. if i==5 then
  91. else
  92. turtle.forward()
  93. turtle.forward()
  94. end
  95.  
  96. end
  97.  
  98. --koniec 1 markeeow
  99. turtle.turnRight()
  100. d1=x-1+3+x
  101. for i=1,d1 do
  102. turtle.forward()
  103. end
  104. --koniec d1
  105.  
  106.  
  107. turtle.turnRight()
  108.  
  109. --2 klockimarkerowe
  110. for i=1,5 do
  111. inv()
  112. turtle.placeDown()
  113. krss=x-1
  114. for krs=1,krss do
  115. turtle.forward()
  116. end
  117. inv()
  118. turtle.placeDown()
  119. --i=i+1
  120. if i==5 then
  121. else
  122. turtle.forward()
  123. turtle.forward()
  124. end
  125. end
  126.  
  127.  
  128. turtle.turnRight()
  129. d1=x-1+3+1
  130. for i=1,d1 do
  131. turtle.forward()
  132. end
  133. --koniec d2
  134.  
  135. turtle.turnRight()
  136.  
  137. --3 klockimarkerowe
  138. for i=1,5 do
  139. inv()
  140. turtle.placeDown()
  141. krss=x-1
  142. for krs=1,krss do
  143. turtle.forward()
  144. end
  145. inv()
  146. turtle.placeDown()
  147. --i=i+1
  148. if i==5 then
  149. else
  150. turtle.forward()
  151. turtle.forward()
  152. end
  153. end
  154.  
  155.  
  156. turtle.turnRight()
  157. d1=4
  158. for i=1,d1 do
  159. turtle.forward()
  160. end
  161. --koniec d3
  162.  
  163. turtle.turnRight()
  164.  
  165. --4 klockimarkerowe
  166. for i=1,5 do
  167. inv()
  168. turtle.placeDown()
  169. krss=x-1
  170. for krs=1,krss do
  171. turtle.forward()
  172. end
  173. inv()
  174. turtle.placeDown()
  175. --i=i+1
  176. if i==5 then
  177. else
  178. turtle.forward()
  179. turtle.forward()
  180. end
  181. end
  182.  
  183. turtle.turnRight()
  184. turtle.forward()
  185. turtle.forward()
  186. turtle.forward()
  187. turtle.turnRight()
  188. inv()
  189. turtle.placeDown()
  190. krss=4*x+x-1+4
  191. for i=1,krss do
  192. turtle.forward()
  193. inv()
  194. turtle.placeDown()
  195. end
  196.  
  197.  
  198.  
  199. turtle.turnRight()
  200. turtle.forward()
  201. turtle.forward()
  202. turtle.turnRight()
  203. inv()
  204. turtle.placeDown()
  205. krss=4*x+x-1+4
  206. for i=1,krss do
  207. turtle.forward()
  208. inv()
  209. turtle.placeDown()
  210. end
  211. turtle.turnRight()
  212. turtle.forward()
  213. turtle.turnRight()
  214. inv()
  215. turtle.placeDown()
  216. krss=4*x+x-1+4
  217. for i=1,krss do
  218. turtle.forward()
  219. inv()
  220. turtle.placeDown()
  221. end
  222. turtle.turnRight()
  223. krss=1+x
  224. for i=1,krss do
  225. turtle.forward()
  226. end
  227. turtle.turnRight()
  228.  
  229. krss=x
  230. for i=1,krss do
  231. turtle.forward()
  232. end
  233. turtle.turnRight()
  234.  
  235. krss=x
  236. for i=1,krss do
  237. inv()
  238. turtle.placeDown()
  239. turtle.forward()
  240. end
  241. turtle.forward()
  242. turtle.forward()
  243. turtle.forward()
  244. krss=x
  245. for i=1,krss do
  246. inv()
  247. turtle.placeDown()
  248. turtle.forward()
  249. end
  250. ------------
  251.  
  252. turtle.turnLeft()
  253. krss=x+1
  254.  
  255. for i=1,krss do
  256. turtle.forward()
  257. end
  258. turtle.turnLeft()
  259. turtle.forward()
  260.  
  261.  
  262.  
  263. krss=x
  264. for i=1,krss do
  265. inv()
  266. turtle.placeDown()
  267. turtle.forward()
  268. end
  269. turtle.forward()
  270. turtle.forward()
  271. turtle.forward()
  272. krss=x
  273. for i=1,krss do
  274. inv()
  275. turtle.placeDown()
  276. turtle.forward()
  277. end
  278.  
  279.  
  280. turtle.turnRight()
  281. krss=x+1
  282.  
  283. for i=1,krss do
  284. turtle.forward()
  285. end
  286. turtle.turnRight()
  287. turtle.forward()
  288.  
  289.  
  290.  
  291. krss=x
  292. for i=1,krss do
  293. inv()
  294. turtle.placeDown()
  295. turtle.forward()
  296. end
  297. turtle.forward()
  298. turtle.forward()
  299. turtle.forward()
  300. krss=x
  301. for i=1,krss do
  302. inv()
  303. turtle.placeDown()
  304. turtle.forward()
  305. end
  306.  
  307.  
  308.  
  309.  
  310.  
  311. ------------
  312.  
  313. turtle.turnLeft()
  314. krss=x+1
  315.  
  316. for i=1,krss do
  317. turtle.forward()
  318. end
  319. turtle.turnLeft()
  320. turtle.forward()
  321.  
  322.  
  323.  
  324. krss=x
  325. for i=1,krss do
  326. inv()
  327. turtle.placeDown()
  328. turtle.forward()
  329. end
  330. turtle.forward()
  331. turtle.forward()
  332. turtle.forward()
  333. krss=x
  334. for i=1,krss do
  335. inv()
  336. turtle.placeDown()
  337. turtle.forward()
  338. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement