Advertisement
ebsc

Untitled

Mar 4th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. --http://pastebin.com/FYV6bmu3
  2.  
  3.  
  4. local howmany = {...}
  5.  
  6. local function toBedrock(num)
  7.     local howmany = tonumber(num)
  8.     local startY = 0
  9.     local completed = 0
  10.     local notBedrock = true
  11.  
  12.     local function returnToSurface()
  13.         while startY < 0 do
  14.             if turtle.getFuelLevel() == 0 then
  15.                     turtle.refuel(1)
  16.             end
  17.             turtle.up()
  18.             startY = startY + 1
  19.             print(startY)
  20.         end
  21.     end
  22.  
  23.     local function digToBedrock()
  24.         while notBedrock do
  25.             if turtle.getFuelLevel() == 0 then
  26.                     turtle.refuel(1)
  27.             end
  28.             turtle.digDown()
  29.             notBedrock = turtle.down()
  30.             print(startY)
  31.             if not notBedrock then
  32.                 returnToSurface()
  33.                 break
  34.             else
  35.                 startY = startY - 1
  36.             end
  37.         end
  38.     end
  39.  
  40.     while completed < howmany do
  41.         digToBedrock()
  42.         turtle.dig()
  43.         turtle.forward()
  44.         completed = completed + 1
  45.         notBedrock = true
  46.     end
  47. end
  48.  
  49. toBedrock(howmany[1])
  50.  
  51. -- local startY = 0
  52. -- local completed = 0
  53. -- local notBedrock = true
  54.  
  55. -- local function returnToSurface()
  56. --     while startY < 0 do
  57. --         if turtle.getFuelLevel() == 0 then
  58. --                 turtle.refuel(1)
  59. --         end
  60. --         turtle.up()
  61. --         startY = startY + 1
  62. --         print(startY)
  63. --     end
  64. -- end
  65.  
  66. -- local function digToBedrock()
  67. --     while notBedrock do
  68. --         if turtle.getFuelLevel() == 0 then
  69. --                 turtle.refuel(1)
  70. --         end
  71. --         turtle.digDown()
  72. --         notBedrock = turtle.down()
  73. --         print(startY)
  74. --         if not notBedrock then
  75. --             returnToSurface()
  76. --             break
  77. --         else
  78. --             startY = startY - 1
  79. --         end
  80. --     end
  81. -- end
  82.  
  83. -- while completed < tonumber(howmany[1]) do
  84. --     digToBedrock()
  85. --     turtle.dig()
  86. --     turtle.forward()
  87. --     completed = completed + 1
  88. --     notBedrock = true
  89. -- end
  90.  
  91. -- digToBedrock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement