Posted 24 December 2014 - 03:24 PM
Hi Guys
I am new to computer craft and am learning lua piece by piece but i am stuck at this point. I have attempted to troubleshoot using your helpful guide but can't find the problem so can anyone help me with this. I am trying to make a door program that allows me to enter a username and a password for a door set to the right. The error is = 'expected' line 16. Code Below. Also if you see any other problems please can you point them out before i struggle with more.
I am new to computer craft and am learning lua piece by piece but i am stuck at this point. I have attempted to troubleshoot using your helpful guide but can't find the problem so can anyone help me with this. I am trying to make a door program that allows me to enter a username and a password for a door set to the right. The error is = 'expected' line 16. Code Below. Also if you see any other problems please can you point them out before i struggle with more.
username = Daniel
password = 080397
print("Welcome to Nuclear Control")
write("Username: ")
user = read()
if user == username then
print("Username Accepted, Enter Password")
write("Password: ")
pass = read(*)
if pass == password then
print("Password Accepted, Welcome Daniel")
rs.setOutput("Right", true)
sleep(4)
os.reboot
else not pass == password then
print("Password Denied, System Rebooting")
sleep(2)
os.reboot
end
else user not = username then
print("Username Invailed, Restarting System")
sleep(2)
os.reboot
end