I just wrote quite a long program and realized that "loop wrapping" monitors is not really an option.
It would be cool if I could just write mon.write("hi!") to all the monitors.
Any ideas? :)/>
mons =
{
add = function (self, mon) self[#self + 1] = mon end,
__index = function (tbl, key) return function(...) for i = 1, #tbl do tbl[i][key](...) end end end
}
setmetatable(mons,mons)
Just a slight note here, through testing a long while ago I discovered that you do not actually need to use peripheral.isPresent() as peripheral.getType() will return nil if there is not peripheral present on the side you're checking. :)/>Basically, you'll want to loop through all sides and use `peripheral.isPresent()` and `peripheral.getType()` to find your monitors.
Thanks! Now I can remove some function calls before I publish my API. :D/>Just a slight note here, through testing a long while ago I discovered that you do not actually need to use peripheral.isPresent() as peripheral.getType() will return nil if there is not peripheral present on the side you're checking. :)/>/>Basically, you'll want to loop through all sides and use `peripheral.isPresent()` and `peripheral.getType()` to find your monitors.
Thanks! Now I can remove some function calls before I publish my API. :D/>Just a slight note here, through testing a long while ago I discovered that you do not actually need to use peripheral.isPresent() as peripheral.getType() will return nil if there is not peripheral present on the side you're checking. :)/>/>Basically, you'll want to loop through all sides and use `peripheral.isPresent()` and `peripheral.getType()` to find your monitors.
Thanks! Now I can remove some function calls before I publish my API. :D/>Just a slight note here, through testing a long while ago I discovered that you do not actually need to use peripheral.isPresent() as peripheral.getType() will return nil if there is not peripheral present on the side you're checking. :)/>/>Basically, you'll want to loop through all sides and use `peripheral.isPresent()` and `peripheral.getType()` to find your monitors.
On some testing, the background colour won't set for multiple monitors which is odd…
mons =
{
add = function (self, mon) self[#self + 1] = mon end,
__index = function (tbl, key) return function(...) local funcs = {} for i = 1, #tbl do funcs[#funcs + 1] = function() tbl[i][key](...) end end paralel.waitForAll(unpack(funcs)) end end
}
setmetatable(mons,mons)
Thanks! Now I can remove some function calls before I publish my API. :D/>Just a slight note here, through testing a long while ago I discovered that you do not actually need to use peripheral.isPresent() as peripheral.getType() will return nil if there is not peripheral present on the side you're checking. :)/>/>Basically, you'll want to loop through all sides and use `peripheral.isPresent()` and `peripheral.getType()` to find your monitors.
On some testing, the background colour won't set for multiple monitors which is odd…
Alright. First, make sure you're using an Advanced Monitor. Then make sure you can change the background color on each monitor individually. Then you could try using this implementation of `mons` if the other one doesn't work:mons = { add = function (self, mon) self[#self + 1] = mon end, __index = function (tbl, key) return function(...) local funcs = {} for i = 1, #tbl do funcs[#funcs + 1] = function() tbl[i][key](...) end end paralel.waitForAll(unpack(funcs)) end end } setmetatable(mons,mons)