Posted 20 December 2012 - 02:08 PM
Hello!
I have copyed a code i found on youtube, and I have added some of my own. No I would like to add a feature that flashes.
What my code does:
Asks for password, right password open door, wrong password 2 times starts an alarm, and asks for an administrator password.
I would like to add one more feature that I have spent hours trying to do…
After the alarm goes off it asks for administrator password, if you enter this wrong I would like rs.setOutput left to flash whit 1 seconds between flashes. This will turn on and off untill the right administratorpassword is entered correct..
Can sombody help me with this?
This is my code so far: (I may misspell somthing since I dont copy paste)
Again, I wrote this code off my minecraft computer so there may be som spelling issues, but the code works on my ingame computer :)/>
Thanks
-Kjetil (Norway)
I have copyed a code i found on youtube, and I have added some of my own. No I would like to add a feature that flashes.
What my code does:
Asks for password, right password open door, wrong password 2 times starts an alarm, and asks for an administrator password.
I would like to add one more feature that I have spent hours trying to do…
After the alarm goes off it asks for administrator password, if you enter this wrong I would like rs.setOutput left to flash whit 1 seconds between flashes. This will turn on and off untill the right administratorpassword is entered correct..
Can sombody help me with this?
This is my code so far: (I may misspell somthing since I dont copy paste)
os.pullEvent = os.pullEventRaw
tectutils.slowPrint("Radioactive hazard area, atuhorized personnel only")
sleep(1)
print ("Please log in; ")
sleep(1)
write("x")
password = io.read()
if password == "passord" then
print ("Authorizing, please stand by")
textutils.slowprint("..............................")
sleep(1)
print ("Welcome to Black Mesa nukelear facility")
rs.setOutput ("right" , true )
sleep(4)
rs.setOutput ("right" , false)
else
print ("Authorizing, please stand by")
textutil.slowPrint("..................................")
sleep(1)
print ("Wrong password, 1 try left. ")
sleep(1)
print ("Please input correct password")
write("x")
password = io.read()
if password = "passord" then
rs.setOutput ("right" , true )
sleep(4)
rs.setOutput ("right" , false)
else
print ("Authorizing, please stand by")
textutils.slowPrint("................................")
sleep(1)
print ("Wrong password")
sleep(1)
textutils.slowPrint("Hazard area breach - Activating alarm")
repeat
rs.setOutput ("top" , true )
sleep(1)
print ("Failsafe mode activated")
textutils.slowPrint("Enter deactivation password; ")
sleep(1)
failsafe = io.read()
if failsafe == "passord1" then
rs.setOutput ("top" , false )
break
else
print ("Wrong deactivation password")
end
until i==3
end
end
Again, I wrote this code off my minecraft computer so there may be som spelling issues, but the code works on my ingame computer :)/>
Thanks
-Kjetil (Norway)