Posted 07 April 2012 - 02:32 AM
I made an api and something went wrong.
Here is my code:
Here is the error:
Here is my code:
rednet.open("right")
function server( sPath )
while true do
local event, nId, message = os.pullEvent()
if event == "rednet_message" then
fs = io.open(sPath..message..".txt", "r")
page = fs:read("*a")
fs:close()
rednet.send(nId, page)
end
end
end
function client( SCID, sPage )
rednet.send(SCId, sPage)
id, message = rednet.receive(5)
return message
end
Here is the error:
internet:1: attempt to index ? (a nil value)
I don't know where the error is.