Posted 19 December 2014 - 04:13 PM
I have a modem that receives a message from another computer. How do i make the message appear on the terminal above the second computer?
while true do
local msg = rednet.recieve()
print(msg)
mon = peripheral.wrap('top') --#Wrap monitor
for i, v in pairs(rs.getSides()) do
if peripheral.getType(v) == "modem" then
rednet.open(v) --#Open rednet on any side that has a modem
end
end
local m, m1, m2 = rednet.receive() --#Wait for message
m = m or ""
mon.write(m) --#Display on monitor
print(m) --#Display on terminal