Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- NZ miner
- local function dforward()
- while turtle.detect() == true do
- turtle.dig()
- os.queueEvent("")
- coroutine.yield()
- end
- turtle.forward()
- end
- local function digUD()
- while turtle.detectUp() == true do
- turtle.digUp()
- os.queueEvent("")
- coroutine.yield()
- end
- turtle.digDown()
- end
- local function digShort()
- for toMove = 1,3 do
- dforward()
- digUD()
- end
- end
- local function digTunnel()
- for toMove = 1,6 do
- dforward()
- digUD()
- end
- end
- local function LorR( _x )
- if (math.fmod(_x,2) == 0) then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- local function makeCC()
- turtle.turnLeft()
- dforward()
- digUD()
- turtle.turnLeft()
- turtle.turnLeft()
- dforward()
- dforward()
- digUD()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- -- main, assumed to be starting just outside of the area you want to mine
- -- move forward for the starting leg
- digShort()
- -- setup the first crosscut
- dforward()
- digUD()
- turtle.back()
- -- face the correct direction
- turtle.turnRight()
- -- for now, 7 iterations deep. That's a good starting point.
- for x = 1,7 do
- for y = 1,x do
- -- already facing the correct direction.
- digTunnel()
- if (math.fmod(x,2) == 0) then
- if (y == (x/2)) then
- makeCC()
- elseif (y == math.floor(x/2)+1) then
- makeCC()
- end
- end
- end
- -- if X is even, turn right, forward, right. Else turn left, forward, left
- LorR(x)
- digShort()
- LorR(x)
- end
Advertisement
Add Comment
Please, Sign In to add comment