Posted 09 July 2012 - 09:54 PM
Hi,
I just wrote a small script for opening the first available rednet modem but somehow it does not work properly. This is the function:
Sadly this function returns false, even though it opened a rednet modem. It simply does not exit when it opened the first available modem. I tried finding answers regarding this issue using google but all of the functions I found did use return the same way I did.
Cyclonit
I just wrote a small script for opening the first available rednet modem but somehow it does not work properly. This is the function:
function rednetOpen()
local sides = {"right", "left", "back", "front", "top", "bottom"}
for i, side in ipairs(sides) do
if (rednet.open(side)) then
return true
end
end
return false
end
Sadly this function returns false, even though it opened a rednet modem. It simply does not exit when it opened the first available modem. I tried finding answers regarding this issue using google but all of the functions I found did use return the same way I did.
Cyclonit