Posted 07 August 2012 - 08:48 AM
Please fix this code for me! Anyways I found it and it doesn't work but I would really like to have a password door with Admin access.
I have already figured out great password door stuff but I have no idea how to make an Admin password that will exit the program.
At the very least though, i'd be very grateful if you could fix this code for me, as i've tried numerous times! Thanks
I have already figured out great password door stuff but I have no idea how to make an Admin password that will exit the program.
At the very least though, i'd be very grateful if you could fix this code for me, as i've tried numerous times! Thanks
os.pullEvent = os.pullEventRaw
local side = "right"
local password1 = "1"
local password2 = "2"
local password3 = "3"
local passwordadmin = "admin"
term.clear()
sleep(1)
print("Loading...")
sleep(2)
print("KOP Lock v1.0 Loaded")
print("Welcome to the _____.")
print("To continue please enter password.")
write("Password: ")
local input = read("*")
if input == password1 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Welcome ______")
rs.setOutput(side,true)
sleep(4)
rs.setOutput(side,false)
os.reboot()
end
if input == password2 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Welcome ______")
rs.setOutput(side,true)
sleep(4)
rs.setOutput(side,false)
os.reboot()
end
if input == password3 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Welcome _____")
rs.setOutput(side,true)
sleep(4)
rs.setOutput(side,false)
os.reboot()
end
if input == passwordadmin then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Computer unlocking...")
print("Please type 'reboot' or 'shutdown' before leaving")
os.pullEvent(terminate)
else
term.clear()
term.setCursorPos(1,1)
print("Password incorrect!")
sleep(2)
os.reboot()
end