edoreld

Untitled

May 22nd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local side = "bottom" -- 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 = "phoenix" -- 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.  
  10. print("Welcome to Promethea")
  11. print("To exit the spawn area and start exploring, please input the code that you can find in the server rules.")
  12. print("It's a word that does not make sense in the sentence where it's written.")
  13. print("A link to the server rules can be found in the terminal on the other side of this room.")
  14. write("Code: ") -- Prints 'Password: ' to the screen
  15. local input = read("*") -- Makes the variable 'input' have the contents of what the user types in, the "*" part censors out the password
  16. if input == password then -- Checks if the user inputted the correct password
  17. term.clear() -- Already explained up top
  18. term.setCursorPos(1,1)
  19. print("Code accepted!") -- Prints 'Password correct!' to the screen
  20. rs.setOutput(side,true) -- Output a redstone current to the side you specified
  21. sleep(opentime) -- Wait the amount of seconds you specifed, then..
  22. rs.setOutput(side,false) -- Stop outputting a redstone current
  23. else -- Checks if the user didn't input the correct password
  24. print("Code rejected!") -- Prints 'Password incorrect!' to the screen
  25. os.sleep(2) -- Waits 2 seconds
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment