dveth

mainShaft

Nov 23rd, 2020 (edited)
1,521
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local SLOT_COUNT = 16
  2.  
  3. local length = 30
  4.  
  5. local counter = 7
  6.  
  7. function turnAround()
  8.     turtle.turnRight()
  9.     turtle.turnRight()
  10. end
  11.  
  12. function getItemIndex(itemName)
  13.     for slot = 1, SLOT_COUNT, 1 do
  14.         local item = turtle.getItemDetail(slot)
  15.         if(item ~= nil) then
  16.             if(item["name"] == itemName) then
  17.                 return slot
  18.             end
  19.         end
  20.     end
  21. end
  22.  
  23. function placeTorch()
  24.     if getItemIndex("minecraft:torch") then
  25.         local torchIndex = getItemIndex("minecraft:torch")
  26.         turnAround()
  27.         turtle.select(torchIndex)
  28.         turtle.place()
  29.         turnAround()
  30.     end
  31. end
  32.  
  33. for i = 1, length do
  34.     while turtle.detect() do
  35.         turtle.dig()
  36.     end
  37.     turtle.forward()
  38.     turtle.digUp()
  39.    
  40. end
  41. turtle.turnRight()
  42. while turtle.detect() do
  43.     turtle.dig()
  44. end
  45. turtle.forward()
  46. turtle.digUp()
  47. turtle.turnRight()
  48.  
  49. for i = 1, length -1 do
  50.     while turtle.detect() do
  51.         turtle.dig()
  52.     end
  53.     turtle.forward()
  54.     turtle.digUp()
  55.     counter = counter - 1
  56.     if counter == 0 then
  57.         placeTorch()
  58.         counter = 7
  59.     end
  60. end
  61. turtle.turnLeft()
  62. while turtle.detect() do
  63.     turtle.dig()
  64. end
  65. turtle.forward()
  66. turtle.digUp()
  67. turtle.turnLeft()
  68. for i = 1, length -1 do
  69.     while turtle.detect() do
  70.         turtle.dig()
  71.     end
  72.     turtle.forward()
  73.     turtle.digUp()
  74. end
  75. for i = 1, length do
  76.     turtle.back()
  77. end
  78.  
RAW Paste Data