Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findBlock(blockName)
- for slot = 1, 16 do
- local itemDetail = turtle.getItemDetail(slot)
- if itemDetail and itemDetail.name == blockName then
- return slot
- end
- end
- return nil
- end
- function findBlocks(blockName)
- local foundSlots = {}
- for slot = 1, 16 do
- local itemDetail = turtle.getItemDetail(slot)
- if itemDetail and itemDetail.name == blockName then
- table.insert(foundSlots, slot)
- end
- end
- return foundSlots -- Return a table containing slots with the block
- end
Add Comment
Please, Sign In to add comment