Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- while true do
- local senderId, message, protocol = rednet.receive()
- if protocol == "rpage" then
- if fs.exists(message..".web") then
- print("found")
- file = fs.open(message..".web", "r")
- page = file.readAll()
- file.close()
- rednet.send(senderId, page)
- else
- print("not found")
- rednet.send(senderId, "false")
- end
- end
- if protocol == "rimage" then
- if fs.exists(message..".img") then
- print("found")
- file = fs.open(message..".img", "r")
- page = file.readAll()
- file.close()
- rednet.send(senderId, page)
- else
- print("not found")
- rednet.send(senderId, "false")
- end
- end
- if protocol == "rprgm" then
- if fs.exists(message..".prgm") then
- print("found")
- file = fs.open(message..".prgm", "r")
- page = file.readAll()
- file.close()
- rednet.send(senderId, page)
- else
- print("not found")
- rednet.send(senderId, "false")
- end
- end
- if protocol == "runss" then
- if fs.exists(message..".ssprgm") then
- print("found")
- rednet.send(senderId, "sender")
- shell.run(message..".ssprgm")
- else
- print("not found")
- rednet.send(senderId, "false")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment