robathome icon

Untitled

robathome | PRO | 09/30/25 07:06:44 PM UTC | 0 ⭐ | 452 👁️ | Never ⏰ | []
text |

1.05 KB

|

None

|

0 👍

/

0 👎

-- super simple zig-zag column miner
local X=3  -- width (x)
local Z=3  -- length (z)
local Y=3  -- height (y)
local COB=2
 local function stepF()
  while turtle.detect() do turtle.dig() end
  while not turtle.forward() do turtle.attack(); turtle.dig() end
end
local function stepD()
  while turtle.detectDown() do turtle.digDown() end
  while not turtle.down() do turtle.attackDown(); turtle.digDown() end
end
local function stepU()
  while turtle.detectUp() do turtle.digUp() end
  while not turtle.up() do turtle.attackUp(); turtle.digUp() end
end
 local function column()
  for i=2,Y do stepD() end
  if not turtle.detectDown() then turtle.select(COB); turtle.placeDown() end
  for i=2,Y do stepU() end
end
 local dir=1
for z=1,Z do
  if dir==1 then
    column()
    for x=2,X do stepF(); column() end
  else
    column()
    for x=2,X do stepF(); column() end
  end
  if z<Z then
    if dir==1 then turtle.turnRight(); stepF(); turtle.turnRight()
    else turtle.turnLeft(); stepF(); turtle.turnLeft() end
    dir=1-dir
  end
end
 

Comments