SHARE
TWEET

miner

a guest May 26th, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function mineSection()
  2.     turtle.dig()
  3.     turtle.forward()
  4.     turtle.digUp()
  5. end
  6.  
  7. function doesTurtleHaveSpace()
  8.     return turtle.getItemCount(16) == 0
  9. end
  10.  
  11. function fuelUpBaby()
  12.     for i = 1, 16, 1 do
  13.         turtle.refuel(i)
  14.     end
  15. end
  16.  
  17. function goHome(index)
  18.     fuelUpBaby()
  19.     for i = 0, index, 1 do
  20.         turtle.back()
  21.     end
  22. end
  23.  
  24. function tunnel()
  25.     index = 0
  26.     while doesTurtleHaveSpace() do
  27.         mineSection()
  28.         index = index + 1
  29.     end
  30.     return index
  31. end
  32.  
  33. function clearStones()
  34.     for i = 1, 16, 1 do
  35.         data = turtle.getItemDetail(i)
  36.         if data ~= nil then
  37.             if data.name == "minecraft:cobblestone" or data.name == "minecraft:stone" then
  38.                 turtle.select(i)
  39.                 turtle.transferTo(1)
  40.                 turtle.select(i)
  41.                 turtle.drop()
  42.             end
  43.         end
  44.     end
  45.     turtle.select(1)
  46. end
  47.  
  48. function main()
  49.     index = 0
  50.    
  51.     while doesTurtleHaveSpace() do
  52.         index = index + tunnel()
  53.         clearStones()
  54.     end
  55.    
  56.     goHome(index)
  57. end
  58.  
  59. turtle.refuel()
  60. main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top