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

I need help with a simple program

Started by CardingiSFun, 07 September 2012 - 10:58 PM
CardingiSFun #1
Posted 08 September 2012 - 12:58 AM
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/6ef4dc01a1a5514f652793eb45a057b5
Lettuce #2
Posted 08 September 2012 - 01:03 AM
If you want multiple lines, try mon.print "test" you may or may not need parenthesis, I rarely work with monitors.
Noodle #3
Posted 08 September 2012 - 01:03 AM
mon.write("textn")
n means newline in lua.
NIN3 #4
Posted 08 September 2012 - 01:03 AM
I have this issue too, never figured out how to solve…
Noodle #5
Posted 08 September 2012 - 01:03 AM
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.
CardingiSFun #6
Posted 08 September 2012 - 01:07 AM
mon.write("textn")
n means newline in lua.
That doesnt work
http://i.imgur.com/B6ST0.png
http://i.imgur.com/DjA0Z.png
NIN3 #7
Posted 08 September 2012 - 01: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.
ChaddJackson12 #8
Posted 08 September 2012 - 01: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
Noodle #9
Posted 08 September 2012 - 01:08 AM
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")
CardingiSFun #10
Posted 08 September 2012 - 01:09 AM
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
Noodle #11
Posted 08 September 2012 - 01:10 AM
Okay..
Then just do
term.redirect(mon)
print("text")
print("text")
term.restore()
Lettuce #12
Posted 08 September 2012 - 01:45 AM
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.