edoreld

Untitled

Mar 29th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local side = "right" -- Change left to whatever side your door / redstone is on, E.G: left, right, front, back, bottom, top. Be sure to leave the "s around it, though
  4. local password = "nananananananana" -- Change bacon to what you want your password to be. Be sure to leave the "s around it, though
  5. local opentime = 5 -- Change 5 to how long (in seconds) you want the redstone current to be on. Don't put "s around it, though
  6. while true do
  7. term.clear() -- Clears the screen
  8. term.setCursorPos(1,1) -- Fixes the cursor position
  9. write("Password: ") -- Prints 'Password: ' to the screen
  10. local input = read("*") -- Makes the variable 'input' have the contents of what the user types in, the "*" part censors out the password
  11. if input == password then -- Checks if the user inputted the correct password
  12. term.clear() -- Already explained up top
  13. term.setCursorPos(1,1)
  14. print("Password correct!") -- Prints 'Password correct!' to the screen
  15. rs.setOutput(side,true) -- Output a redstone current to the side you specified
  16. sleep(opentime) -- Wait the amount of seconds you specifed, then..
  17. rs.setOutput(side,false) -- Stop outputting a redstone current
  18. else -- Checks if the user didn't input the correct password
  19. print("Password incorrect!") -- Prints 'Password incorrect!' to the screen
  20. sleep(2) -- Waits 2 seconds
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment