Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- id = 9
- print("Type the id of the addressee :")
- idToSend = io.read()
- shell.run("clear")
- rednet.send(id, idToSend)
- print("What do you want to do :")
- print("Send a file (f) or a program (p)?")
- print("Cut the communication with the other computer (exit)?")
- print("Exit this program (/quit)?")
- type = io.read()
- rednet.send(id, type)
- if type == "f" then
- print("What is the name of the file ?")
- 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):")
- argument = io.read()
- rednet.send(id, argument)
- print("Program sent")
- elseif type == "exit" then
- print("Communication cut")
- 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
Advertisement