Advertisement
Guest User

editing

a guest
May 3rd, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. --local oldPull = os.pullEvent
  2. --os.pullEvent = os.pullEventRaw
  3.  
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. local month = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
  7. local password, statement
  8.  
  9.   password = month[math.random(1,12)]
  10.   statement = "Which Month of the year am I thinking of?"
  11.  
  12. local status, input
  13.  
  14. repeat
  15.   term.setTextColor(colors.blue)
  16.   print(statement)
  17.   term.setTextColor(colors.white)
  18.   status, input = pcall(read)
  19.   if input ~= password then
  20.     term.setTextColor(colors.red)
  21.     print("Incorrect.\n")
  22.   end
  23.   if input == "override"  then
  24.     redstone.setOutput("right", true)
  25.     sleep(5)
  26.     redstone.setOutput("right", false)
  27.   end
  28. until input == password
  29.  
  30. term.setTextColour(colors.green)
  31. print("ACCESS GRANTED!")
  32.  
  33. term.setTextColour(colors.orange)
  34. print("Hit ESC to continue...")
  35. redstone.setOutput("right", true)
  36. sleep(5)
  37. redstone.setOutput("right", false)
  38. --os.pullEvent = oldPull
  39. --os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement