Turtle Quarry

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

thezeronumber

New Member
Jul 29, 2019
69
0
0
Oops, I meant a strip-mine and not a mineshaft, though I might do that anyway. Could have it place ladders as well as torches.
 

SuperFlorian12

New Member
Jul 29, 2019
16
0
0
Ok, so I post some of my programs. Maybe you can use them to learn. ;) My Stripmine Program is inefficient and messy. I realy should rewrite it.

Fuellevel:
Code:
print("Fuel: "..turtle.getFuelLevel())

"Dig" are some programs that dig and move a certain amount of time

Dig:
Code:
local tArgs = {...}
local move = 0
 
function dig()
  while not turtle.forward() do
      if turtle.dig() == false then
        turtle.attack()
      end
  end
end
 
if #tArgs < 1 then
  move = 1
else
  move = tArgs[1]
end
 
for i = 1, move do
  dig()
end
Just replace turtle.forward(), turtle.dig() and turtle.attack() with the up/down variants to go up/down.

DigBack:
Code:
local tArgs = {...}
local move = 0
local forward = 0
 
function turnAround()
  turtle.turnRight()
  turtle.turnRight()
end
 
function digBack()
  if forward == 0 then
      if turtle.back() == false then
        turnAround()
        forward = 1
        while not turtle.forward() do
            if turtle.dig() == false then
              turtle.attack()
            end
        end
      end
  else
      while not turtle.forward() do
        if turtle.dig() == false then
            turtle.attack()
        end
      end
  end
end
 
if #tArgs < 1 then
  move = 1
else
  move = tArgs[1]
end
 
for i = 1, move do
  digBack()
end
if forward == 1 then
  turnAround()
end
The Turtle only turns around if there is an obstacle in its way.

Stripmine:
Code:
local tunnel = 0
local tArgs = {...}
 
function dig()
  while not turtle.forward() do
      turtle.dig()
  end
end
function digUp()
  while not turtle.up() do
      turtle.digUp()
  end
end
function digDown()
  while not turtle.down() do
      turtle.digDown()
  end
end
function dig10()
  for i = 1, 20 do
      dig()
  end
end
function digTunnel()
  for i = 1, 20 do
      dig()
      turtle.digUp()
  end
end
function dropoff()
  for i = 1, 16 do
      turtle.select(i)
      turtle.drop()
  end
  turtle.select(1)
end
 
for i = 1, tArgs[1] do
  for i = 1, tunnel do
      dig()
      turtle.digUp()
  end
  turtle.turnLeft()
  digTunnel()
  turtle.turnLeft()
  turtle.turnLeft()
  dig10()
  digTunnel()
  turtle.turnLeft()
  turtle.turnLeft()
  dig10()
  turtle.turnLeft()
  for i = 1, tunnel do
      dig()
  end
  dropoff()
  turtle.turnLeft()
  turtle.turnLeft()
  tunnel = tunnel+3
end
 

Kaffefilter

New Member
Jul 29, 2019
58
0
0
I see you use tArg {...}
I have yet to understand the mecanics behind it.
So if i have for i = 1, tArg[1] do
blabla
end
and
for i = 1, tArg[2] do
blalba
end

If I then run a program, say quarry. When I enter it in the computer it could be "quarry 30 9"
Would the 30 be tArg[1] and the 9 be tArg[2]
right? CONFUSSED!
 

Evil Hamster

New Member
Jul 29, 2019
768
0
0
I'm looking forward to experimenting with programming these litle things as well, soon. So much to learn with all these mods though :)

The reason I wanted a pause was because the turtle/quarry combination was overloading my sorting machine pulling from the enderchest. I think I found a way to speed it up, but haven't had a chance to test it yet.