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

is there a shutdown function that you can use in your code?

Started by Spongy141, 21 November 2012 - 06:55 PM
Spongy141 #1
Posted 21 November 2012 - 07:55 PM
I was making a password code that if you get the password wrong it would shutdown the computer making it so that (as long as the file is named "startup") you would always have to try the password again instead of the program ending, or looping. The code Im talking about if something like "open program == ("shutdown")" and it would shutdown the computer alowing the hackers not to be able to get into your computer without a password.
dissy #2
Posted 21 November 2012 - 09:41 PM
I was making a password code that if you get the password wrong it would shutdown the computer making it so that (as long as the file is named "startup") you would always have to try the password again instead of the program ending, or looping. The code Im talking about if something like "open program == ("shutdown")" and it would shutdown the computer alowing the hackers not to be able to get into your computer without a password.

Yup! The command you are looking for is:

os.shutdown()

There is also

os.reboot()
Spongy141 #3
Posted 22 November 2012 - 05:17 AM
I was making a password code that if you get the password wrong it would shutdown the computer making it so that (as long as the file is named "startup") you would always have to try the password again instead of the program ending, or looping. The code Im talking about if something like "open program == ("shutdown")" and it would shutdown the computer alowing the hackers not to be able to get into your computer without a password.

Yup! The command you are looking for is:

os.shutdown()

There is also

os.reboot()
Thanks, I knew there was, just that I took a 6 month vacation from computercraft so I forgot most of the code.