Advertisement
Spatzenhirn123

Complete Chunkmining by a Mining-Turtle based on Enderchests

May 19th, 2014
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.98 KB | None | 0 0
  1. --Introduction to my mining program--------------------------------------------------------------------------------------
  2. --
  3. --Autor: Spatzenhirn123
  4. --
  5. --Welcome to my turtle-mining-program!
  6. --Feel free to use and share my program.
  7. --
  8. --REQUIREMENTS !!!
  9. --1xMining-Turtle
  10. --3xEnderchest (MOD: EnderStorage)
  11. --  -1 for all mined blocks            // turtle-slot [1]       -Needs to be emptied!
  12. --  -1 for refueling coal              // turtle-slot [2]       -Recommended to fill automatically
  13. --  -1 for Bricks to build the surface // turtle-slot [3]       -Recommended to fill automatically
  14. --
  15. --Recommended:
  16. --1xSpotloader in turtle-slot [4] (MOD: ChickenChunks)
  17. --
  18. --Set-Up:
  19. --1. Place the turtle in the bottom-left corner of a chunk (press F9 to see borders).
  20. --2. Fill the turtle-slots.
  21. --3. Run: "#programname# startheight       //like: "Mining 73"
  22. --4. Have Fun! :D
  23. --
  24. -------------------------------------------------------------------------------------------------------------------------
  25. --CODE-------------------------------------------------------------------------------------------------------------------
  26. -------------------------------------------------------------------------------------------------------------------------
  27. --Start height
  28.     local args = {...}
  29.     a = args[1]-1
  30.  
  31. --Startcheck: Fuel-------------------------------------------------------------------------------------------------------
  32. function Start()
  33.         shell.run("label set Ender-Mine")
  34.     while turtle.getFuelLevel()<(136*a+10000) do
  35.                 turtle.select(2)
  36.         turtle.placeUp()
  37.         turtle.suckUp()
  38.         shell.run("refuel all")
  39.         turtle.select(2)
  40.         turtle.digUp()
  41.         end
  42.        
  43.     turtle.select(4)
  44.     turtle.up()
  45.     turtle.placeUp()
  46.     turtle.select(1)
  47.     turtle.down()
  48.  
  49.         print(" ")
  50.         print("--------------------------------")
  51.         print("Starting Quarry!")
  52.         print("--------------------------------")
  53. end
  54.  
  55.  
  56.  
  57. --Items to Ender-Chest---------------------------------------------------------------------------------------------------
  58. function Item()
  59.         turtle.dig()
  60.         turtle.select(1)
  61.         turtle.placeUp()
  62.         for i=4,16,1 do
  63.                 turtle.select(i)
  64.                 turtle.dropUp()
  65.         end
  66.         turtle.select(1)
  67.         turtle.digUp()
  68. end
  69.  
  70.  
  71.  
  72. --End: Go back to the startposition--------------------------------------------------------------------------------------
  73. function E()
  74.         turtle.turnLeft()
  75.         for e=1,15,1 do
  76.                 turtle.forward()
  77.         end
  78.         turtle.turnLeft()
  79.         for e=1,15,1 do
  80.                 turtle.forward()
  81.         end
  82.         turtle.turnLeft()
  83.         turtle.turnLeft()
  84. end
  85.  
  86.  
  87. --Chunkbreak-------------------------------------------------------------------------------------------------------------
  88. function C()
  89.     turtle.up()
  90.     turtle.select(4)
  91.     turtle.digUp()
  92.     turtle.select(1)
  93.     turtle.down()
  94. end
  95.  
  96.  
  97. --Build Flat-Ground------------------------------------------------------------------------------------------------------
  98. --Get Bricks
  99. function Bricks()
  100.     while turtle.getItemSpace(4)>0 do
  101.                 turtle.select(3)
  102.         turtle.placeUp()
  103.         turtle.select(4)
  104.         turtle.suckUp()
  105.         turtle.select(3)
  106.         turtle.digUp()
  107.         turtle.select(4)
  108.     end
  109. end
  110. --Building
  111. function D()
  112.     for d=1,3,1 do
  113.         Bricks()
  114.                 for c=1,2,1 do
  115.                         turtle.turnRight()
  116.                         turtle.placeDown()
  117.                         for r=1,15,1 do
  118.                                 turtle.forward()
  119.                                 turtle.placeDown()
  120.                         end
  121.                         turtle.turnLeft()
  122.                         turtle.forward()
  123.                         turtle.turnLeft()
  124.                         turtle.placeDown()
  125.                         for r=1,15,1 do
  126.                                 turtle.forward()
  127.                                 turtle.placeDown()
  128.                         end    
  129.                         turtle.turnRight()
  130.                         turtle.forward()
  131.                 end
  132.         end
  133.         Bricks()
  134.         turtle.turnRight()
  135.         turtle.placeDown()
  136.         for r=1,15,1 do
  137.                 turtle.forward()
  138.                 turtle.placeDown()
  139.         end
  140.         turtle.turnLeft()
  141.         turtle.forward()
  142.         turtle.turnLeft()
  143.         turtle.placeDown()
  144.         for r=1,15,1 do
  145.                 turtle.forward()
  146.                 turtle.placeDown()
  147.         end
  148.         turtle.turnRight()
  149.         turtle.forward()
  150.        
  151.         turtle.turnRight()
  152.         turtle.placeDown()
  153.         for r=1,15,1 do
  154.                 turtle.forward()
  155.                 turtle.placeDown()
  156.         end
  157.         turtle.turnLeft()
  158.         turtle.forward()
  159.         turtle.turnLeft()
  160.         turtle.placeDown()
  161.         for r=1,15,1 do
  162.                 turtle.forward()
  163.                 turtle.placeDown()
  164.         end
  165.  
  166.         turtle.turnLeft()
  167.         for r=1,15,1 do
  168.                 turtle.forward()
  169.         end
  170.         turtle.turnLeft()
  171.         turtle.turnLeft()
  172.     Item()
  173. end
  174.  
  175.  
  176. --Mining forms-----------------------------------------------------------------------------------------------------------
  177. --Watercheck()
  178. function Mine()
  179.     turtle.dig()
  180. --  if turtle.detect()==true then
  181. --      turtle.place()
  182. --      turtle.dig()
  183. --  end
  184. end
  185.  
  186. function MineDown()
  187.     turtle.digDown()
  188. --  if turtle.detectDown()==true then
  189. --      turtle.placeDown()
  190. --      turtle.digDown()
  191. --  end
  192. end
  193.  
  194. function Next()
  195.     Mine()
  196.     turtle.forward()
  197.     Mine()
  198.     turtle.forward()
  199.     Mine()
  200. end
  201. -------------------------------------------------------------------------------------------------------------------------
  202. --Next position
  203. function PR()
  204.         Mine()
  205.         turtle.forward()
  206.         turtle.turnRight()
  207.         Mine()
  208.         turtle.forward()
  209.         Mine()
  210.         turtle.forward()
  211.         Mine()
  212.         turtle.turnRight()
  213.         Mine()
  214. end
  215. function PL()
  216.         Mine()
  217.         turtle.forward()
  218.         turtle.turnLeft()
  219.         Mine()
  220.         turtle.forward()
  221.         Mine()
  222.         turtle.forward()
  223.         Mine()
  224.         turtle.turnLeft()
  225.         Mine()
  226. end
  227. -------------------------------------------------------------------------------------------------------------------------
  228. function L()
  229.         for t=1,8,1 do
  230.                 MineDown()
  231.                 turtle.turnRight()
  232.                 Mine()
  233.                 turtle.turnLeft()
  234.                 Mine()
  235.                 while turtle.down()==true do
  236.                         MineDown()
  237.                         Mine()
  238.                         turtle.turnRight()
  239.                         Mine()
  240.                         turtle.down()
  241.                         MineDown()
  242.                         Mine()
  243.                         turtle.turnLeft()
  244.                         Mine()
  245.                 end
  246.         for u=1,a,1 do
  247.                         turtle.digUp()
  248.                         turtle.up()
  249.                 end
  250.                 Item()
  251.                 if t<8 then
  252.                         Next()
  253.                 end
  254.         end
  255. end
  256.  
  257.  
  258. -------------------------------------------------------------------------------------------------------------------------
  259. function T()
  260.         for t=1,8,1 do
  261.                 MineDown()
  262.                 turtle.turnRight()
  263.                 Mine()
  264.                 turtle.turnLeft()
  265.                 Mine()
  266.                 turtle.turnLeft()
  267.                 Mine()
  268.                 while turtle.down()==true do
  269.                         MineDown()
  270.                         Mine()
  271.                         turtle.turnRight()
  272.                         Mine()
  273.                         turtle.turnRight()
  274.                         Mine()
  275.                         turtle.down()
  276.                         MineDown()
  277.                         Mine()
  278.                         turtle.turnLeft()
  279.                         Mine()
  280.                         turtle.turnLeft()
  281.                         Mine()
  282.                 end
  283.                 turtle.turnRight()
  284.         for u=1,a,1 do
  285.                         turtle.digUp()
  286.                         turtle.up()
  287.                 end
  288.                 Item()
  289.                 if t<8 then
  290.                         Next()
  291.                 end
  292.         end
  293. end
  294.  
  295.  
  296. -------------------------------------------------------------------------------------------------------------------------
  297. function I()
  298.         Mine()
  299.         turtle.forward()
  300.         turtle.turnLeft()
  301.         Mine()
  302.         turtle.forward()
  303.         turtle.turnLeft()
  304.         turtle.forward()
  305.         Mine()
  306.         for t=1,4,1 do
  307.                 MineDown()
  308.                 Mine()
  309.                 turtle.turnRight()
  310.                 turtle.turnRight()
  311.                 Mine()
  312.                 turtle.turnLeft()
  313.                 turtle.turnLeft()
  314.                 while turtle.down()==true do
  315.                         MineDown()
  316.                         Mine()
  317.                         turtle.turnRight()
  318.                         turtle.turnRight()
  319.                         Mine()
  320.                         turtle.down()
  321.                         MineDown()
  322.                         Mine()
  323.                         turtle.turnRight()
  324.                         turtle.turnRight()
  325.                         Mine()
  326.                 end
  327.         for u=1,a,1 do
  328.                         turtle.digUp()
  329.                         turtle.up()
  330.                 end
  331.                 Item()
  332.                 if t<4 then
  333.                         Next()
  334.                         Next()
  335.                 else
  336.                         Next()
  337.                 end
  338.         end
  339. end
  340.  
  341.  
  342. -------------------------------------------------------------------------------------------------------------------------
  343. --Actions----------------------------------------------------------------------------------------------------------------
  344. -------------------------------------------------------------------------------------------------------------------------
  345.  
  346.  
  347.     Start()
  348.     L()
  349.     for w=1,3,1 do
  350.         PR()
  351.         T()
  352.         PL()
  353.         T()
  354.     end
  355.     PR()
  356.     T()
  357.     I()
  358.     E()
  359.     D()
  360.     C()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement