Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local comp = require("component")
- local fs = require("filesystem")
- t = {}
- local m = {}
- local x = 1
- for a,b in comp.list() do
- if b ~= "keyboard" and b ~= "filesystem" and b ~= "monitor" then
- t[x] = {[1] = b, [2] = a}
- local y = 3
- for c in pairs(comp.methods(a)) do
- t[x][y] = c
- y = y + 1
- end
- x = x + 1
- end
- end
- local loc = "/floppy/comp_list"
- if fs.exists(loc) then
- fs.remove(loc)
- end
- fh = io.open(loc, 'w')
- for a,b in pairs(t) do
- for c,d in pairs(t[a]) do
- print(a.."-"..c..": "..d)
- fh:write(tostring(a.."-"..c..": "..d))
- fh:write("\n")
- end
- fh:write("\n")
- end
- fh:close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement