Jump to content




Monitor - Linebreaking


  • You cannot reply to this topic
5 replies to this topic

#1 GhostOmar

  • Members
  • 7 posts

Posted 22 September 2012 - 09: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

#2 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 22 September 2012 - 09:32 AM

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


More info: http://computercraft...itle=Term_(API)

#3 nolongerexistant

  • Validating
  • 201 posts
  • LocationNetherlands

Posted 22 September 2012 - 11:45 AM

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.

#4 GhostOmar

  • Members
  • 7 posts

Posted 22 September 2012 - 01:26 PM

How can i linebreak with monitor api? mon.write("n") isnt a linebreak help please

#5 GhostOmar

  • Members
  • 7 posts

Posted 22 September 2012 - 01:39 PM

bump

#6 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 22 September 2012 - 02: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....





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users