Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = { "top", "bottom", "left", "right",
- "front", "back" }
- local modemSide = "back";
- local protocol = "remoteT";
- for i = 1, #sides do
- if peripheral.isPresent(sides[i]) then
- if peripheral.getType(sides[i]) == "modem" then
- print("Modem found.");
- modemSide = sides[i];
- rednet.open(modemSide);
- break
- end
- end
- end
- if rednet.isOpen(modemSide) then
- listeners = {rednet.lookup(protocol)};
- print("Found "..#listeners.." Listeners");
- term.write("Input Command: ");
- local command = read();
- rednet.broadcast(command,protocol);
- print("Successfully sent command.");
- else
- print("No modem found.");
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment