Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CLOUD BASED SYSTEM --
- -- SIMPLE VERSION --
- -- BY JUST DOES GAMES --
- cid = 0
- rednet.open("right")
- function add(ffile, fn)
- if fs.exists(fn) == true then fs.delete(fn) end
- local file = fs.open(fn, "w")
- file.write(ffile)
- file.close()
- end
- function send(ffile)
- if fs.exists(file) == true then
- local file = fs.open(ffile, "r")
- rednet.send(cid, file.readAll())
- file.close()
- else
- rednet.send(cid, "Cloud File Cannot be Found")
- end
- end
- shell.run("clear")
- print("Server ID: "..os.getComputerID())
- while true do
- cid1, r = rednet.receive()
- if r == "add" then
- cid,wfile = rednet.receive()
- if cid == cid1 then
- cid,filename = rednet.receive()
- if cid ~= nil then add(wfile,filename) end
- print("Computer ID "..cid.." Added to Archive")
- end
- elseif r == "send" then
- send(r)
- print("Computer ID "..cid.." Requested an Archive")
- end
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment