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

Need help with making use of "Press any button to continue"

Started by MatazaNz, 23 June 2013 - 03:02 AM
MatazaNz #1
Posted 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.
theoriginalbit #2
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.
MatazaNz #3
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/>
theoriginalbit #4
Posted 23 June 2013 - 07:04 AM
Indeed it is that easy :)/> no problems. :)/>
johnnic #5
Posted 23 June 2013 - 11:29 PM
You could also use event = os.pullEvent("char")
theoriginalbit #6
Posted 24 June 2013 - 06:23 AM
You could also use event = os.pullEvent("char")
I would be more inclined to say you would use


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.
johnnic #7
Posted 24 June 2013 - 09:14 AM
You could also use event = os.pullEvent("char")
I would be more inclined to say you would use


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.