portablejim

Strip Mine (No Enderchests)

Mar 29th, 2013 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. local GRAVEL_FALL_TIME = 0.6
  2. local ENDERCHEST_FAIL_WAIT_TIME = 0.5
  3. local SLOT_ENDERCHEST_ITEMS = 1
  4. local SLOT_ENDERCHEST_FUEL = 2
  5. local SLOT_MINING = 2
  6.  
  7. function mine1()
  8. while turtle.detectUp() do
  9. turtle.digUp()
  10. sleep(GRAVEL_FALL_TIME)
  11. end
  12. while turtle.detect() do
  13. turtle.dig()
  14. sleep(GRAVEL_FALL_TIME)
  15. end
  16. turtle.digDown()
  17. while not turtle.forward() do
  18. turtle.dig()
  19. sleep(GRAVEL_FALL_TIME)
  20. end
  21. end
  22.  
  23. function mine1row()
  24. for i=1,45 do
  25. mine1()
  26. end
  27. end
  28.  
  29. function mine2rows()
  30. mine1row()
  31. turtle.turnLeft()
  32. mine1()
  33. mine1()
  34. mine1()
  35. mine1()
  36. turtle.turnLeft()
  37. mine1row()
  38. end
  39.  
  40. function mineFull(length)
  41. for i=1,length do
  42. turtle.select(2)
  43. turtle.turnRight()
  44. mine2rows()
  45. turtle.turnRight()
  46. print("Continuing row ", i)
  47. mine1()
  48. mine1()
  49. mine1()
  50. mine1()
  51. turtle.turnLeft()
  52. turtle.turnLeft()
  53. turtle.select(SLOT_ENDERCHEST_ITEMS)
  54. while not turtle.place() do -- Place down enderchest
  55. turtle.dig()
  56. end
  57. for j=2,16 do
  58. turtle.select(j)
  59. turtle.drop()
  60. end
  61. turtle.turnLeft()
  62. turtle.turnLeft()
  63. end
  64. end
  65.  
  66. function mineReturn()
  67. mineFull(32)
  68. end
  69.  
  70. mineReturn()
Add Comment
Please, Sign In to add comment