Advertisement
Guest User

test1234124124

a guest
Jan 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1.  
  2. function mining()
  3.  
  4. remainingX = length
  5. remainingY = width
  6.  
  7. while remainingY>0 do
  8.  
  9. column()
  10. remainingY = remainingY-1
  11. if remainingY>0 then
  12. turtle.turnRight()
  13. turtle.dig()
  14. turtle.forward()
  15. turtle.digUp()
  16. turtle.digDown()
  17. turtle.turnRight()
  18. remainingX = length
  19. columnn()
  20. remainingY = remainingY-1
  21. if remainingY>0 then
  22. turtle.turnLeft()
  23. turtle.forward()
  24. turtle.turnLeft()
  25. end
  26. end
  27. end
  28. if (width % 2 == 1) then
  29. turtle.turnRight()
  30. turtle.turnRight()
  31. remainingX = length
  32. returnTrip()
  33. else
  34. returnTrip()
  35. end
  36. end
  37.  
  38. function column()
  39.  
  40. while remainingX>0 do
  41. turtle.dig()
  42. turtle.forward()
  43. turtle.digUp()
  44. turtle.digDown()
  45. remainingX = remainingX-1
  46. end
  47. end
  48.  
  49. function returnTrip()
  50.  
  51. remainingY = width
  52. while remainingX>0 do
  53. turtle.forward()
  54. remainingX = remainingX-1
  55. end
  56. turtle.turnRight()
  57. while remainingY>1 do
  58. turtle.forward()
  59. remainingY = remainingY-1
  60. end
  61. turtle.dropDown()
  62. end
  63.  
  64. function giveInfoPlease()
  65. write ("Quarry length (Max 500): ")
  66. answerL = read()
  67. if 0<answerL<500 then
  68. write ("Quarry width (Max 500): ")
  69. answerW = read()
  70. if 0<answerW<500 then
  71. MINE()
  72. else giveInfoPlease()
  73. end
  74. else giveInfoPlease()
  75. end
  76. end
  77.  
  78. giveInfoPlease()
  79.  
  80. fuelRequired = length*width+width
  81. print ("(fuelRequired) fuel required")
  82. print ("Current fuel level turtle.getFuelLevel()")
  83. write ("Continue? (y/n): ")
  84. local answer = read()
  85. if (local answer == y) then
  86. mining()
  87. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement