Posted 27 November 2014 - 09:14 PM
Here is a solution to using the rednet api without knowing what side a modem is on.
rednet.find = function()
local sides = {"top","bottom","left","right","front","back"}
local trueSide = 0
for s=1, 6 do if peripheral.getType(sides[s]) == "modem" then trueSide = sides[s] end end
if trueSide ~= 0 then return trueSide end
end
This program creates a global function "rednet.find()" which will return the side of the first modem it finds.Edited on 27 November 2014 - 09:56 PM