I would recommend you wrap the peripheral, set your text scale, and open your rednet side outside of the loop - no reason to do it over and over again. I also recommend that you localize your variables - local variables are safer (because only the program using them can see them) and they are faster as well.
local m = peripheral.wrap("left")
m.setTextScale(1)
rednet.open("right")
while true do
local st = read()
local id, message = rednet.receive()
m.setCursorPos(1,1)
m.write(message)
if st == "end" then
break
end
end
The other problem you are going to run into with your current implementation is that after you type something, the program will still wait to receive a rednet message after you've typed in "end" for example. Also, the program won't receive any messages while it's waiting for your input. I'd suggest using the parallel api so you can wait for rednet message and collect user input at the same time...
local m = peripheral.wrap("left")
m.setTextScale(1)
rednet.open("right")
local target = 52 --# the computer ID you will be sending to
local function getUserInput()
while true do
local st = read()
if st == "end" then
return --# if the user types 'end' then return from this loop and function
else
rednet.send(target, st) --# if the user didn't type 'end' then send the message to the target computer
end
end
end
local function receiveRednet()
while true do
local id, message = rednet.receive()
m.setCursorPos(1,1)
m.write(message)
end
end
parallel.waitForAny(getUserInput, receiveRednet) --# this will allow both functions to operate and will exit if either of them returns