Advertisement
Spatzenhirn123

ZZ Left

Jan 6th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --// turtle-slot [1] Item
  2. --// turtle-slot [2] Coal
  3. -------------------------------------------------------------------------------------------------------------------------
  4. --CODE-------------------------------------------------------------------------------------------------------------------
  5. -------------------------------------------------------------------------------------------------------------------------
  6. --Start height
  7.     local args = {...}
  8.     a = 89-1           --Height
  9.     b = args[1]             --Mining Time
  10.  
  11. --Startcheck: Fuel-------------------------------------------------------------------------------------------------------
  12. function Start()
  13.     while turtle.getFuelLevel()<(2*a+1000) do
  14.                 turtle.select(2)
  15.         turtle.digDown()
  16.         turtle.placeDown()
  17.         turtle.suckDown()
  18.         shell.run("refuel all")
  19.         turtle.select(2)
  20.         turtle.digDown()
  21.         end
  22. end
  23.  
  24. --Items to Ender-Chest---------------------------------------------------------------------------------------------------
  25. function Item()
  26.         --Cobblestone
  27.         turtle.select(3)
  28.         turtle.placeDown()
  29.         for i=5,16,1 do
  30.                 turtle.select(i)
  31.                 if turtle.compareDown()==true then
  32.                         turtle.drop()
  33.                 end
  34.         end
  35.         turtle.select(3)
  36.         turtle.digDown()
  37.         turtle.drop(turtle.getItemCount(3)-1)
  38.         --Dirt
  39.         turtle.select(4)
  40.         turtle.placeDown()
  41.         for i=5,16,1 do
  42.                 turtle.select(i)
  43.                 if turtle.compareDown()==true then
  44.                         turtle.drop()
  45.                 end
  46.         end
  47.         turtle.select(4)
  48.         turtle.digDown()
  49.         turtle.drop(turtle.getItemCount(4)-1)
  50.         --Ores
  51.         turtle.select(1)
  52.         turtle.placeDown()
  53.         for i=5,16,1 do
  54.                 turtle.select(i)
  55.                 turtle.dropDown()
  56.         end
  57.         turtle.select(1)
  58.         turtle.digDown()
  59. end
  60.  
  61. --Mining actions---------------------------------------------------------------------------------------------------------
  62. function forward()
  63.     while turtle.forward()==false do
  64.         sleep(0.5)
  65.     end
  66. end
  67.  
  68. function up()
  69.     while turtle.up()==false do
  70.         sleep(0.5)
  71.     end
  72. end
  73.  
  74. --Mining Forms-----------------------------------------------------------------------------------------------------------
  75. function Mine()
  76.         Start()
  77.         turtle.digDown()
  78.         turtle.dig()
  79.         turtle.turnLeft()
  80.         turtle.dig()
  81.         turtle.turnLeft()
  82.         turtle.dig()
  83.         while turtle.down()==true do
  84.                 turtle.digDown()
  85.                 turtle.dig()
  86.                 turtle.turnRight()
  87.                 turtle.dig()
  88.                 turtle.turnRight()
  89.                 turtle.dig()
  90.                 turtle.down()
  91.         turtle.digDown()
  92.                 turtle.dig()
  93.                 turtle.turnLeft()
  94.                 turtle.dig()
  95.                 turtle.turnLeft()
  96.                 turtle.dig()
  97.         end
  98.         turtle.turnRight()
  99.     turtle.turnRight()
  100.         for p=1,a,1 do
  101.                 up()
  102.         end
  103.         Item()
  104. end
  105.  
  106.  
  107. function Next()
  108.     up()
  109.     for i=1,16,1 do
  110.         forward()
  111.     end
  112.     turtle.digDown()
  113.     turtle.down()
  114. end
  115.  
  116. -------------------------------------------------------------------------------------------------------------------------
  117. --Actions----------------------------------------------------------------------------------------------------------------
  118. -------------------------------------------------------------------------------------------------------------------------
  119. for t=1,b,1 do
  120.     Mine()
  121.     Next()
  122. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement