9 posts
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
13 posts
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.
2447 posts
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()
1111 posts
Location
Portland OR
Posted 29 August 2012 - 11:10 AM
You could also use n which is a newline.
mon.write(text.."n")
9 posts
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.