0

Is it possible to completely pause a lua script to catch errors, etc..?

Kind of like in batch/dos you just type pause, then it waits for any key to be pressed.

Any possibility to do so in Lua?

7
  • Looks like you can take some ideas from here: stackoverflow.com/questions/5689566/keypress-event-in-lua Commented Jun 10, 2015 at 9:51
  • 1
    You could issue OS pause command, but that's not portable. Commented Jun 10, 2015 at 9:57
  • 1
    If pause is available, use os.execute("pause"). Commented Jun 10, 2015 at 10:56
  • Reading a character from standard input is a slightly more portable alternative I think. Though you may not actually have a standard input available to read from. Commented Jun 10, 2015 at 11:12
  • 2
    io.write"Press Enter to continue...";io.read() Commented Jun 10, 2015 at 12:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.