Advertisement
ScoutMaester

Untitled

Jan 7th, 2021 (edited)
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. block = turtle.inspect()
  2. item = turtle.getItemDetail()
  3. tunnelLength = 0
  4. branchLength = 0
  5. facing = 1
  6. interval = 0
  7. select = 1
  8. endLoop = 0
  9.  
  10. function right()
  11.     turtle.turnRight()
  12.     facing = facing + 1
  13.     if facing == 5 then
  14.         facing = 1
  15.     else
  16.         facing = facing
  17.     end
  18. end
  19.  
  20. function left()
  21.     turtle.turnLeft()
  22.     facing = facing - 1
  23.     if facing == 0 then
  24.         facing = 4
  25.     else
  26.         facing = facing
  27.     end
  28. end
  29.  
  30. function turnAround()
  31.     left()
  32.     left()
  33.     sleep(2)
  34. end
  35.  
  36. function Tforward()
  37.     turtle.dig()
  38.     turtle.digUp()
  39.     if turtle.detectDown() == false then
  40.         select = 1
  41.         while turtle.getItemDetail("minecraft:cobblestone") == false do
  42.             turtle.select(select)
  43.             select = select + 1
  44.             if select == 17 then
  45.                 select = 1
  46.             end
  47.         turtle.placeDown()
  48.         end
  49.     end
  50.     turtle.forward()
  51.     tunnelLength = tunnelLength + 1
  52. end
  53.  
  54. function Bforward()
  55.     turtle.dig()
  56.     turtle.digUp()
  57.     if turtle.detectDown() == false then
  58.         select = 1
  59.         while turtle.getItemDetail("minecraft:cobblestone") == false do
  60.             turtle.select(select)
  61.             select = select + 1
  62.             if select == 17 then
  63.                 select = 1
  64.             end
  65.         end
  66.         turtle.placeDown()
  67.     end
  68.     turtle.forward()
  69.     branchLength = branchLength + 1
  70. end
  71.  
  72. function Treturn()
  73.     while facing ~= 3 do
  74.         right()
  75.     end
  76.     while tunnelLength > 0 do
  77.         tunnelLength = tunnelLength - 1
  78.         turtle.forward()
  79.     end
  80. end
  81.  
  82. function Breturn()
  83.     turnAround()
  84.     while branchLength > 0 do
  85.         branchLength = branchLength - 1
  86.         turtle.forward()
  87.     end
  88. end
  89.  
  90. function comeBack()
  91.     turnAround()
  92.     while branchLength > 0 do
  93.         Breturn()
  94.     end
  95.     while tunnelLength > 0 do
  96.         Treturn()
  97.     end
  98. end
  99.  
  100. function dump()
  101.     for i = 1,16 do
  102.         turtle.select(i)
  103.         turtle.drop()
  104.     end
  105. end
  106.  
  107. while true do
  108.     select = 1
  109.     while turtle.getFuelLevel() < 1024 do
  110.         turtle.refuel(1)
  111.         turtle.select(select)
  112.         select = select + 1
  113.     end
  114.     turnAround()
  115.     turtle.inspect()
  116.     if turtle.inspect("minecraft:chest") then
  117.         print("Found chest")
  118.     else
  119.         print("I will dump here")
  120.     end
  121.     turnAround()
  122.     Tforward(interval)
  123.     right()
  124.     Bforward(30)
  125.     comeBack()
  126.     dump()
  127.     interval = interval + 3
  128.     turnAround()
  129. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement