Posted 16 September 2012 - 02:38 AM
Hello, this is my idea of a keycard for a door. I don't know if this will work because I cant test it until computercraft updates to minecraft 1.3/1.4
Anyway, here is the code.
Computer's startup File:
Disk's Startup File:
I believe that if there is a startup file on a disk and a computer the disk's startup file will open instead of the computer's startup file.
To open the door, you insert the disk and turn on the computer. Then you enter the password and the door opens.
Can you guess where i got the password "gullible" from?
Anyway, here is the code.
Computer's startup File:
os.shutdown()
Disk's Startup File:
print("Disk Activated.")
write "Password:"
input = read("*")
print("")
print("")
if input == "gullible"
print("Access Granted!")
redstone.setOutput("right", true)
sleep(5)
redstone.setOutput("right", false)
print("Welcome Home!")
else
print("Access Denied.")
end
sleep(2.5)
term.clear()
term.setCursorPos(1,1)
disk.eject(bottom)
shell.run("shutdown")
I believe that if there is a startup file on a disk and a computer the disk's startup file will open instead of the computer's startup file.
To open the door, you insert the disk and turn on the computer. Then you enter the password and the door opens.
Can you guess where i got the password "gullible" from?