Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refresh()
- peripheral.find("modem", rednet.open)
- while true do
- h = fs.open("messages.txt", "r")
- repeat
- line = h.readLine()
- if line ~= nil then
- print(line)
- end
- until line == nil
- h.close()
- id, message = rednet.receive()
- h = fs.open("messages.txt", "a")
- h.writeLine(os.date()..os.time()..";"..message)
- h.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement