SHOW:
|
|
- or go back to the newest paste.
1 | os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut | |
2 | ||
3 | term.clear() -- Clears the screen | |
4 | term.setCursorPos(1, 1) -- The places the print position to the top of screen | |
5 | ||
6 | - | username = {"user1", "user2", "user3"} -- Here you need to define all usernames avaible |
6 | + | username = {"iTzChange", "user2", "user3"} -- Here you need to define all usernames avaible |
7 | - | password = {"pass1", "pass2", "pass3"} -- Here you define what password each user has, remember to put user1's password in the first row and so on. |
7 | + | password = {"test", "pass2", "pass3"} -- Here you define what password each user has, remember to put user1's password in the first row and so on. |
8 | ||
9 | write("Username: ") | |
10 | user = read() | |
11 | ||
12 | write("Password: ") | |
13 | pass = read('*') -- This prevents people from reading the password as you put it in | |
14 | ||
15 | for i=1, #username do -- Starts a loop | |
16 | if user == username[i] and pass == password[i] then | |
17 | access = true | |
18 | end | |
19 | end | |
20 | ||
21 | if access == true then | |
22 | print("Logging in...") | |
23 | sleep(1) | |
24 | print("Welcome "..user) | |
25 | else | |
26 | print("Incorrect username and password combination") | |
27 | sleep(2) | |
28 | os.reboot() | |
29 | end |