Posted 12 April 2012 - 03:34 PM
rednet.open("back")
rednet.open("right")
rednet.open("left")
rednet.open("top")
rednet.open("bottom")
local CompID == ""
function getUpdates()
sender, p1 = rednet.receive()
if sender == "CompID" and p1 == "update" then
local update = rednet.reveive()
fs.delete("NeXoS")
local hFile = fs.open("NeXoS", "w")
hFile.write(update)
end
sender, command = rednet.reveive()
if sender == "CompID" and command == "update"
print "Update Available"
print "You would like to update now?"
print "Y/N"
event, key = os.pullEvent()
if event == "char" and key == "y" then
getUpdates()
elseif event == "char" and key == "n" then
term.clear()
term.setCursorPos(1,1)
end
else
print "No Updates Available!"
end
That is the receive code
rednet.open("back")
term.clear()
term.setCursorPos(1,1)
rednet.broadcast("update")
local h = fs.open("/FTP/NeXoS", "r")
local update = h.readAll()
h.close()
rednet.broadcast(update)
That is the server broadcasting the update.
Can you help, I'm at school right now and I can't test this. Can you guys test and give me feedback and/or help with the errors?
Btw CompID isn't set yet because I don't know the ID's at school.