Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------
- -- Log in system v 1.0 --
- -- Made by tryy3 --
- -- All credits goes to him --
- --Please dont delete this comment--
- -----------------------------------
- os.pullEvent = os.pullEventRaw -- Makes it not possible to do ctrl + T!
- textutils.slowPrint("\nStarting login program") -- Random Texts
- sleep(1) -- makes the code sleep 1 sec
- textutils.slowPrint("Starting background programs") -- Random texts
- sleep(1) -- makes the code sleep 1 sec
- textutils.slowPrint("Preparing everything") -- Random Texts
- sleep(1) -- makes the code sleep 1 sec
- textutils.slowPrint("Loading...") -- Random Texts
- sleep(5) -- makes the code sleep 5 sec
- term.clear() -- clears the terminal
- --Credits, name and version of this program
- textutils.slowPrint("***********************")
- textutils.slowPrint("* Log in system v 1.0 *")
- textutils.slowPrint("* Made by tryy3 *")
- textutils.slowPrint("***********************\n")
- -- Function for the Username
- local function checkUsername(username)
- if username == "Username" then
- return true
- else
- return false
- end
- end
- -- Function for the Password
- local function checkPassword(password)
- if password == "Password" then
- return true
- else
- return false
- end
- end
- for i=1,3 do -- Makes it possible to give you 3 trys!
- textutils.slowPrint ("Enter your username!") -- Prints out to let you know that, now you can write the username!
- username = read() -- Makes it possible for the code to read what you type!
- if checkUsername(username) == false then -- Checks if you typed wrong username
- textutils.slowPrint("Incorrect username!\n") -- Prints out that you typed wrong username!
- elseif checkUsername(username) == true then -- Checks if your Username is correct!
- textutils.slowPrint ("Enter your password!") -- Prints out to let you know that, now you can write the password!
- password = read("*") -- Makes it possible for the code to read what you type!
- if checkPassword(password) == true then -- Checks if your password is correct!
- textutils.slowPrint ("Login correct!") -- Prints out that you typed the password correct!
- rs.setOutput("back", true) -- Sends a redstonje signal at the back of the terminal, and if the username is correct!
- sleep(3) -- Nakes the code sleep for 3 sec!
- rs.setOutput("back", false) -- Because its false, this code will just prevent the code for sending a redstone signal, if you typed the password wrong!
- else
- textutils.slowPrint ("Incorrect password!\n") -- Prints out that you typed wrong password!
- end
- end
- end
- print("Shutdown for 15s.") -- Tells you that the program shuts off your terminal
- os.sleep(15) -- Makes the code sleep for 15 sec
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement