Warning once u reboot the only way you will be able to edit the code is if u have access to the computers save file on the server
Code
Those who know what there doing
Put it all in your start up
os.pullEvent = os.pullEventRaw
local standby = 10
local side = "top"
local password = "Example"
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
print("Well done")
rs.setOutput(side,true)
sleep(Standby)
rs.setOutput(side,false)
os.reboot()
else
term.clear()
term.setCursorPos(1,1)
print("Your a failure just like trolls in this topic")
sleep(2)
os.reboot()
end
Guide
Just in case your a little unsure
this is one of the most secure pass worded doors you can create have a go and please reply in the comment section if you run into any problems with this guide.
Step 1
If your not sure how to place the console i would suggest you take a look at my other guide http://www.computerc...__fromsearch__1
"edit startup" now enter this heap of code it is commented to enjoy
os.pullEvent = os.pullEventRaw
local opentime = 10 -- Change the 10 how long the door or what ever will stay open
local side = "left" -- Change to where the door is left, right, front, back, bottom, top
local password = "Password" -- Change Password to what you want your password to be.
term.clear()
term.setCursorPos(1,1)
write("Password: ") -- change this if u wish to have a cutom prompt
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
print("Well done you made a lock") -- Change this if you wish to have a custom congratulations
rs.setOutput(side,true)
sleep(opentime)
rs.setOutput(side,false)
os.reboot()
else
term.clear()
term.setCursorPos(1,1)
print("Password incorrect!") -- Change this if you wish to have a custom fail message
sleep(2)
os.reboot()
end
that is it your done its that simple if you want to understand more of what you just did i would suggest checking the tutorial page on the forums for information about if statements and local variables
One last little note from my testing i kept forgetting it was case sensitive make sure you remember to capitalize correctly your password or you may be the one locked out.
I am aware this is identical to the one on the wiki it is most likely the tutorials i looked at were using it as reference it is my own work as i typed it and modified to my liking however if you think there is no need having this tutorial let me know and ill remove it got bigger and better programs on the horizon anyways