I am making a program that gives a brief tutorial on how to use my very basic API.. How can I make my program stop printing lines on the screen when it is near the bottom, and wait for a keypress before printing another line? Thanks for any help.
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Need help with making use of "Press any button to continue"
Started by MatazaNz, 23 June 2013 - 03:02 AMPosted 23 June 2013 - 05:02 AM
Hi all.
I am making a program that gives a brief tutorial on how to use my very basic API.. How can I make my program stop printing lines on the screen when it is near the bottom, and wait for a keypress before printing another line? Thanks for any help.
I am making a program that gives a brief tutorial on how to use my very basic API.. How can I make my program stop printing lines on the screen when it is near the bottom, and wait for a keypress before printing another line? Thanks for any help.
Posted 23 June 2013 - 05:13 AM
textutils.pagedPrint is the easiest way. Give it a string and it will print it, if/when the text reaches the bottom it will wait for a key press before scrolling.
Posted 23 June 2013 - 05:15 AM
Wow, that easy? Thank you friend, you have saved me a lot of time and brain-thrashing :D/>
Posted 23 June 2013 - 07:04 AM
Indeed it is that easy :)/> no problems. :)/>
Posted 23 June 2013 - 11:29 PM
You could also use event = os.pullEvent("char")
Posted 24 June 2013 - 06:23 AM
I would be more inclined to say you would useYou could also use event = os.pullEvent("char")
os.pullEvent("key")
Also that means that you must write your own handler that writes as much text as it can and then wait for key press, then print the next, and then wait, and then print, wait, print, wait, print, over and over until it is all printed…. Why do that when you can just call a pre-made function that does it for you.
Posted 24 June 2013 - 09:14 AM
I would be more inclined to say you would useYou could also use event = os.pullEvent("char")os.pullEvent("key")
Also that means that you must write your own handler that writes as much text as it can and then wait for key press, then print the next, and then wait, and then print, wait, print, wait, print, over and over until it is all printed…. Why do that when you can just call a pre-made function that does it for you.
Didn't think of that.