Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- print("Enter the id of the addressee")
- id = tonumber(io.read())
- shell.run("clear")
- print("Do you want to send a program (p) or a file (f) or quit the program on the addresse?")
- print("Type quit to quit this program")
- type = io.read()
- rednet.send(id, type)
- if type == "f" then
- print("What is the name of the file to send?")
- fileOpen = io.read()
- local file = fs.open(fileOpen, "r")
- local sFile = file.readAll()
- rednet.send(id, sFile)
- file.close()
- print("File sent")
- elseif type == "p" then
- print("What is the name of the program ?")
- programSend = io.read()
- rednet.send(id, programSend)
- print("Type the argument of the program (0 if there is not argument to send):")
- argument = io.read()
- rednet.send(id, argument)
- print("Program sent")
- elseif type == "exit" then
- print("Program quit")
- rednet.send(id, type)
- elseif type == "quit" then
- shell.run("clear")
- rednet.close("right")
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment