Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = { "top", "bottom", "left", "right",
- "front", "back" }
- local modemSide = "top";
- 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
- print("Now listening for network input.");
- rednet.host(protocol,os.getComputerID().."R")
- Ssender, Smsg, Sprotocol = rednet.receive(protocol);
- else
- print("No modem found.");
- return
- end
- print("command received from "..Ssender);
- print("executing in 2 seconds");
- sleep(2);
- shell.run(Smsg);
- os.reboot();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement