Posted 08 April 2012 - 04:00 AM
I have a function here called internet2:
I know it recieves the text AND it writes to the file.
I know the problem is running it.
HOW DO I RUN THE PROGRAM
P.S. I made this api/soon to be program in order to have custom home pages.
local sPath = "/server/"
function server()
rednet.open("right")
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 FTP( nSCID )
sPage = client( nSCID )
fs = io.open("ram", "w")
fs:write(sPage)
fs:close()
shell.run("ram")
end
function client( nSCID, sPage )
if sPage == nil then
sPage = "home"
end
rednet.open("right")
rednet.send(nSCId, sPage)
id, message = rednet.receive(5)
return message
end
I have 1 program execute internet2.server()I know it recieves the text AND it writes to the file.
I know the problem is running it.
HOW DO I RUN THE PROGRAM
P.S. I made this api/soon to be program in order to have custom home pages.