-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcomp-viewer.lua
More file actions
42 lines (34 loc) · 827 Bytes
/
comp-viewer.lua
File metadata and controls
42 lines (34 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- pastebin run P99QiVfG
-- von Nex4rius
-- https://github.com/Nex4rius/Nex4rius-Programme/
local c = require("component")
local term = require("term")
local pfad = "temp-comp-viewer"
local alle = {}
local d = io.open(pfad, "w")
local function zeig(text)
term.write(text)
d:write(text)
end
for id, name in c.list() do
zeig(string.format(">>> %s - %s <<<\n", name, id))
alle[name] = true
end
d:write("\n\n")
local function zeig_method(name)
for i in pairs(c.list(name)) do
for j in pairs(c.methods(i)) do
zeig(" " .. j .. "\n " .. tostring(c.doc(i, j)) .. "\n")
end
zeig("\n\n")
end
end
for id, name in c.list() do
if alle[name] then
zeig(string.format(">>> %s - %s <<<\n", name, id))
zeig_method(name)
alle[name] = false
end
end
os.sleep(1)
os.execute("edit " .. pfad)