Feed The Beast Wiki

Follow the Feed The Beast Wiki on Discord or Mastodon!

READ MORE

Feed The Beast Wiki
Advertisement
Mining Turtle

ModComputerCraft
TypeMachine

The Mining Turtle is a block added by ComputerCraft, extending the functionality of the Turtle. It allows the turtle to not only place and interact with blocks, but also break them.

Recipe

Usage

The mining turtle is most commonly used as an early-game form of automatic mining. It is relatively cheap to maintain, however you must first find a diamond pickaxe. Once the user has obtained a diamond pickaxe, the turtle must only be supplied will coal (or another form of fuel) to keep running. It is able to find coal for itself while mining, lowering the maintenance required. The following is a sample mining program:

local args = {...}

local stripLength = 32

if not #args == 1 then
  print("Usage: smine <mines>")
  return
end

function strip()
  for i=1,stripLength do
    checkFuel()
    checkInv()
    while not turtle.forward() do turtle.dig() end
    while turtle.detectUp() do
      turtle.digUp()
      sleep(0.2)
    end
    while turtle.detectDown() do
      turtle.digDown()
      sleep(0.2)
    end
    
    if i%8 == 0 then
      turtle.select(16)
      while not turtle.forward() do turtle.dig() end
      while turtle.detectUp() do
        turtle.digUp()
        sleep(0.2)
      end
      if not turtle.back() then
        turtle.turnLeft()
        turtle.turnLeft()
        while not turtle.forward do turtle.dig() end
        turtle.turnLeft()
        turtle.turnLeft()
      end
      turtle.placeUp()
      turtle.select(1)
    end
  end
  
  turtle.turnLeft()
  turtle.turnLeft()
  
  for i=1,stripLength do
    while not turtle.forward() do turtle.dig() end
  end
end

function checkFuel()
  if turtle.getFuelLevel() <= 64 then
    print("Error: Low fuel")
    for i=1,14 do
      turtle.select(i)
      turtle.refuel()
    end
  end
end

function checkInv()
  isFull = true
  
  for i=1,14 do
    if turtle.getItemCount(i) == 0 then
      isFull = false
    end
  end
  
  if isFull == true then
    turtle.select(15)
    while not turtle.placeDown() do turtle.digDown() end
    for i=1,14 do
      turtle.select(i)
      turtle.dropDown()
    end
  end
end

print("Place torches in slot 16")
print("Place chest/s in slot 15 (will be automatically placed and filled when inventory is full)")

for x=1,args[1] do
  turtle.turnLeft()
  strip()
  strip()
  turtle.turnRight()
  for y=1,3 do turtle.forward() end
end

This program can be downloaded in-game by running the command: pastebin get Df8Q6xp7 smine


Advertisement