bigtwisty

shaft

Apr 21st, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. --name shaft
  2. --version 1.1a
  3.  
  4. local args = {...}
  5. local compare = 0
  6.  
  7. torches = false
  8.  
  9. if #args == 1 then
  10. compare = tonumber(args[1])
  11. end
  12.  
  13. local function dig()
  14. if compare > 0 then
  15. for i=1,compare do
  16. turtle.select(i+1)
  17. if turtle.compare() then
  18. while turtle.detect() do
  19. os.sleep(0.1)
  20. end
  21. end
  22. end
  23. end
  24. turtle.dig()
  25. end
  26.  
  27. local function digDown()
  28. if compare > 0 then
  29. for i=1,compare do
  30. turtle.select(i+1)
  31. if turtle.compareDown() then
  32. while turtle.detectDown() do
  33. os.sleep(0.1)
  34. end
  35. end
  36. end
  37. end
  38. turtle.digDown()
  39. end
  40.  
  41. local function forward()
  42. while not turtle.forward() do
  43. dig()
  44. end
  45. end
  46.  
  47. digDown()
  48. while true do
  49. for i=1,10 do
  50. forward()
  51. digDown()
  52. end
  53. if torches then
  54. turtle.turnLeft()
  55. dig()
  56. turtle.select(1)
  57. turtle.place()
  58. turtle.turnRight()
  59. end
  60. while not turtle.detectDown() do
  61. os.sleep(0.1)
  62. end
  63. turtle.digDown()
  64. end
Advertisement
Add Comment
Please, Sign In to add comment