SHARE
TWEET

miner

a guest May 26th, 2019 75 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.drop()
  40.             end
  41.         end
  42.     end
  43.     turtle.select(1)
  44. end
  45.  
  46. function main()
  47.     index = 0
  48.    
  49.     while doesTurtleHaveSpace() do
  50.         index = index + tunnel()
  51.         clearStones()
  52.     end
  53.    
  54.     goHome(index)
  55. end
  56.  
  57. turtle.refuel()
  58. 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