Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- variation on box miner but instead of bobbing up and down like a sewing needle this is the more classic run straight through
- -- also as I'm doing this for clay I'll set it to only dig up or down if there is clay present.
- depth=3 -- small makes testing retrieval easier if I get flip logic wrong
- width=8
- length=8
- flip=0
- local function pauseMe()
- print("Press any key...")
- os.pullEvent("key")
- end
- local function goUp()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- local function mineClayUp()
- local has_block, data = turtle.inspectUp()
- if has_block then
- if data.name == "minecraft:clay" then
- turtle.digUp()
- end
- end
- end
- local function mineClayDown()
- local has_block, data = turtle.inspectDown()
- if has_block then
- if data.name == "minecraft:clay" then
- turtle.digDown()
- end
- end
- end
- local function goForward()
- while not turtle.forward() do
- mineClayDown()
- mineClayUp()
- turtle.dig()
- mineClayUp()
- mineClayDown()
- end
- end
- local function goDown()
- turtle.digDown()
- turtle.down()
- end
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- for z=1,depth do
- for x=1,length do
- for z=1,width do
- goForward()
- end -- at width
- if flip==0 then
- flip=1
- turtle.turnRight()
- goForward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- goForward()
- turtle.turnLeft()
- flip=0
- end
- end -- at length
- goDown()
- goDown()
- if flip==0 then
- turtle.turnLeft()
- else
- turtle.TurnRight()
- end
- -- print("Debug: Check heading and depth.")
- -- pauseMe()
- end -- at depth
- print("Return to surface (if applicable).")
- x=0
- while not turtle.up() or x<(depth+2) do -- up until you hit air or reach 'depth' height (relative 0)
- goUp()
- x=x+1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement