Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

skyzo63

Members
  • Content Count

    6
  • Joined

  • Last visited

Posts posted by skyzo63

  1. Thanks.
    actually I do not have the mistake anymore,
    but the closing password does not work.
    when i type it he show me that "the password was wrong try again"

     

    the first is the password to open and the second is the password to close

     

    error.png

  2. After several research I find this video, is it possible to adapt it for open computer? here are the two programs used
    

    Startup file:

     

    -- IF YOU USE THIS FOR MY TUTORIAL SAVE THE FILE AS "startup" WITHOUT EXTENSION
     
    pass = "lol" -- CHANGE 'lol' IN TO WHAT EVER YOU LIKE TO CHANGE THE PASSWORD
     
    -- DON'T TOUCH THE CODE IF YOU DON'T UNDERSTAND IT!
    -- IF YOU USE MY CODE AND RELEASE IT ATLREAST GIVE ME SOME CREDIT ^^
     
    term.clear()
    term.setCursorPos(11,3)
    print "[Door Terminal]"
    term.setCursorPos(6,4)
    print "[Enter security password]"
     
    write "\nPassword: "
    input = read()
     if pass == input then
      print "Password Correct"
      sleep(1)
      term.clear()
      shell.run( "door" )
     
     else
      print "Password Incorrect"
      print "Shutting down the system"
      sleep(1)
     
      os.shutdown()
    end

     

    Door file:

    -- IF YOU USE THIS FOR MY TUTORIAL SAVE THE FILE AS "door" WITHOUT EXTENSION
    -- DON'T TOUCH THE CODE IF YOU DON'T UNDERSTAND IT!
    -- IF YOU USE MY CODE AND RELEASE IT ATLREAST GIVE ME SOME CREDIT ^^
     
    term.clear()
    term.setCursorPos(5,1)
    print "[Door Terminal]"
    term.setCursorPos(2,2)
    print "Please select an option"
    term.setCursorPos(2,3)
    print "[1] Open Door"
    term.setCursorPos(2,4)
    print "[2] Close Door"
    term.setCursorPos(2,5)
    print "[3] Lock system"
    term.setCursorPos(2,6)
    print "[4] Shutdown system"
    term.setCursorPos(2,8)
    write "Option: "
    input = read()
     
    if input == '1' then
            redstone.setOutput("back", true)
            term.clear()
            shell.run("door")
    elseif input == '2' then
            redstone.setOutput("back", false)
            term.clear()
            shell.run("door")
    elseif input == '3' then
            term.setCursorPos(2,11)
            print "Locking the system"
            sleep(1)
            shell.run("startup")
    elseif input == '4' then
            term.setCursorPos(2,11)
            print "System shutdown detected"
            sleep(0.5)
            term.setCursorPos(2,12)
            print "[Closing/Locking door]"
            sleep(1)
            os.shutdown()
            end
            term.clear()
            shell.run("door")
     Thanks for your help :)
     
  3.  

    Hello
    Is it possible in the same program to have two passwords to control a door?
    I find this in the archive and I wanted the modified but without success.
    
    
    Quote

    local component=require("component")
    local r=component.redstone
    local gpu=component.gpu
    local term=require("term")

    ---- config section
    local password="1234"
    local delay=5 --time the door stays open
    local side=5 --side of the door, test this
    -----

    local wrong=false

    while true do
      term.clear()
      gpu.set(1,1,"Please enter the password")
      if wrong then
        gpu.set(1,1,"Password was wrong, try again")
        wrong=false
      end
      term.setCursor(1,2)
      local input=io.read()
      if input==password then
         r.setOutput(side,15) -- check if this is the correct function
         os.sleep(delay)
         r.setOutput(side,0) -- same here
      else
         wrong=true
      end
    end

    
    Thanks for your answers
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.