Posted 15 February 2015 - 12:35 AM
This is sort of hard to clarify, so bear with me.
I have a random amount of modems on a computer, I get them using this:
This puts all of the sides modems are connected to in lCSides (ListConnectedSides)
I then try to open 1 - 128 channels on each modem. Problem I have is, I need to assign variables to the modems to transmit.
So if lCSides[1] == "left" then I need to be able to do table[2].transmit(1, 2, "Test)
This is the code I am having difficulty on:
I have a random amount of modems on a computer, I get them using this:
local lSides = redstone.getSides()
local lCSides = {}
for i=1, #lSides do
if peripheral.isPresent(lSides[i]) and peripheral.getType(lSides[i]) == "modem" then
table.insert(lCSides, lSides[i])
end
end
This puts all of the sides modems are connected to in lCSides (ListConnectedSides)
I then try to open 1 - 128 channels on each modem. Problem I have is, I need to assign variables to the modems to transmit.
So if lCSides[1] == "left" then I need to be able to do table[2].transmit(1, 2, "Test)
This is the code I am having difficulty on:
for s=1, #lCSides do
for c=1, 128 do
lCSides[s].peripheral.wrap(lCSides[s])
lCSides[s].open(c)
end
end