Posted 08 September 2012 - 03:56 AM
I am trying to make a browser of sorts. There is a browser server and a browser client. Its asks the client for the url the sends it to the server, and if the url is the same as the one on the server it will send back the webpage text. BUT IT DOESN'T WORK! I have been trying for hours and can't figure it out… Please help me!
Browser Client (Program Name: browser)
Browser Server (Program Name: browserserver)
Browser Client (Program Name: browser)
rednet.open("top")
term.clear()
term.setCursorPos(1,1)
print("--------------------------------------------------")
term.setCursorPos(1,1)
print("Enter URL: ")
term.setCursorPos(12,1)
page = read()
rednet.send(1, page)
sleep(1)
local senderId, message = rednet.receive(3)
term.setCursorPos(1,4)
if message == nill then
print("Opps! Somthing didn't work!")
else
print(message)
end
Browser Server (Program Name: browserserver)
print("Browser Server Running...")
local webpage = "Google"
while true do
local id, message = rednet.receive()
if message == "google" then
rednet.send(id, webpage)
print("Computer, ".. id .. ", went to " .. message)
end
end