cecell icon

TurtleDig

cecell | PRO | 12/23/20 01:56:59 AM UTC | 0 ⭐ | 936 👁️ | Never ⏰ | []
Lua |

330 B

|

None

|

0 👍

/

0 👎

local tArgs = { ... }
local nCount = tArgs[1]
 
if not nCount then
  print("Usage: dig <count>")
  return
end
 
if nCount==0 then
  print("Arg 1, <count> must be greater than zero!")
  return
end
 
while nCount do
  if not turtle.detect() then
    turtle.forward()
    nCount = nCount - 1
  else
    turtle.dig()
  end
end

Comments