TBH seems like just about every other door code out there…not like its easy to make a new door lock thats 120% different.
Looking through it, I also noticed that there is no part that actually can access the computer terminal. This means should there be an issue with the password, or you can't remember it, you have no access to the terminal to remember it. There's also no harm in having the rs. code be actual code, as long as there's nothing hooked up there. Then you can just leave it. I've cleaned it up a bit, making the commenting go with each line of code, instead of having to make the user refer back to the top to see what it means.
--This is a basic lock created by AnDwHaT5
--Settings
local pass = "password" --Change this to your password.
local dpass = "debug" --Change this to a debuging code, never share it!
local open = 0 --Replace 0 with a value for the door/PC wait time
local open2 = 0 --Replace 0 with a value for the reboot time (time until reboot). Recomended to be .5 -> 2.
os.pullEvent = os.pullEventRaw
term.clear() --dont config term.clear()
print("This 'system' is locked by [USER]") --Replace 'system' if you want, [USER] is your name.
write("Password: ")
input = read("*")
if input == pass then
print("Welcome [USER]") --Replace [USER] with your name.
redstone.setOutput("side", true) --Replace "side" with the door side (based on PC)
sleep(open) ---Do not change this here, change it up there.
redstone.setOutput("side", false) --Replace "side" with the door side (based on PC)
term.clear()
term.setCursorPos(1,1)
print("CraftOS 1.4")
sleep(open2)
--os.reboot <-Uncomment that if you want a door lock and comment 'print("CraftOS 1.4")'.
else
print("Wrong password")
sleep(open2)
os.reboot()
end
You also forgot to put in "end" at the, well, end of the code. Otherwise it won't work. Ever. Feel free to use that code above too if you like.