Advertisement
Guest User

startup.lua

a guest
Apr 8th, 2020
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. password = 'password'
  2.  
  3. firstDoor = colors.orange
  4. secondDoor = colors.red
  5.  
  6. side = 'back'
  7. errorMessage = 'Failed'
  8.  
  9. delay = 5
  10. currentlyOpen = 0;
  11.  
  12. while true do
  13.     term.clear()
  14.     term.setCursorPos(1,1)
  15.    
  16.     write('Password: ')
  17.     input = read('*')
  18.    
  19.     if input == password then
  20.         rs.setBundledOutput(side, firstDoor)
  21.         sleep(delay)
  22.         rs.setBundledOutput(side, 0)
  23.         sleep(delay / 2)
  24.         rs.setBundledOutput(side, secondDoor)
  25.         sleep(5)
  26.         rs.setBundledOutput(side, 0)
  27.     else
  28.         term.clear()
  29.         term.setCursorPos(1,1)
  30.        
  31.         print(errorMessage)
  32.         sleep(1)
  33.     end            
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement