Posted 27 November 2012 - 11:00 AM
I'm coding a program for a password lock door that has a manual override and a master password that bypasses security so I can fully use the terminal. I have no idea what is wrong. Any attempt to help will be appreciated. Here is my code:
term.clear()
term.setCursorPos(1,1)
os.pullEvent = os.pullEventRaw
password = "1234"
masterpassword = "4321"
manualoverride = "5678"
print("Door Status: Locked")
write "Please Enter Password: "
local input = read("*")
if input == (password) then
print("Password Accepted - Access Granted")
redstone.setOutput("back",true)
sleep(7)
os.shutdown
elseif == (masterpassword) then
print("Processing…")
sleep(1)
print("Terminal Is Now Unlocked")
sleep(2)
print("Welcome Back, JdKnight85")
elseif input = (manualoverride) then
print("Override Accepted")
redstone.setOutput("back",true)
else
print("Password Incorrect")
sleep(2)
print("Rebooting…")
sleep(1)
os.reboot
end
Line 37 is "end". Id on't understand why thats wrong. Aren't you supposed to always put "end"
term.clear()
term.setCursorPos(1,1)
os.pullEvent = os.pullEventRaw
password = "1234"
masterpassword = "4321"
manualoverride = "5678"
print("Door Status: Locked")
write "Please Enter Password: "
local input = read("*")
if input == (password) then
print("Password Accepted - Access Granted")
redstone.setOutput("back",true)
sleep(7)
os.shutdown
elseif == (masterpassword) then
print("Processing…")
sleep(1)
print("Terminal Is Now Unlocked")
sleep(2)
print("Welcome Back, JdKnight85")
elseif input = (manualoverride) then
print("Override Accepted")
redstone.setOutput("back",true)
else
print("Password Incorrect")
sleep(2)
print("Rebooting…")
sleep(1)
os.reboot
end
Line 37 is "end". Id on't understand why thats wrong. Aren't you supposed to always put "end"