Upload files to "/"

This commit is contained in:
2026-03-15 15:05:27 -04:00
parent 7630c5dba5
commit 0ebcf31450

25
listDevicesByType.lua Normal file
View File

@@ -0,0 +1,25 @@
-- List all peripherals grouped by type
local peripherals = peripheral.getNames()
local grouped = {}
-- Group peripherals by type
for _, name in ipairs(peripherals) do
local pType = peripheral.getType(name)
if not grouped[pType] then
grouped[pType] = {}
end
table.insert(grouped[pType], name)
end
-- Display grouped results
print("=== Network Devices ===")
print("Total devices found: " .. #peripherals)
print("")
for pType, devices in pairs(grouped) do
print(string.format("[%s] (%d found)", pType, #devices))
for _, name in ipairs(devices) do
print(" - " .. name)
end
print("")
end