Advertisement
FinnTronn

Mining Program 2021

Oct 31st, 2021 (edited)
3,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1. -- Minecraft Mining Automation via Computercraft Turtles by FinnTron
  2. -- V0.7 *31.10.2021
  3.  
  4. --Start Print
  5.  
  6.   print("Sucessful boot of Mining Program")
  7.   os.sleep(0.7)
  8.   print("Please put Cobblestone in Slot 1")
  9.   os.sleep(0.1)
  10.   print("Torches in Slot 2")
  11.   os.sleep(0.1)
  12.   print("Chest or an inplaceable Item in Slot 3")
  13.   os.sleep(0.1)
  14.   print("Please wait for instructions...")
  15.  
  16. --Set variables
  17.  
  18.   os.sleep(1.5)
  19.   print("Give the count of side strips:")
  20.   local a = read()
  21.   os.sleep(0.8)
  22.   print("Excavation started...")
  23.  
  24. --Functions
  25.  
  26.   function checkDown()
  27.    while turtle.detectDown() == false do
  28.     turtle.select(1)
  29.     turtle.placeDown()
  30.    end
  31.   end
  32.  
  33.   function forward()
  34.    while turtle.forward() == false do
  35.     turtle.dig()
  36.    end
  37.    while turtle.detectUp() == true do
  38.     turtle.digUp()
  39.    end
  40.    checkDown()
  41.   end
  42.    
  43.   function tunnel()
  44.    forward()
  45.    forward()   
  46.    forward()
  47.   end
  48.    
  49.    function doubleTurn()
  50.     turtle.turnLeft()
  51.     turtle.turnLeft()
  52.    end
  53.    
  54.    function sidestrip()
  55.     forward()
  56.     turtle.turnLeft()
  57.     for i = 1,3 do
  58.      forward()
  59.     end
  60.     doubleTurn()
  61.     for i = 1,6 do
  62.      forward()
  63.     end
  64.     doubleTurn()
  65.     for i = 1, 3 do
  66.      forward()
  67.     end
  68.     turtle.turnRight()
  69.    end
  70.    
  71.    function testItems()
  72.     if turtle.getItemCount(16) == 64 then
  73.      turtle.select(3)
  74.      doubleTurn()
  75.      turtle.place()
  76.      x = 3
  77.      while (x == 16) == false do
  78.       turtle.select(x + 1)
  79.       turtle.drop(64)
  80.       x = x + 1
  81.      end
  82.      doubleTurn()
  83.     end
  84.    end
  85.    
  86.    function torch()
  87.     turtle.back()
  88.     turtle.select(2)
  89.     turtle.placeUp()
  90.     turtle.forward()
  91.    end
  92.    
  93. --Mainprogram
  94.  
  95.   for i = 1,a do
  96.    tunnel()
  97.    sidestrip()
  98.    torch()
  99.    testItems()
  100.   end
  101.  
  102. --End print
  103.  
  104.   print("Excavation was sucessful.")
  105.   os.sleep(0.5)
  106.   print("Thank you for trusting our service.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement