Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = require("component").modem
- event = require("event")
- modem.open(20)
- started_from = ""
- local _, _, from, port, _, message = event.pull("modem_message")
- if tostring(message) == "con_start" and started_from == "" then
- started_from = tostring(from)
- local _, _, from, port, _, message = event.pull("modem_message")
- if tostring(message) == "read" and tostring(from) == started_from then
- local _, _, from, port, _, message = event.pull("modem_message")
- if tostring(from) == started_from then
- local file = io.open(tostring(message), "r")
- local broadcast = file.read()
- file.close()
- modem.send(from, port, broadcast)
- started_from = ""
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement