Jump to content




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


  • You cannot reply to this topic
6 replies to this topic

#1 MatazaNz

  • Members
  • 42 posts
  • LocationNew Zealand

Posted 23 June 2013 - 04: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.

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 23 June 2013 - 04: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.

#3 MatazaNz

  • Members
  • 42 posts
  • LocationNew Zealand

Posted 23 June 2013 - 04:15 AM

Wow, that easy? Thank you friend, you have saved me a lot of time and brain-thrashing :D

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 23 June 2013 - 06:04 AM

Indeed it is that easy :) no problems. :)

#5 johnnic

  • Members
  • 50 posts
  • LocationSomewhere in ****** County, *******

Posted 23 June 2013 - 10:29 PM

You could also use event = os.pullEvent("char")

#6 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 24 June 2013 - 05:23 AM

View Postjohnnic, on 23 June 2013 - 10:29 PM, said:

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.

#7 johnnic

  • Members
  • 50 posts
  • LocationSomewhere in ****** County, *******

Posted 24 June 2013 - 08:14 AM

View Posttheoriginalbit, on 24 June 2013 - 05:23 AM, said:

View Postjohnnic, on 23 June 2013 - 10:29 PM, said:

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.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users