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

[Simple] Double pass door lock [Experimental] V.0.1

Started by dunkee, 17 December 2012 - 07:32 AM
dunkee #1
Posted 17 December 2012 - 08:32 AM
This door lock can wield two passwords to open a door. This project is still a WIP so you do (sadly) have to edit the file to change the passwords and the side of the door. Hopefully i can fix that. If you find any bugs AT ALL, tell me, i will try to kill it with my trusty boot labeled "Old, useless boot".

To download:
pastebin get 
m8L5zytP startup
OR
Go to:

http://pastebin.com/m8L5zytP

Code:
os.pullEvent = os.pullEventRaw()
while true do
    term.clear()
    term.setCursorPos(1,1)
    print ("Enter pass:")
    pass1 = read("*")
    if pass1 == "loopycoopy" then
	    print("Please enter")
	    rs.setOutput("left", true)
	    sleep(3)
	    rs.setOutput("left", true)
	    os.reboot()
    else
	    print("Incorrect password!\nEnter Pass Two")
	    write("Enter Pass:")
	    pass2 = read("*")
	    if pass2 == "Admin" then
		    print ("Please enter")
		    rs.setOutput("right", true)
		    sleep(3)
		    rs.setOutput("right", true)
		    os.reboot()
	    else
		    print ("You may NOT enter")
		    sleep(1)
		    os.reboot()
	    end
    end
end


Credit to:
[member='TheOriginalBIT']
For helping me fix my code! (Or what i so far think is fixed, haven't tested yet, accepting anyone that wants to test or help me code. if you want to try, post down there! And no, you don't HAVE to if you don't want to, i just want to make it easier for me and anyone who wants to help.)
warfar #2
Posted 17 December 2012 - 06:01 PM
wrong section
dunkee #3
Posted 17 December 2012 - 09:00 PM
wrong section
I know, but being the idiot i am, i put it a subsection of programs, instead of just the main programs.
theoriginalbit #4
Posted 18 December 2012 - 01:11 AM
Credit to:
[member='TheOriginalBIT']
For helping me fix my code! (Or what i so far think is fixed, haven't tested yet, accepting anyone that wants to test or help me code. if you want to try, post down there! And no, you don't HAVE to if you don't want to, i just want to make it easier for me and anyone who wants to help.)

your welcome :)/> anytime :)/> just PM me :)/>
Lyqyd #5
Posted 18 December 2012 - 02:56 PM
Moved to main programs section.
rhyleymaster #6
Posted 18 December 2012 - 06:26 PM
Why not just
else if
local ____ = _____
then