Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- local hostid = 185
- local id = os.getComputerID()
- local list = {"stone", "dirt", "gravel", "sand", "sandstone", "cobblestone", "grass"}
- local function report(x)
- rednet.send(hostid, x, "atenefyrturtle")
- end
- for i = 1, 2 do
- turtle.digDown()
- turtle.down()
- end
- turtle.placeUp()
- report("Below sea level")
- repeat
- if turtle.getFuelLevel() < 8 then
- turtle.select(2)
- turtle.refuel(1)
- turtle.select(1)
- report("Refueled, now at " .. turtle.getFuelLevel())
- end
- for i = 1, 4 do
- local dm = false --dm = Don't mine
- _, info = turtle.inspect()
- for i = 1, #list do
- if info["name"] == "minecraft:" .. list[i] then
- dm = true
- end
- end
- if not dm and info["name"] ~= "minecraft:bedrock" then --Do mine
- turtle.dig()
- report("Dug ore " .. info["name"]:gsub("minecraft:", ""):gsub("_", " "):gsub(" ore", ""))
- end
- turtle.turnLeft()
- end
- turtle.digDown()
- turtle.down()
- _, info = turtle.inspectDown()
- until info["name"] == "minecraft:bedrock"
- report("Hit bedrock, coming back up")
- repeat
- if turtle.getFuelLevel() < 8 then
- turtle.select(2)
- turtle.refuel(1)
- turtle.select(1)
- report("Refueled, now at " .. turtle.getFuelLevel())
- end
- turtle.up()
- _, info = turtle.inspectUp()
- until info["name"] == "minecraft:planks"
- turtle.digUp()
- turtle.up()
- turtle.up()
- turtle.placeDown()
- report("Hit surface")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement