Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wrap the Inventory Manager (NOT the chest)
- -- It usually appears as "inventoryManager_0"
- local invMgr = peripheral.find("inventory_Manager")
- if not invMgr then
- print("No Inventory Manager found!")
- return
- end
- -- Define what we are looking for
- local targetKey = "apotheosis:rarity"
- local targetValue = "apotheosis:epic"
- -- Get list of all items with FULL data
- -- Unlike standard chests, this block reads everything
- print("Scanning...")
- local items = invMgr.getItems()
- for slot, item in pairs(items) do
- if item.nbt then
- -- Check the tag
- if item.nbt[targetKey] == targetValue then
- print("Found Epic Item in slot " .. item.slot)
- -- Move it to the chest below/above/etc
- -- pushItems(targetInventory, slot, count)
- -- Note: You need to know the direction of the DESTINATION chest relative to the Inventory Manager
- -- Directions: "up", "down", "north", "south", "east", "west"
- invMgr.pushItems("up", item.slot, 64)
- end
- end
- end
- print("Done.")
Advertisement
Add Comment
Please, Sign In to add comment