View difference between Paste ID: 7EEeCvzy and Qe5iZ8T3
SHOW: | | - or go back to the newest paste.
1
local password = "bacon"
2
local opentime = 5
3
term.clear()
4
term.setCursorPos(1,1)
5
write("Password: ")
6
local input = read("*")
7
if input == password then
8
term.clear()
9
term.setCursorPos(1,1)
10
print("Password Correct")
11
rs.setoutput("left", true)
12
sleep(opentime)
13
rs.setouput("left", false)
14
os.reboot
15-
else 
15+
else -- Checks if the user didn't input the correct password
16
 term.clear()
17
 term.setCursorPos(1,1)
18-
print("Password Incorrect")
18+
 print("Password incorrect!") -- Prints 'Password incorrect!' to the screen
19-
sleep(2)
19+
 sleep(2) -- Waits 2 seconds
20
 os.reboot() -- Reboot the computer, reopening the lock
21
end