Ask0nn

PowerSetRed

Nov 28th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. rednet.open("top")
  2. term.clear();
  3. term.setCursorPos(1,1);
  4. print("Waiting for incoming connection");
  5. while true do
  6.     senderID, message, distance = rednet.receive();
  7.     term.clear();
  8.     term.setCursorPos(1,1);
  9.     if (senderID ~= nil) then
  10.         print("Incoming connection");
  11.         print(" ");
  12.         print("SenderID:");
  13.         print(senderID);
  14.         print(" ");
  15.         print("Message:");
  16.         print(message);
  17.         print(" ");
  18.         print("Distance:");
  19.         print(distance);
  20.         shell.run(message);
  21.     else
  22.         print("Waiting for incoming connection");
  23.     end
  24.     sleep(4);
  25. end
  26. rednet.close("top")
Add Comment
Please, Sign In to add comment