Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SLOT_COUNT = 16
- local CHUNK_SIDE = 8
- function storeAll()
- for slot = 1, SLOT_COUNT, 1 do
- item = turtle.getItemDetail(slot)
- if(item ~= nil) then
- if(item["name"] == "minecraft:chest") then
- turtle.select(slot)
- turtle.placeUp()
- for slot = 1, SLOT_COUNT, 1 do
- item = turtle.getItemDetail(slot)
- if(item ~= nil) then
- if((item["name"] ~= "minecraft:coal") and (item["name"] ~= "minecraft:chest")) then
- turtle.select(slot)
- turtle.dropUp()
- end
- end
- end
- return true
- end
- end
- end
- return false
- end
- function checkFuel()
- if(turtle.getFuelLevel() < 50) then
- for slot = 1, SLOT_COUNT, 1 do
- item = turtle.getItemDetail(slot)
- if(item ~= nil) then
- if(item["name"] == "minecraft:coal") then
- turtle.select(slot)
- turtle.refuel(1)
- return true
- end
- end
- end
- return false
- end
- return true
- end
- function chunkDig()
- success, data = turtle.inspectDown()
- while(data.name ~= "minecraft:bedrock") do
- checkFuel()
- for times = 1, 4, 1 do
- for block = 2, 8, 1 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- for block = 2, 8, 1 do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- checkFuel()
- end
- turtle.turnLeft()
- for block = 1, 8, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.digDown()
- turtle.down()
- storeAll()
- success, data = turtle.inspectDown()
- end
- return true
- end
- function main()
- return chunkDig()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement