Advertisement
ElijahCrafter

Untitled

Feb 21st, 2024 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. -- Prompt the user to enter the ID of the target computer
  2. print("Enter the ID of the target computer:")
  3. local targetID = tonumber(read())
  4.  
  5. -- Initialize modem
  6. rednet.open("top")
  7.  
  8. -- Request the target computer to broadcast its screen
  9. rednet.broadcast("screen_request", targetID)
  10.  
  11. -- Listen for the response from the target computer
  12. while true do
  13.     local senderID, message = rednet.receive()
  14.     if senderID == targetID and message then
  15.         -- Print the received screen data to the current computer's monitor
  16.         term.clear()
  17.         term.setCursorPos(1, 1)
  18.         print(message)
  19.     end
  20. end
  21.  
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement