Posted 18 May 2013 - 07:55 PM
If I may inquire something similar;
I'm trying to create a program ending which triggers when the user presses a button.
For example;
Which will indeed end the program after 'e' is pressed, but it will regardless interrupt the program waiting for user input.
What I would like to know is how to tell the program that if it detects NO input, it should just continue on with the program. (Just keep refreshing the time until interrupted)
Thank you in advance!
I'm trying to create a program ending which triggers when the user presses a button.
For example;
while true do
local time = os.time()
print ("Tick: " ..time)
event, param1 = os.pullEvent()
if event == "char" and param1 == "e"
break
sleep(1)
end
Which will indeed end the program after 'e' is pressed, but it will regardless interrupt the program waiting for user input.
What I would like to know is how to tell the program that if it detects NO input, it should just continue on with the program. (Just keep refreshing the time until interrupted)
Thank you in advance!