Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ComputerCraft BlockMiner by Teki
- local details
- local blockDetected, blockDetails
- local function getfirstFreeSlot(bDetails)
- for i =1,16 do
- details = turtle.getItemDetail(i)
- if details ~= nil and turtle.getItemSpace(i) >= 1 and details.name == bDetails.name then
- return i
- end
- end
- for i =1,16 do
- details = turtle.getItemDetail(i)
- if details == nil then
- return i
- end
- end
- return 0
- end
- while true do
- blockDetected, blockDetails = turtle.inspect()
- firstFreeSlot = getfirstFreeSlot(blockDetails)
- if firstFreeSlot ~= 0 then
- turtle.select(firstFreeSlot)
- if blockDetails.name == "minecraft:flowing_lava" then
- redstone.setOutput("top", true)
- else
- redstone.setOutput("top", false)
- if turtle.detect() then
- turtle.dig()
- end
- end
- end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement