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

Simple password lock. Partialy Secure.

Started by rhyleymaster, 02 September 2012 - 10:48 PM
rhyleymaster #1
Posted 03 September 2012 - 12:48 AM
Feel free to edit my work.
Basically its a password lock using local q = read("*")
Nothing Special. Its my first program on the CC Forums
.

print("Password Required:")
os.pullEvent = os.pullEventRaw --To cancel out Ctrl+T.
local q = read("*") -- Changes charectars to *'s
if q == ("password") --Put your password there.
then
redstone.setOutput("right",true)
print("Access Granted.")
sleep(3)
os.reboot()
else
print("Access Denied.")
sleep(3)
os.reboot()
end --To cancel if.

Note- I made this for doors. If you want to make it for computer locks, Change redstone.setOutput("right",true) to shell.run("file of choice. i use cannonOS, so i put cannonos here./")
Jahmaican #2
Posted 03 September 2012 - 02:38 AM
Why reboot the computer every time instead putting this into a loop?
rhyleymaster #3
Posted 03 September 2012 - 05:00 AM
I didn't think of that at the time.