14 posts
Posted 06 November 2012 - 08:38 AM
hello, when i try to make a printer print a string value does it always say it's nil even when the print api shows the tekst just fine.
so how can i make a printer print a string value?
2217 posts
Location
3232235883
Posted 06 November 2012 - 08:50 AM
the printer isnt an api, you have to wrap it first
local printer = peripheral.wrap("side")
now any printer functions work
e.g.
local printer = peripheral.wrap("right")
printer.write("ALL THE THINGS!")
8543 posts
Posted 06 November 2012 - 08:51 AM
Please post the full code and the full error message.
14 posts
Posted 07 November 2012 - 05:47 AM
got it to work thanks to pixeltoats. now a different question, how can i make the computer count the amount of letters in a received rednet message?
8543 posts
Posted 07 November 2012 - 06:37 AM
id, message = rednet.receive()
stringLength = string.len(message)
14 posts
Posted 09 November 2012 - 04:45 AM
thanks alot
some more questions i came up with (i never like to make about a billion topics for each question i have to ask).
how can i make the computer change a string value? example: the value is "this is a string value'' and the script edit it in such a way that each word is on a different line.
is there a way to turn a file into a string value? example: there is a file on the computer called ''text'' which contains text which then could be opened into a program to make the value "textfile" the text in the the file "text".
8543 posts
Posted 09 November 2012 - 06:41 AM
Check out the tutorials section.
14 posts
Posted 09 November 2012 - 11:45 PM
i found how to make the script read/write files and how to enter a string on different lines.
but can't find how to edit a string value. what i want to do is make a script that automatically creates a new line every X amount of letters from a string value.