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

Monitor - Linebreaking

Started by GhostOmar, 22 September 2012 - 08:26 AM
GhostOmar #1
Posted 22 September 2012 - 10:26 AM
Hello, I am having a problem with linebreaking.

I want to make a code someone wrote for a terminal to display on a 3x3 monitor. Everything is working except for 1 thing, in terminals you can do print() and it skips a line similar to like clicking the ENTER key I tried it with mon.write() it didnt work. I am quite new to coding i tried messing with variables so it would do mon.setCursorPos (1,(Variable Name)+1) but then it would get stuck at the second line.

Thanks for your time
sjele #2
Posted 22 September 2012 - 10:32 AM

term.redirect(peripheral.wrap("right"))
print("Hello  World!")
print("Im a new line")
print("I am one too")


More info: http://computercraft.info/wiki/index.php?title=Term_(API)
nolongerexistant #3
Posted 22 September 2012 - 12:45 PM
Or you can do:
term.redirect(peripheral.wrap("right"))
print("I'm line 1!nI'm line 2!nI'm another line!")

n is a linebreak in LUA.
GhostOmar #4
Posted 22 September 2012 - 02:26 PM
How can i linebreak with monitor api? mon.write("n") isnt a linebreak help please
GhostOmar #5
Posted 22 September 2012 - 02:39 PM
bump
Luanub #6
Posted 22 September 2012 - 03:12 PM
You can't. There's already 2 solutions to your problem posted.

Please don't bump post so soon, there's simply no need, especially not when you've been answered….