I quick example is:
while x ~= "Exit" do
print("Type Derp to find how much a cheeseburger is")
x = io.read()
if x == "Derp" then
print("$1.49\n")
os.shutdown()
-- I need the shutdown delayed
while x ~= "Exit" do
print("Type Derp to find how much a cheeseburger is")
x = io.read()
if x == "Derp" then
print("$1.49\n")
os.shutdown()
-- I need the shutdown delayed
sleep(number)
will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Just got around to trying it, no luck. I get a ) expected error. Is it supposed to be just: sleep(5)os.shutdown()? That's what I've been trying. Or is it like os.shutdown(sleep5)?I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Then just put sleep(5) before os.shutdown() and it will pause for 5 seconds before shutting down. If you want a longer/shorter time, replace the 5 with another number.
They are supposed to be on separate lines eg:Just got around to trying it, no luck. I get a ) expected error. Is it supposed to be just: sleep(5)os.shutdown()? That's what I've been trying. Or is it like os.shutdown(sleep5)?I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Then just put sleep(5) before os.shutdown() and it will pause for 5 seconds before shutting down. If you want a longer/shorter time, replace the 5 with another number.
x = " "
while not x == "Exit" do
print("Type Derp to find how much a cheeseburger is")
x = io.read()
if x == "Derp" then
print("$1.49")
sleep(5)
os.shutdown()
end
end
They are supposed to be on separate lines eg:Just got around to trying it, no luck. I get a ) expected error. Is it supposed to be just: sleep(5)os.shutdown()? That's what I've been trying. Or is it like os.shutdown(sleep5)?I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Then just put sleep(5) before os.shutdown() and it will pause for 5 seconds before shutting down. If you want a longer/shorter time, replace the 5 with another number.x = " " while not x == "Exit" do print("Type Derp to find how much a cheeseburger is") x = io.read() if x == "Derp" then print("$1.49") I noticed you changed the code a tad bit, is that part needed? or is that just a preference? sleep(5) os.shutdown() end end
fail. I noticed you changed the code a bit, is that needed to make it work, or is it just preference?They are supposed to be on separate lines eg:Just got around to trying it, no luck. I get a ) expected error. Is it supposed to be just: sleep(5)os.shutdown()? That's what I've been trying. Or is it like os.shutdown(sleep5)?I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Then just put sleep(5) before os.shutdown() and it will pause for 5 seconds before shutting down. If you want a longer/shorter time, replace the 5 with another number.x = " " while not x == "Exit" do print("Type Derp to find how much a cheeseburger is") x = io.read() if x == "Derp" then print("$1.49") I noticed you changed the code a tad bit, is that part needed? or is that just a preference? sleep(5) os.shutdown() end end
Well if you're going to be rude about it, I'm not going to help you.fail. I noticed you changed the code a bit, is that needed to make it work, or is it just preference?They are supposed to be on separate lines eg:Just got around to trying it, no luck. I get a ) expected error. Is it supposed to be just: sleep(5)os.shutdown()? That's what I've been trying. Or is it like os.shutdown(sleep5)?I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Then just put sleep(5) before os.shutdown() and it will pause for 5 seconds before shutting down. If you want a longer/shorter time, replace the 5 with another number.x = " " while not x == "Exit" do print("Type Derp to find how much a cheeseburger is") x = io.read() if x == "Derp" then print("$1.49") I noticed you changed the code a tad bit, is that part needed? or is that just a preference? sleep(5) os.shutdown() end end
Sorry for a misunderstanding, I said fail because I had put my response in my code.Well if you're going to be rude about it, I'm not going to help you.fail. I noticed you changed the code a bit, is that needed to make it work, or is it just preference?They are supposed to be on separate lines eg:Just got around to trying it, no luck. I get a ) expected error. Is it supposed to be just: sleep(5)os.shutdown()? That's what I've been trying. Or is it like os.shutdown(sleep5)?I don't mind it being useless before the shutdown.I want it to shutdown.Well, it depends how long you want to delay it for.will sleep the computer for that number of seconds, then carry on to the next line. During the sleep command, the computer cannot process any other commands.sleep(number)
Or, if you want to do other stuff before shutting down, you can use a timer and make the system shut down when the timer goes off. Which is more suiting to what you require?
Yes, I got that bit, but are you planning to do anything else during the delay or do you not mind the computer being useless during the delay before it shuts down?
Then just put sleep(5) before os.shutdown() and it will pause for 5 seconds before shutting down. If you want a longer/shorter time, replace the 5 with another number.x = " " while not x == "Exit" do print("Type Derp to find how much a cheeseburger is") x = io.read() if x == "Derp" then print("$1.49") I noticed you changed the code a tad bit, is that part needed? or is that just a preference? sleep(5) os.shutdown() end end
I believe he was saying fail because he did it wrong, not because of you.
And please actually put your message when quoting - if you do it wrong, edit your message into it rather than posting again.
I believe he was saying fail because he did it wrong, not because of you.
And please actually put your message when quoting - if you do it wrong, edit your message into it rather than posting again.
Was the 2nd comment for me or him?
Right, Ok then. Guessing English isn't your first language (hence it helps to at least say what your native language is, since some people here speak other languages).Sorry for a misunderstanding, I said fail because I had put my response in my code.Well if you're going to be rude about it, I'm not going to help you.fail. I noticed you changed the code a bit, is that needed to make it work, or is it just preference?They are supposed to be on separate lines eg:x = " " while not x == "Exit" do print("Type Derp to find how much a cheeseburger is") x = io.read() if x == "Derp" then print("$1.49") I noticed you changed the code a tad bit, is that part needed? or is that just a preference? sleep(5) os.shutdown() end end
It's fine, I thought it was, but things tend to get confusing around the forums, particularly where new users are concerned.I believe he was saying fail because he did it wrong, not because of you.
And please actually put your message when quoting - if you do it wrong, edit your message into it rather than posting again.
Was the 2nd comment for me or him?
Him - sorry for confusion