Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if not #args == 1 then
- print("Usage: hole <radius>")
- print("Place chest/s in slot 16 (will be automatically placed and filled when inventory is full)")
- return
- end
- local radius = tonumber(args[1])
- function checkFuel()
- while turtle.getFuelLevel() < 10 do
- print("Error: Low fuel")
- for i=1,15 do
- turtle.select(i)
- turtle.refuel()
- end
- sleep(1)
- 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
- turtle.select(16)
- while not turtle.placeUp() do turtle.digUp() end
- for i=1,15 do
- turtle.select(i)
- turtle.dropUp()
- end
- end
- end
- function digToHellAndBack()
- for z=0,43 do
- local success, data = turtle.inspectDown()
- if success then
- print("Block name: ", data.name)
- print("Block metadata: ", data.metadata)
- if data.name == "minecraft:bedrock" then
- break
- end
- end
- turtle.digDown()
- while not turtle.down() do sleep(0.1) end
- end
- for z=0,43 do
- while not turtle.up() do sleep(0.1) end
- end
- end
- for i=0,1024 do
- if i > radius then
- break
- end
- for j=0,1 do
- for j=0,1024 do
- if j > i then
- break
- end
- checkFuel()
- checkInv()
- digToHellAndBack()
- turtle.dig()
- while not turtle.forward() do sleep(0.1) end
- end
- turtle.turnRight()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement