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

Expected "=" on line 21

Started by BasicContainment, 18 August 2016 - 03:59 PM
BasicContainment #1
Posted 18 August 2016 - 05:59 PM
I keep getting this error when I reboot the computer. It is a startup command if it matters.

print("Input Password To Open Prison Door")
password = read()
if password == "Hanns-G" then
print ("Access Granted")
redstone.setOutput("back",true)
sleep(3)
redstone.setOutput("back",false)
os.shutdown()
elseif password == "Monitor" then
exit()
elseif password == "Punch" then
print("You Monster!")
redstone.setOutput("top",true)
sleep(1)
redstone.setOutput("top",false)
else
print("Access Denied, Shutting Down")
sleep(3)
os.shutdown

end – This is where the error lies. A value is expected.
Lyqyd #2
Posted 18 August 2016 - 08:47 PM
You forgot the parentheses on the os.shutdown call just above the end.
sonic_overlord25 #3
Posted 20 August 2016 - 07:02 AM
If I may make a suggestion, you can mask the user input on line two by typing

password = read("*")

This will replace the characters that the user is typing in to an asterisk. You can substitute any character between the quotation marks to be used as a mask.