Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sizex, sizey, right = ...
- local sizex = tonumber(sizex or 50)
- local sizey = tonumber(sizey or 50)
- function digForward()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function match(s)
- s = s:lower()
- local a = false
- for i, p in ipairs(blocks) do
- a = a or string.find(s, p:lower())
- end
- return a
- end
- function clear()
- local height = 0
- while turtle.detectUp() or turtle.detect() do
- if turtle.detectUp() then turtle.digUp() end
- if turtle.detect() then turtle.dig() end
- if turtle.up() then
- height = height + 1
- end
- end
- digForward()
- digForward()
- while turtle.detectUp() or turtle.detect() do
- if turtle.detectUp() then turtle.digUp() end
- if turtle.up() then
- height = height + 1
- end
- end
- for i = 1, height do
- if turtle.detect() then turtle.dig() end
- while not turtle.down() do turtle.digDown() end
- end
- digForward()
- end
- turtle.select(1)
- for x = 1, sizex do
- for y = 1, math.ceil(sizey/4) do
- --[[local a, b = turtle.inspectDown()
- if a and not (b.name:lower():find('dirt') or b.name:lower():find('grass')) then
- turtle.digDown()
- end
- if ((not turtle.detectDown()) and (turtle.getItemCount(1) > 1)) then
- turtle.placeDown()
- end]]
- clear()
- digForward()
- end
- if right then
- turtle.turnRight()
- digForward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- digForward()
- turtle.turnLeft()
- end
- right = not right
- digForward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement