Posted 20 December 2014 - 04:50 AM
This code was working the last time I had this save installed. I came back to show my dad, and it doesn't work anymore.
API Code:
Program Code:
Can anyone tell me what's up? My error is:
API Code:
local function rsOpen(side)
if side == nil then
for i,v in pairs(rs.getSides()) do
if peripheral.getType(v) == "modem" then
rednet.open(v)
end
end
else
rednet.open(side)
end
end
local function rsClose(side)
if side == nil then
for i,v in pairs(rs.getSides()) do
if peripheral.getType(v) == "modem" then
rednet.close(v)
end
end
else
rednet.close(side)
end
end
Program Code:
os.loadAPI("m") --file where api is located
m.rsOpen("top")
Can anyone tell me what's up? My error is:
test:2: attempt to call nil
Edited on 20 December 2014 - 03:51 AM