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

printing with a newline ... not a ?

Started by etopsirhc, 09 October 2012 - 09:28 PM
etopsirhc #1
Posted 09 October 2012 - 11:28 PM
ok i'm working on making a setup on my server where people can add locations to a file and print up a list of them

the adding to the list is easy , addLocation name x y z
and it will append
name x,y,z
nether equivilent xn,y,zn

unfortinatly the "\n" appears both in terminal and on paper as a question mark
is there a way to get it to appear correctly in more places than just the file?
Orwell #2
Posted 09 October 2012 - 11:33 PM
ok i'm working on making a setup on my server where people can add locations to a file and print up a list of them

the adding to the list is easy , addLocation name x y z
and it will append
name x,y,z
nether equivilent xn,y,zn

unfortinatly the "n" appears both in terminal and on paper as a question mark
is there a way to get it to appear correctly in more places than just the file?

You have to play with (term/mon/printer).setCursorPos() to wrap lines… Easy way to do this is adapting the code of the function print() in bios.lua .
etopsirhc #3
Posted 09 October 2012 - 11:36 PM
i was afraid thats what you'd say ><
looks like i'll have to make a loop and something to split this on n . so much for simple XP
Orwell #4
Posted 09 October 2012 - 11:42 PM
i was afraid thats what you'd say ><
looks like i'll have to make a loop and something to split this on n . so much for simple XP

True story. It's not really hard though. But really, I suggest you to use the print() code from bios.lua . Basically, you only need to replace term there for whatever you want to write to.
etopsirhc #5
Posted 09 October 2012 - 11:45 PM
the term part was only for when i was testing , the main part of what i need to do is all in the printer
and yeah its not really hard , it just i was hoping it would be easy as printer.write(file.readAll())