Posted 08 April 2012 - 09:18 PM
I get this error when turning on the computer and running a program I call client.
I think the error is in my api.
Also, I HAVE NO IDEA WHAT I DID WRONG
CONSOLE:
I think the error is in my api.
Also, I HAVE NO IDEA WHAT I DID WRONG
CONSOLE:
bios:206: [string "internet"]:34: '=' expected
CraftOS 1.3
>client
bios:206: [string "client"]:10: unexpected symbol
My API called "Internet" located in /rom/apis/
function getSettings()
fs = io.open("/rom/config/internetConfig.cfg","r")
spath = fs:read()
shome = fs:read()
fs:close()
local sPath = string.sub(spath,12,#spath)
local sHome = string.sub(shome,23,#shome)
return sPath, sHome
end
function server()
local sPath, sHome = getSettings()
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 )
if sPage == nil then
return false
end
sPath, sHome = getSettings()
fs = io.open(sHome, "w")
fs:write(sPage)
fs:close()
retun true
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
Pleas note that I am in the process of making an "Internet Explorer"