Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local depth = 65/3
- local stripLength = 22
- local count = 0
- local line = 0
- if not #args == 0 then
- print("Usage: hole")
- return
- end
- function strip()
- count = 0
- while turtle.detectDown() do
- turtle.digDown()
- sleep(0.2)
- end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- for i=1,stripLength do
- checkFuel(stripLength)
- count = count + 1
- checkInv()
- while not turtle.forward() do turtle.dig() end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- while turtle.detectDown() do
- turtle.digDown()
- sleep(0.2)
- end
- end
- end
- function checkInv()
- isFull = true
- for i=1,15 do
- if turtle.getItemCount(i) == 0 then
- isFull = false
- end
- end
- if isFull == true then
- emptyInv()
- end
- end
- function checkFuel(count)
- if turtle.getFuelLevel() <= count then
- print("Error: Low fuel")
- for i=1,15 do
- turtle.select(i)
- turtle.refuel()
- end
- turtle.select(1)
- end
- end
- function emptyInv()
- turtle.select(16)
- while not turtle.placeUp() do turtle.digUp() end
- for i=1,15 do
- turtle.select(i)
- turtle.dropUp()
- end
- turtle.select(1)
- end
- for q=1, depth do
- for x=1,(stripLength/2) do
- turtle.turnLeft()
- strip()
- turtle.turnRight()
- while not turtle.forward() do turtle.dig() end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- turtle.turnRight()
- strip()
- turtle.turnLeft()
- while not turtle.forward() do turtle.dig() end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.2)
- end
- while turtle.detectDown() do
- turtle.digDown()
- end
- line = line + 1
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- for x=1,3 do
- while not turtle.down() do turtle.digDown() end
- end
- turtle.turnRight()
- end
- emptyInv()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement