remove alternates - add ccemux peripherals upon system startup
This commit is contained in:
20
ccemux/bin/emustartup.lua
Normal file
20
ccemux/bin/emustartup.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local ccemux
|
||||
ccemux = _G.ccemux
|
||||
local fs
|
||||
fs = _G.fs
|
||||
local peripheral
|
||||
peripheral = _G.peripheral
|
||||
local unserialize
|
||||
unserialize = _G.textutils.unserialize
|
||||
local CONFIG = 'usr/config/ccemux'
|
||||
if ccemux and fs.exists(CONFIG) then
|
||||
local f = fs.open(CONFIG, 'r')
|
||||
local c = unserialize(f.readAll())
|
||||
f.close()
|
||||
for k, v in pairs(c) do
|
||||
if not peripheral.getType(k) then
|
||||
ccemux.attach(k, v.type, v.args)
|
||||
print(k)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user