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

2 Passwords for 1 Computer

Started by Keego, 08 December 2012 - 09:16 AM
Keego #1
Posted 08 December 2012 - 10:16 AM
Hello I <3 this mod because I can learn with fun but I got a problem and I cant fix it. (Its the startup)
I want to come into the computer in 2 diferent ways. If i forget one password i want to use the other one. Thank you so much if you can help me :)/> !
My Error is : bios:338:[string "startup"]:35: '=' expected

shell.run("clear")
print("Passwort eingeben")
local input = read ("*")
if input == "password1" then
shell.run("clear")
I = 0
while I < 100 do
 sleep(0.5)
 I =(I + 10)
 shell.run("clear")
 print(I)
 end
shell.run("clear")
print("------------------------------")
print("")
print("	   Wilkommen Username 	   ")
print("	Windows XP Professional   ")
print("------------------------------")
else if input == "password2" then
shell.run("clear")
B = 0
while B < 100 do
 sleep(0.5)
 B =(B + 5)
 shell.run("clear")
 print(B)/>/>
 end
shell.run("clear")
print("------------------------------")
print("")
print("		   Wilkommen		  ")
print("	 Windows XP Professioal   ")
print("------------------------------")
else
os.shutdown()
end
end
Bubba #2
Posted 08 December 2012 - 11:07 AM
You're missing the parentheses at os.shutdown on line 34. It should be os.shutdown() as you are calling a function.
Keego #3
Posted 08 December 2012 - 11:11 AM
I corected it in the post that you can use it it works. :)/> thx Bubba
Doyle3694 #4
Posted 08 December 2012 - 11:59 AM
'elseif' and not 'else if' else if will make it think you are starting a new if statement if the condition is not met, thos you will need another end, but as I said, best fix is retypeing it to 'elseif'
bjornir90 #5
Posted 08 December 2012 - 07:04 PM
'elseif' and not 'else if' else if will make it think you are starting a new if statement if the condition is not met, thos you will need another end, but as I said, best fix is retypeing it to 'elseif'
I know i'm off-topic but I don't see the point of starting a new if statement with else if instead of just typing elseif ?