Posted 14 April 2013 - 09:08 AM
local pass = ""
term.write ("Please enter the password: ")
read "pass"
if "pass" ~= "ppp" then
print ("Correct password.")
term.write ("program starting")
sleep (1)
term.write (".")
sleep (1)
term.write (".")
sleep (1)
term.write (".")
else
print ("Incorrect password.")
shell.run "funct"
end
I know that I will have ppl shouting at me for my 'unproductive, wrong' code but its my first program. when ever I run it it works fine but when I try type the password, whatever key I type shows up as a 'p' but even when I set the password to say, 'ppp' it still runs the incorrect password line. can you please tell me if its a bug or my code is wrong. can u also tell me how to end a loop in the main computer screen without breaking the computer! thnx in advance PS: sorry if I posted it in the wrong place
term.write ("Please enter the password: ")
read "pass"
if "pass" ~= "ppp" then
print ("Correct password.")
term.write ("program starting")
sleep (1)
term.write (".")
sleep (1)
term.write (".")
sleep (1)
term.write (".")
else
print ("Incorrect password.")
shell.run "funct"
end
I know that I will have ppl shouting at me for my 'unproductive, wrong' code but its my first program. when ever I run it it works fine but when I try type the password, whatever key I type shows up as a 'p' but even when I set the password to say, 'ppp' it still runs the incorrect password line. can you please tell me if its a bug or my code is wrong. can u also tell me how to end a loop in the main computer screen without breaking the computer! thnx in advance PS: sorry if I posted it in the wrong place