This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ScSEre's profile picture

Monitor problem

Started by ScSEre, 29 August 2012 - 01:37 AM
ScSEre #1
Posted 29 August 2012 - 03:37 AM
Hey guys,

is there no way to print a line on a monitor? Tried:

mon = peripheral.wrap( side )
mon.write(text)
mon.write(text2)

but both words are in one line.

Hope someone can help me and thanks in advance
NeoHummel #2
Posted 29 August 2012 - 03:41 AM
Have you tried using the print function?


mon = peripheral.wrap( side )
mon.print(text)
mon.print(text2)

That should add newlines after the separate print actions.
Cloudy #3
Posted 29 August 2012 - 11:02 AM
Which doesn't exist. If you want to do print on a monitor, you have a few options. 1. Copy the print function from the bios and alter it to refer to term instead. 2. Manually set the cursor position down a line after writing. 3. Use term.redirect. Example:

local mon = peripheral.wrap("side")
term.redirect(mon)
print("lol")
print("lol2")
-- and when you're done
term.restore()
Luanub #4
Posted 29 August 2012 - 11:10 AM
You could also use n which is a newline.


mon.write(text.."n")
ScSEre #5
Posted 29 August 2012 - 12:46 PM
Thanks for your replies.

You could also use n which is a newline.


mon.write(text.."n")
I already tried it but it will print a "?" on a monitor

Which doesn't exist. If you want to do print on a monitor, you have a few options. 1. Copy the print function from the bios and alter it to refer to term instead. 2. Manually set the cursor position down a line after writing. 3. Use term.redirect. Example:

local mon = peripheral.wrap("side")
term.redirect(mon)
print("lol")
print("lol2")
-- and when you're done
term.restore()

Thanks a lot! I'm now using "term.redirect" and it works perfectly.