SHARE
TWEET

CCRemoteShell

MrHG Jun 2nd, 2020 (edited) 1,083 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sides = { "top", "bottom", "left", "right",
  2. "front", "back" }
  3. local modemSide = "top";
  4. local protocol = "remoteT";
  5. for i = 1, #sides do
  6.   if peripheral.isPresent(sides[i]) then
  7.     if peripheral.getType(sides[i]) == "modem" then
  8.       print("Modem found.");
  9.       modemSide = sides[i];
  10.       rednet.open(modemSide);
  11.       break
  12.     end
  13.   end
  14. end
  15. if rednet.isOpen(modemSide) then
  16.   print("Now listening for network input.");
  17.   rednet.host(protocol,os.getComputerID().."R")
  18.   Ssender, Smsg, Sprotocol = rednet.receive(protocol);
  19. else
  20.   print("No modem found.");
  21.   return
  22. end
  23. print("command received from "..Ssender);
  24. print("executing in 2 seconds");
  25. sleep(2);
  26. shell.run(Smsg);
  27. os.reboot();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top