1. #1
    Keyboard Turner
    Join Date
    Oct 2012
    Location
    Aalborg
    Posts
    5

    Help with passworded doors in computer craft.

    Hello, i need some help to password protect my doors, i've tried to watch videos but none of the programs seem to work, i would very much apreciate the help, if you could write how to do it.

  2. #2
    The Patient spambanjo's Avatar
    Join Date
    Aug 2012
    Location
    Staffordshire, UK
    Posts
    244
    If I can work out a way to extract it from my server at home without needing to type the whole thing out again I will post a couple of simple scripts I wrote to password protect a terminal. It can also be used with "open" and "close" commands to operate a door connected to the terminal. It's what I used on my original Nuclear reactor to make sure nobody messed with my setup.

    Currently it does not have termination protection as I have never needed to secure it to that level.
    Quote Originally Posted by Пламяскверны

  3. #3
    LOAD"*",8,1 Fuzzzie's Avatar
    Join Date
    Nov 2008
    Location
    Legion of Doom Headquarters
    Posts
    20,349
    Code:
    while true do
    os.pullEvent =os.pullEventRaw
    term.clear()
    term.setCursorPos(1, 1)
    write("Please Enter Password: ")
    input = read("*")
    if input == "Password" then
    redstone.setOutput("right", true)
    sleep(3)
    redstone.setOutput("right", false)
    sleep(1)
    os.reboot()
    else
    print("Incorrect! Try again later.")
    sleep(1)
    print("Shutting Down")
    sleep(1)
    os.reboot()
    make sure you write this in LUA and you save it.

    Lot's of great programs over at http://www.computercraft.info/forums2/
    That's where I got this. Credit to Hancomat55

  4. #4
    Blademaster
    Join Date
    Nov 2010
    Location
    Palm Desert, CA
    Posts
    43
    I use the same code as posted above^
    make sure you change the line

    redstone.setOutput("right", true)

    if you need it on the left of the computer or whatever you need... you will also need to change the line below it to close the door... you can take this a step further if you'd like and change the password from "Password" to what you want.. and change things like the time the door stays open "sleep(3)"

    those computercraft forums are very helpful, i was writing a program to run my quarries and water pumps remotely and they helped me solve a few small errors
    Quote Originally Posted by Kripthmaul View Post
    Your just not ressourcefull....And your translator either suck or you cant english.

  5. #5
    Keyboard Turner
    Join Date
    Oct 2012
    Location
    Aalborg
    Posts
    5
    hey huys thank you very much for the help, and the tweaks, keep on posting things about computercraft, like bugs that we should be aware off, or if you have found some new way to program stuff.

    once again thank you guys for the help.

    ---------- Post added 2012-10-19 at 01:28 PM ----------

    How do i save stuff in LUA?
    Last edited by mcbalfg; 2012-10-19 at 11:28 AM.

  6. #6
    The Patient spambanjo's Avatar
    Join Date
    Aug 2012
    Location
    Staffordshire, UK
    Posts
    244
    Gah, sorry dude completely forgot about this last night. Will try to remember to do it later.

    My script (technically 3 scripts that work together) is different from the one posted above in that mine allows for multiple attempts (3) before shutting down the OS and still functions as a regular terminal once you have entered your password. You then type "open" or "close" to operate the door (or sticky piston based security). Instead of automatically closing the door behind you, mine waits for you to type "close". The reason for this was that mine is intended to protect a reactor which is in a "room" full of water that you can't actually walk into.

    On a different note, programming LUA is surprisingly easy thanks to google and making a script do exactly what you want is incredibly rewarding. I'd highly recommend spending an hour or two poking around with some code to see if it begins to make more sense.
    Quote Originally Posted by Пламяскверны

  7. #7
    LOAD"*",8,1 Fuzzzie's Avatar
    Join Date
    Nov 2008
    Location
    Legion of Doom Headquarters
    Posts
    20,349
    Quote Originally Posted by mcbalfg View Post
    How do i save stuff in LUA?
    To Edit a program type "Edit <programname>"

    to save and exit the editor hit CTRL and then the save and exit options are at the bottom.

  8. #8
    Keyboard Turner
    Join Date
    Oct 2012
    Location
    Aalborg
    Posts
    5
    spambanjo could you please link me to the site where i can do that

    and thank you fuzzzie

  9. #9
    The Patient spambanjo's Avatar
    Join Date
    Aug 2012
    Location
    Staffordshire, UK
    Posts
    244
    I didn't forget about you dude, but it seems my local copy of my server is older than I thought, as it doesn't have a terminal in the nuclear reactor building on my most recent version. I'll speak to our hosting company at some point and get FTP access to our live version of the server (I need to have a recent local backup of the current files anyway)... so I'll grab the script then.
    Quote Originally Posted by Пламяскверны

  10. #10
    Keyboard Turner
    Join Date
    Oct 2012
    Location
    Aalborg
    Posts
    5
    i seem to have troubles with the codes that you have given me, i can't make them work for some reason, even though i have writen exactly what you wrote, any suggestions to that guys?

  11. #11
    Can't people just take a pickaxe to your door? And buttons are difficult enough passwords for your average creeper.

  12. #12
    LOAD"*",8,1 Fuzzzie's Avatar
    Join Date
    Nov 2008
    Location
    Legion of Doom Headquarters
    Posts
    20,349
    Quote Originally Posted by Powerogue View Post
    Can't people just take a pickaxe to your door? And buttons are difficult enough passwords for your average creeper.
    If you're playing on a server, chances are your property is protected so nobody can break any blocks.
    If you're not on a server then chances are you don't need a password protected door.

  13. #13
    Quote Originally Posted by Powerogue View Post
    Can't people just take a pickaxe to your door? And buttons are difficult enough passwords for your average creeper.
    This is why we can't have nice things. Stop asking "Why?" and instead ask "Why not?"
    Just calm down.
    My Stream - My Youtube Channel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •