Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Debug Communicator
- rednet.open("back");
- while true do
- shell.run("clear");
- print("==========================");
- io.write("Protocol: ");
- local protocol = io.read();
- local lookup;
- local address;
- if protocol ~= "" then
- io.write("Lookup Name: ");
- lookup = io.read();
- if lookup ~= "" then
- address = rednet.lookup(protocol, lookup);
- if address == nil then
- print("Error Finding Address through Lookup. Input it Manually, or skip to broadcast.")
- end
- end
- end
- if address == nil then
- io.write("Computer Address: ");
- address = io.read();
- end
- io.write("Message: ");
- local message = io.read();
- print("==========================")
- if message ~= "" then
- if protocol == "" then
- if address == "" then
- rednet.broadcast(message);
- else
- rednet.send(address, message);
- end
- else
- if address == "" then
- rednet.broadcast(message, protocol);
- else
- rednet.send(address, message, protocol);
- end
- end
- local returnMessage, from;
- if protocol == "" then
- from, returnMessage = rednet.receive(5);
- else
- from, returnMessage = rednet.receive(protocol, 5);
- end
- if from ~= nil then
- print("From: " .. from);
- print("=========================")
- print(returnMessage);
- print("=========================")
- else
- print("Recieved Nothing.")
- end
- io.read();
- end
- sleep(0);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement