Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lessonDir == "lessons/"
- for i,v in ipairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- rednet.open(v)
- end
- end
- while true do
- local id, msg = rednet.receive()
- msg = textutils.unserialize(msg)
- if msg then
- if msg[1] == "lessonServ" then
- if msg[2] == "get_lesson" then
- if fs.exists(lessonDir..msg[3]) then
- local fHandle = fs.open(lessonDir..msg[3], "r")
- rednet.send(id, textutils.serialize({"lessonServ", "lesson_text", fHandle.readAll()}))
- fHandle.close()
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement