This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
sovani's profile picture

password program help

Started by sovani, 30 October 2012 - 02:13 PM
sovani #1
Posted 30 October 2012 - 03:13 PM
I'm trying to write a password program and it just won't work

correctPassword = "shadow"
write ("please enter password:")
password = read()
If password == correctPassword Then
	  print("correct!")
	  redstone.setOutput("left", true)
	  sleep(5)
	  os.shutdown
else
	  print("incorrect")
	  sleep(5)
	  os.shutdown
end

I am getting a '=' expected error on line 4 (the if statement line). I tried searching for various fixes but nothing seemed to work. Any help would be appreciated :P/>/>
Doyle3694 #2
Posted 30 October 2012 - 03:18 PM
if with non capital i. then with non capital t
Doyle3694 #3
Posted 30 October 2012 - 03:19 PM
btw, it's
 os.shutdown()
sovani #4
Posted 30 October 2012 - 03:29 PM
thanks that did the trick
remiX #5
Posted 30 October 2012 - 05:09 PM
LUA is very case-sensitive :/