Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function checkFuel()
- repeat
- os.sleep(1)
- until turtle.getFuelLevel() <= 2000
- turtle.refuel(turtle.getItemCount(1)-1)
- end
- local function mineLayer ()
- local maxLength = 10
- turtle.digDown()
- turtle.down()
- local currentLength = maxLength
- while (currentLength > 0)
- do
- local index2 = 0
- while (index2 < 4)
- do
- local index = 0
- if ((index == 0 and index2 == 3) or (currentLength < maxLength and index2 == 1))
- then
- currentLength = currentLength - 1
- end
- while (index < currentLength)
- do
- while (turtle.detect())
- do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- index = index + 1
- end
- turtle.turnRight()
- index2 = index2 + 1
- end
- end
- turtle.turnLeft()
- local halfMax = (maxLength / 2) - 1
- local index = 0;
- while (index < halfMax)
- do
- turtle.forward()
- index = index + 1
- end
- turtle.turnLeft()
- local index = 0
- while (index < halfMax)
- do
- turtle.forward()
- index = index + 1
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- local layersToDig = 50
- local layer = 0
- while (layer < layersToDig)
- do
- parallel.waitForAny(mineLayer, checkFuel)
- layer = layer + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement