Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local fs = require("filesystem")
- local textutils = require("serialization")
- local i=1
- local alldevice = component.list()
- local adress= {}
- for k,v in pairs(alldevice) do
- print(i.." - "..v)
- i = i+1
- table.insert(adress,k)
- end
- local device = tonumber( io.read() )
- local function save(text, filename)
- --[[if fs.exists(file) then
- fs.remove(file)
- end]]
- local file,error = fs.open(filename,"w")
- file:write(text)
- file:close()
- end
- local texts=""
- for k,v in pairs(component[alldevice[adress[device]]]) do
- print(k,v)
- if type(v)~="string" then
- v = tostring(v)
- end
- texts=texts..k.." "..v.."\n"
- end
- save(texts,"/home/"..alldevice[adress[device]].."_methods")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement