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

Password Protected Door

Started by unstopablekk, 20 April 2012 - 12:46 AM
unstopablekk #1
Posted 20 April 2012 - 02:46 AM
An actual real one. I havent played minecraft with cc in a long time since I had to run my server for 100 players :)/>/> I just let a moderator take over for a while and joined a tekkit server. I just want a password door. I have the redstone setup to the back of the computer and all i need is the script. Too re-research computercraft.
Thanks Much appreciated!
EmTeaKay #2
Posted 20 April 2012 - 04:21 AM

local oldPull = os.pullEvent;
os.pullEvent = os.pullEventRaw;
term.clear()
term.setCursorPos(1,1)
correctpass = "Open"
write("Enter Password: ")
pass = read("*")
if pass == (correctpass) then
write("Opening Door")
redstone.setOutput("back", true )
sleep(3)
redstone.setOutput("back", false )
os.shutdown()
end
write("Incorrect Password")
sleep(3)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Terminal Locking Down in 3... 2... 1...")
sleep(.5)
os.shutdown()
os.pullEvent = oldPull;
You can change the password and sayings to what suits you.
BigSHinyToys #3
Posted 20 April 2012 - 12:23 PM
that is a good lock but there are three ways around it.

make a disk. Make a program on the disk called startup.Put one of these in that program

One

print("Open")

Two

correctpass = "123"
Shell.run(startup)
when asked for pass just enter 123

Three

os.pullEventRaw = os.pullEvent:
Shell.run(startup)
and Ctrl T it


place disk in a drive next to the computer while it is shutdown startup computer.
Dirkus7 #4
Posted 20 April 2012 - 03:20 PM
Then don't put the password program on the terminal, but on a disk and make a disk drive on the top of the computer. and make it so that people can't get into it.
EmTeaKay #5
Posted 20 April 2012 - 05:07 PM
He asked for a password lock, I gave it to him. And I know there are plenty of ways to get the password of a computer.
Robd #6
Posted 21 April 2012 - 04:51 AM
that is a good lock but there are three ways around it.

make a disk. Make a program on the disk called startup.Put one of these in that program

One

print("Open")

Two

correctpass = "123"
Shell.run(startup)
when asked for pass just enter 123

Three

os.pullEventRaw = os.pullEvent:
Shell.run(startup)
and Ctrl T it


place disk in a drive next to the computer while it is shutdown startup computer.
Or you could bypass the terminal all together and use the infamous "redstone torch" method lol (hehe) :)/>/> :)/>/>
unstopablekk #7
Posted 21 April 2012 - 03:10 PM
Im good with that script thankyou! Im on a tekkit server and people freaked out when I got the computer to say "Rawr" lol (noobs)
EmTeaKay #8
Posted 21 April 2012 - 04:56 PM
lol! That's funny. And don't forget to do this:

shell.run("clear")
textutlis.slowPrint("You have been chosen to...")
sleep(4)
shell.run("clear")
textutlis.slowPrint("DIE!")
sleep(3)
os.shutdown()
end
BigSHinyToys #9
Posted 21 April 2012 - 09:45 PM
Slightly modified for maximum effect
1) Save as startup
2 )Shutdown computer
3) Place TNT bellow computer
4) lol

shell.run("clear")
textutlis.slowPrint("You have been chosen to...")
sleep(2)
rs.setOutput ("bottom", true) -- with TNT under terminal
sleep(2)
shell.run("clear")
textutlis.slowPrint("DIE!")
sleep(3)
os.shutdown()
end
credit to EmTeaKay
EmTeaKay #10
Posted 22 April 2012 - 12:55 AM
Slightly modified for maximum effect
1) Save as startup
2 )Shutdown computer
3) Place TNT bellow computer
4) lol

shell.run("clear")
textutlis.slowPrint("You have been chosen to...")
sleep(2)
rs.setOutput ("bottom", true) -- with TNT under terminal
sleep(2)
shell.run("clear")
textutlis.slowPrint("DIE!")
sleep(3)
os.shutdown()
end
credit to EmTeaKay
This is tons better! I would love to see them rage quit after this. And the best part? It only requires 10 lines of coding! (I counted)
Robd #11
Posted 23 April 2012 - 09:21 PM
Slightly modified for maximum effect
1) Save as startup
2 )Shutdown computer
3) Place TNT bellow computer
4) lol

shell.run("clear")
textutlis.slowPrint("You have been chosen to...")
sleep(2)
rs.setOutput ("bottom", true) -- with TNT under terminal
sleep(2)
shell.run("clear")
textutlis.slowPrint("DIE!")
sleep(3)
os.shutdown()
end
credit to EmTeaKay
This is tons better! I would love to see them rage quit after this. And the best part? It only requires 10 lines of coding! (I counted)
Then there's always the infamous piston platform in front of the computer hehe (stick a nice little lava pit underneath >:)/>/> )
EmTeaKay #12
Posted 25 April 2012 - 01:03 AM
You're right, lava is better, as it burns their items too.
gringomotel #13
Posted 12 January 2013 - 01:05 AM
I love the lava Idea haha!!
Mikeemoo #14
Posted 12 January 2013 - 01:13 AM
Necro!
Ivanthefirst #15
Posted 05 October 2013 - 05:41 PM
The code posted by EmTeaKay works well. I have no problem getting it to work out the back via red-stone to the door or without the red-stone by placing computer next to the door. I can enter the password and door opens and closes just fine. My problem is that the door is not locked. When I or anyone else comes up to door they can click on door and it opens just as any other door does. What did I miss?
awsmazinggenius #16
Posted 06 October 2013 - 02:06 PM
I just added to this, changed a bit of wording…

term.clear()				
term.setCursorPos(1,1)				
textutils.slowPrint("Please ... walk inside.")				
sleep(0.7)				
rs.setOutput("left", true)				
sleep(1.5)				
textutils.slowPrint("and...")				
sleep(1.5)				
term.clear()				
if term.isColor == true then			  
  term.setTextColor(colors.red)				
  term.write("DIE!!!")				
  term.setTextColor(colors.whte)				
  rs.setOutput("bottom", true])				
else			  
  print("DIE!!!")				
  rs.setOutput("bottom", true)				
end			
This assumes you have an iron door on the left, and TNT on the bottom. As well as an (empty) chest on the inside and a server plugin to prevent others from breaking or placing blocks.
ThiagoTGM #17
Posted 06 October 2013 - 10:00 PM
The code posted by EmTeaKay works well. I have no problem getting it to work out the back via red-stone to the door or without the red-stone by placing computer next to the door. I can enter the password and door opens and closes just fine. My problem is that the door is not locked. When I or anyone else comes up to door they can click on door and it opens just as any other door does. What did I miss?
Use Iron Doors?
Agoldfish #18
Posted 08 October 2013 - 02:45 PM
If you wanted a SUPER simple one…


-- Make a new program and make the program name your password
print"Correct"
redstone.setOutput("left",true)
sleep(2)
redstone.setOutput("left",false)
I know, plenty of ways around it.
Ivanthefirst #19
Posted 08 October 2013 - 08:22 PM
Iron door it is. So simple once you add the iron door.
Thanks all.
overfritz #20
Posted 09 October 2013 - 04:05 PM
For those who want a convenient way to get the TNT & Computer setup, I made a paste for it. Credit has been given where credit is due.

pastebin get bdFAqPfp explode
rhyleymaster #21
Posted 14 October 2013 - 01:32 PM
Can we get this thread Locked, as the OP didn't have any code. Or at least move this to general.
VintageGaming #22
Posted 14 October 2013 - 09:07 PM
I have one. Check out my Pastebin Here, it's somewhere in there.
Cranium #23
Posted 16 October 2013 - 12:04 PM
There was never any reason to bring this back.

Locked.