Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Set the AE2 network controller's address
- local ae2ControllerAddress = "your_ae2_controller_address_here"
- -- Open a connection to the AE2 network controller
- local ae2Controller = peripheral.wrap(ae2ControllerAddress)
- -- Retrieve a list of all connected storage cells
- local storageCells = ae2Controller.getStorageCells()
- -- Initialize a table to store the unique ores
- local uniqueOres = {}
- -- Iterate through each storage cell
- for _, storageCell in pairs(storageCells) do
- -- Retrieve the list of items stored in the storage cell
- local storedItems = storageCell.getItems()
- -- Iterate through each stored item
- for _, item in pairs(storedItems) do
- local itemDisplayName = item.getItemStack().getDisplayName()
- -- Check if the item is an ore by checking its display name
- if itemDisplayName:match("Ore") then
- uniqueOres[itemDisplayName] = true
- end
- end
- end
- -- Print out the list of unique ores
- print("List of Ores in AE2 Network:")
- for oreName, _ in pairs(uniqueOres) do
- print("- " .. oreName)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement