Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Viewer Script
- -- Define the side where the modem is connected
- local modemSide = "bottom" -- Change this to match your setup
- -- Open the modem on the specified side
- local modem = peripheral.wrap(modemSide)
- modem.open(123) -- Use the same port number as the sender
- -- Function to receive and display screen data
- local function receiveAndDisplay()
- while true do
- local _, _, senderChannel, _, screenData = os.pullEvent("modem_message")
- if senderChannel == 123 then -- Check if the message is from the sender
- term.blit(unpack(screenData)) -- Display received screen data
- end
- end
- end
- -- Clear the terminal
- term.clear()
- term.setCursorPos(1, 1)
- -- Start receiving and displaying screen data
- receiveAndDisplay()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement