Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if not args[1] then
- error('Please specify a file!')
- end
- if not fs.exists(args[1]) then
- error('File not found!')
- end
- if not args[2] then
- error('Specify a modem!')
- end
- if not peripheral.wrap(args[2]) then
- error('Modem not found!')
- end
- if peripheral.getType(args[2]) ~= 'modem' then
- error('Peripheral is not a modem!')
- end
- local contents = {}
- local file = fs.open(args[1],'r')
- repeat
- local line = file.readLine()
- if line then
- table.insert(contents,line)
- end
- until not line
- rednet.open(args[2])
- rednet.send(19,contents,'print')
- rednet.close(args[2])
- file.close()
Add Comment
Please, Sign In to add comment