Advertisement
Nicro

Quarry cover prototype miningless

Dec 31st, 2014
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. local currSlot = 1
  2. local movefail = 0
  3. local startfail = 1
  4.  
  5. local function refuel()
  6. if turtle.getFuelLevel() < 10 then
  7. print("I ran out of fuel.")
  8. error()
  9. end
  10. end
  11.  
  12. local function material()
  13. turtle.select(currSlot)
  14. if turtle.compareTo(16) then
  15. else
  16. turtle.drop()
  17. end
  18. while turtle.getItemCount() == 0 do
  19. if currSlot == 16 then
  20. print("I ran out of material.")
  21. error()
  22. end
  23. currSlot = currSlot+1
  24. return material()
  25. end
  26. end
  27. local function advDig()
  28. if turtle.detect() then
  29. print("I ran into something.")
  30. print("Please note that I need")
  31. print("one block of space around the hole")
  32. print("to move.")
  33. print(.)
  34. print("If I were a mining turtle,")
  35. print("I would take care of that myself.")
  36. error()
  37. end
  38. end
  39.  
  40.  
  41. while true do
  42. advDig()
  43. refuel()
  44. material()
  45. turtle.select(currSlot)
  46. if turtle.detectDown() and startfail == 1 then
  47. print("I think I started in the wrong spot, ")
  48. print("please place me in a")
  49. print("valid starting position.")
  50. error()
  51. end
  52. if startfail == 1 then
  53. startfail = 0
  54. end
  55. if turtle.detectDown() then
  56. movefail = movefail+1
  57. if movefail > 1 then
  58. print("I think I am done.")
  59. error()
  60. else turtle.back()
  61. turtle.turnRight()
  62. end
  63. else
  64. movefail = 0
  65. turtle.placeDown()
  66. end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement