Jump to content




I need help with a simple program


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

#1 CardingiSFun

  • Members
  • 42 posts

Posted 07 September 2012 - 11:58 PM

so im trying to display text on a screen
but it wont show multiple lines
it shows it all in one line can someone help me

code:
http://gyazo.com/6ef...52793eb45a057b5

#2 Lettuce

  • Members
  • 210 posts
  • LocationIn your fridge.

Posted 08 September 2012 - 12:03 AM

If you want multiple lines, try mon.print "test" you may or may not need parenthesis, I rarely work with monitors.

#3 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 08 September 2012 - 12:03 AM

mon.write("textn")
n means newline in lua.

#4 NIN3

  • New Members
  • 57 posts
  • LocationEverywhere.

Posted 08 September 2012 - 12:03 AM

I have this issue too, never figured out how to solve...

#5 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 08 September 2012 - 12:03 AM

View PostLettuce, on 08 September 2012 - 12:03 AM, said:

If you want multiple lines, try mon.print "test" you may or may not need parenthesis, I rarely work with monitors.
Check your references before posting. Wiki
This won't work.

#6 CardingiSFun

  • Members
  • 42 posts

Posted 08 September 2012 - 12:07 AM

View PostNoodle, on 08 September 2012 - 12:03 AM, said:

mon.write("textn")
n means newline in lua.
That doesnt work
http://i.imgur.com/B6ST0.png
http://i.imgur.com/DjA0Z.png

#7 NIN3

  • New Members
  • 57 posts
  • LocationEverywhere.

Posted 08 September 2012 - 12:07 AM

Nor does n /n or *angryrage*

Any other ideas?
EDIT: Found it! mon.setCursorPos(1,[nextline]) with move it to what ever line [nextline] is, and writing will apear there.

NOTE: you must replace nextline, its no magic.

#8 ChaddJackson12

  • Members
  • 264 posts

Posted 08 September 2012 - 12:08 AM

Put this before your code...
THEN remove the mon. before ALL the writes, then replace the writes with print()
Insert the code below above your code. That should redirect text to the TOP monitor!
- I got the code off of this forum, it's not mine :3.

local side = "top"  -- change this
if peripheral.getType(side) ~= "monitor" then
    print("No monitor on that side")
    return -- Neatly exits the program
else
    local monitor = peripheral.wrap(side)
    term.redirect(monitor)
end


#9 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 08 September 2012 - 12:08 AM

View PostCardingiSFun, on 08 September 2012 - 12:07 AM, said:

View PostNoodle, on 08 September 2012 - 12:03 AM, said:

mon.write("textn")
n means newline in lua.
That doesnt work
http://i.imgur.com/B6ST0.png
Pic of screen? Does it give error?
Try doing multiple lines?
mon.write("Textn")
mon.write("Textn")

#10 CardingiSFun

  • Members
  • 42 posts

Posted 08 September 2012 - 12:09 AM

View PostNoodle, on 08 September 2012 - 12:08 AM, said:

View PostCardingiSFun, on 08 September 2012 - 12:07 AM, said:

View PostNoodle, on 08 September 2012 - 12:03 AM, said:

mon.write("textn")
n means newline in lua.
That doesnt work
http://i.imgur.com/B6ST0.png
Pic of screen? Does it give error?
Try doing multiple lines?
mon.write("Textn")
mon.write("Textn")
i already tried that

#11 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 08 September 2012 - 12:10 AM

Okay..
Then just do
term.redirect(mon)
print("text")
print("text")
term.restore()


#12 Lettuce

  • Members
  • 210 posts
  • LocationIn your fridge.

Posted 08 September 2012 - 12:45 AM

View PostNoodle, on 08 September 2012 - 12:03 AM, said:

View PostLettuce, on 08 September 2012 - 12:03 AM, said:

If you want multiple lines, try mon.print "test" you may or may not need parenthesis, I rarely work with monitors.
Check your references before posting. Wiki
This won't work.
My apologies. I assumed it worked the same as on the terminals, just blown up. Argue amongst yourselves, I don't know enough about monitors, apparently.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users