Jump to content




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


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

#1 Spongy141

  • Members
  • 526 posts
  • Location'Merica

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.

#2 dissy

  • Members
  • 181 posts

Posted 21 November 2012 - 09:41 PM

View PostSpongy141, on 21 November 2012 - 07:55 PM, said:

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()


#3 Spongy141

  • Members
  • 526 posts
  • Location'Merica

Posted 22 November 2012 - 05:17 AM

View Postdissy, on 21 November 2012 - 09:41 PM, said:

View PostSpongy141, on 21 November 2012 - 07:55 PM, said:

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users