Advertisement
Guest User

quarry

a guest
Dec 25th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.95 KB | None | 0 0
  1. print("If you want to dig more than 1 square you should have an ender chest 0 blocks away from the left side of the turtle, otherwise you can have any inventory at any distance from the left side of the turtle. If you are digging only one square then the first 2 slots are used for diamonds and one other important item, put one item in each slot (Diamond is not a most).  How many squares you wanna dig? (Size and the depth can be decided next)")
  2.  
  3. zek=read()
  4.  
  5. mumu=zek
  6.  
  7. mumu=mumu+0
  8.  
  9. print("Type 1 to turn on automatic refueling (using the coal instead of banking it), and 0 to have it off.(Recommended to have it on if digging more than one square)")
  10.  
  11. zex=read()
  12.  
  13. jogo=zex
  14.  
  15. jogo=jogo+0
  16.  
  17. local p=0
  18.  
  19. function mustrefuel()
  20.  
  21. for i=1,16 do
  22.  
  23. turtle.select(i)
  24.  
  25. turtle.refuel()
  26.  
  27. turtle.select(1)
  28.  
  29. end
  30. end
  31.  
  32. function home()
  33. turtle.turnLeft()
  34. turtle.select(3)
  35. turtle.dig()
  36. os.sleep(0)
  37. for tp=1,mumu do
  38. turtle.select(4)
  39. turtle.digUp()
  40. function walk1()
  41. for i=1,gf do
  42. while not turtle.forward() do
  43. turtle.dig()
  44. turtle.attack()
  45. end
  46. end
  47. end
  48. walk1()
  49. turtle.select(4)
  50. turtle.placeUp()
  51. turtle.turnRight()
  52. turtle.turnRight()
  53. walk1()
  54. turtle.turnRight()
  55. turtle.dig()
  56. turtle.turnRight()
  57. walk1()
  58. turtle.turnLeft()
  59. turtle.place()
  60. turtle.turnRight()
  61. end
  62. os.shutdown()
  63. end
  64.  
  65. function refuel()
  66.  
  67. if jogo==1 then
  68.  
  69. mustrefuel()
  70.  
  71. end
  72. end
  73.  
  74. v=turtle.getFuelLevel()
  75.  
  76. print("The fuel level is  "..v.." (4000 is a safe fuel level for mid sized digging -5*5*60- ) , if u want to refuel place fuel in the turtle during the next 20 secs.")
  77.  
  78. sleep(20)
  79.  
  80. mustrefuel()
  81.  
  82. os.sleep(1)
  83.  
  84. print("What is the wedth of the minning area u want to mine? (This quarry will mine only squares)")
  85.  
  86. x=read()
  87.  
  88. gf=x
  89.  
  90. gf=gf-0
  91.  
  92. v=x
  93.  
  94. v=v-0
  95.  
  96. while v>0 do
  97.  
  98. v=v-2
  99.  
  100. if v==0 then
  101.  
  102.  c=0
  103.  
  104. end
  105.  
  106. if v<0 then
  107.  
  108.  c=1
  109.  
  110. end
  111.  
  112. end
  113.  
  114. print("What is the Y ?")
  115.  
  116. y=read()
  117.  
  118. y=y-5
  119.  
  120. print("How far is the chest from the left side of the turtle?")
  121.  
  122. g=read()
  123.  
  124. print("Remember to put 1 chunk loader if you are going to be away from the turtle, and two if you are digging more than one square. Put one behind its starting point and another above it.How many layers do you want to skip?")
  125.  
  126. s=read()
  127.  
  128. for jhg=1,zek do
  129.  
  130. for i=1,s do
  131.  
  132.  
  133. while not turtle.down() do
  134. turtle.digDown()
  135. turtle.attackDown()
  136. end
  137.  
  138. end
  139.  
  140. m=x/2
  141.  
  142. t=x-1
  143.  
  144.  
  145. function bank()
  146. refuel()
  147. turtle.select(16)
  148. w=turtle.getItemCount(16)
  149. kl=turtle.getFuelLevel()
  150. if w>0 or kl<500 then
  151. refuel()
  152. for z=1,p+s do
  153. while not turtle.up() do
  154. turtle.digUp()
  155. turtle.attackUp()
  156. end
  157. end
  158. turtle.turnLeft()
  159.  
  160. for i=1,g do
  161.  
  162. while not turtle.forward() do
  163. turtle.dig()
  164. turtle.attack()
  165. end
  166. end
  167.  
  168. for l=3,16 do
  169. turtle.select(l)
  170. turtle.drop()
  171. end
  172. turtle.select(1)
  173. turtle.turnRight()
  174. if kl<500 then
  175. home()
  176. end
  177. turtle.turnRight()
  178.  
  179. for i=1,g do
  180.  
  181. while not turtle.forward() do
  182. turtle.dig()
  183. turtle.attack()
  184. end
  185. end
  186.  
  187. turtle.turnLeft()
  188.  
  189. for k=1,p+s do
  190. while not turtle.down() do
  191. turtle.digDown()
  192. turtle.attackDown()
  193. end
  194. end
  195. end
  196. turtle.select(1)
  197. end
  198. function start()
  199.  
  200. while not turtle.down() do
  201. turtle.digDown()
  202. turtle.attackDown()
  203. end
  204.  
  205.  
  206. end
  207.  
  208. function dig()
  209.  
  210. for i=1,t do
  211.  
  212. os.sleep(0)
  213.  
  214. while not turtle.forward() do
  215. os.sleep(0)
  216. turtle.dig()
  217. turtle.attack()
  218. end
  219.  
  220. end
  221.  
  222. end
  223.  
  224. function turnR()
  225.  
  226. turtle.turnRight()
  227.  
  228. while not turtle.forward() do
  229. turtle.dig()
  230. turtle.attack()
  231. end
  232.  
  233. turtle.turnRight()
  234.  
  235. end
  236.  
  237. function turnL()
  238.  
  239. turtle.turnLeft()
  240.  
  241. os.sleep(0)
  242. while not turtle.forward() do
  243. os.sleep(0)
  244. turtle.dig()
  245. os.sleep(0)
  246. turtle.attack()
  247. os.sleep(0)
  248. end
  249. os.sleep(0)
  250. turtle.turnLeft()
  251.  
  252. end
  253.  
  254. for z=1,y-s do
  255.  
  256. os.sleep(0)
  257.  
  258. start()
  259.  
  260. for i=1,m do
  261.  
  262. dig()
  263. turnR()
  264. dig()
  265. turnL()
  266.  
  267.  
  268. end
  269.  
  270. if c==1 then
  271.  for i=2,x do  
  272.   while not turtle.forward() do  
  273.    turtle.dig()
  274.    turtle.attack()
  275.   end
  276.  end
  277.  turtle.turnLeft()
  278.  turtle.turnLeft()
  279.  for i=2,x do
  280.   while not turtle.forward() do
  281.    turtle.dig()
  282.    turtle.attack()
  283.    end
  284.   end
  285.  turtle.turnLeft()
  286.  turtle.turnLeft()  
  287. end
  288. turtle.turnLeft()
  289. for v=1,x-c do
  290. while not turtle.forward() do
  291.  turtle.attack()
  292.  turtle.dig()
  293.  end
  294. end
  295. turtle.turnRight()
  296. p=p+1
  297. bank()
  298. end
  299.  
  300. for i=1,y do
  301. while not turtle.up() do
  302. turtle.digUp()
  303. turtle.attackUp()
  304. end
  305. end
  306. turtle.turnLeft()
  307. for i=1,16 do
  308.  turtle.select(i)
  309.  turtle.drop()
  310. end
  311. turtle.select(1)
  312. turtle.dig()
  313. turtle.select(2)
  314. turtle.turnLeft()
  315. turtle.dig()
  316. turtle.turnLeft()
  317. function walk()
  318. for i=1,gf do
  319.  while not turtle.forward() do
  320.  turtle.dig()
  321.  turtle.attack()
  322. end
  323. end
  324. end
  325. walk()
  326. turtle.turnRight()
  327. turtle.select(2)
  328. function place()
  329. while not turtle.place() do
  330. turtle.dig()
  331. turtle.attack()
  332. end
  333. end
  334. place()
  335. function placeUp()
  336. while not turtle.placeUp() do
  337. turtle.digUp()
  338. turtle.attackUp()
  339. end
  340. end
  341. turtle.turnRight()
  342. walk()
  343. turtle.digUp()
  344. turtle.turnRight()
  345. turtle.turnRight()
  346. walk()
  347. turtle.turnLeft()
  348. turtle.select(2)
  349. placeUp()
  350. turtle.turnLeft()
  351. turtle.select(1)
  352. turtle.place()
  353. turtle.turnRight()
  354.  
  355. end
  356.  
  357. home()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement