Posted 04 August 2012 - 08:36 AM
General Backstory:
I've become known on a couple servers for making billboards and programs so that I/others can easily change the message. However, as I hope all of you know, there is a limit to the size of a monitor. I currently make programs where it prompts the user for line 1, line 2, etc. and assigns variables with io.read(), but I'm not satisfied.
First, I want a way to automatically split a single string into lines. I think the best way to do this would be to find the positions of all the spaces in the message so it doesn't split words, and then split the string at the last space before the width of a screen, and repeat that five or six times to make a separate string for each line on the monitor.
Second, I'd like a way to limit the size of the input string while letting the user know. An example would be like a form on a website that stops displaying the characters after you've entered a certain amount. This part sounds simple to me but I can't quite figure it out.
I'd like to clarify that I am NOT asking for actual code, but mainly the functions that I would need for some of the operations that I need. I have a general understanding of lua in computercraft but I'm just missing what seems like a few puzzle pieces.
I've become known on a couple servers for making billboards and programs so that I/others can easily change the message. However, as I hope all of you know, there is a limit to the size of a monitor. I currently make programs where it prompts the user for line 1, line 2, etc. and assigns variables with io.read(), but I'm not satisfied.
First, I want a way to automatically split a single string into lines. I think the best way to do this would be to find the positions of all the spaces in the message so it doesn't split words, and then split the string at the last space before the width of a screen, and repeat that five or six times to make a separate string for each line on the monitor.
Second, I'd like a way to limit the size of the input string while letting the user know. An example would be like a form on a website that stops displaying the characters after you've entered a certain amount. This part sounds simple to me but I can't quite figure it out.
I'd like to clarify that I am NOT asking for actual code, but mainly the functions that I would need for some of the operations that I need. I have a general understanding of lua in computercraft but I'm just missing what seems like a few puzzle pieces.