Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Find all peripherals connected to the network
- local peripherals = peripheral.getNames()
- local ae2
- -- Loop through peripherals to find the ME interface
- for _, name in ipairs(peripherals) do
- if peripheral.getType(name) == "meInterface" then
- ae2 = peripheral.wrap(name)
- break
- end
- end
- if not ae2 then
- print("No AE2 ME Interface found on the network.")
- return
- end
- -- Get all items in the AE2 network
- local items = ae2.callRemote("getAvailableItems", {{"item"}})
- -- Check if there are any items
- if #items == 0 then
- print("No items found in the AE2 network.")
- return
- end
- -- Print the items
- print("Items in AE2 network:")
- for _, item in ipairs(items) do
- local itemName = item.name or item.id or "Unknown Item"
- print(string.format("%s x %d", itemName, item.count))
- end
Advertisement
Add Comment
Please, Sign In to add comment