Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- local function pause(key)
- print('Press X to continue.')
- while true do
- local sEvent, sParam=os.pullEvent('char')
- if string.lower(sParam)==key then
- break
- end
- end
- end
- local progressbar = {"----------","o---------","oo--------","ooo-------","oooo------","ooooo-----","oooooo----","ooooooo---","oooooooo--","ooooooooo-","oooooooooo"} -- added the possible strings into a table
- term.clear()
- sleep(0.3)
- term.setCursorPos(15,2)
- print("RandomZOS is starting...")
- for i=1,#progressbar do
- term.setCursorPos(20,4)
- print(progressbar[i])
- sleep(0.5)
- end
- sleep(1.0)
- term.clear()
- term.setCursorPos(21,2)
- print("Welcome!")
- sleep(2.5)
- local intcount=0
- term.clear()
- term.setCursorPos(1,1)
- print("Login")
- while true do
- write("Username: ")
- userNameInput = read()
- if string.lower(userNameInput) == "admin" then
- sleep(1)
- break
- else
- sleep(1)
- print("Username not found.")
- intcount=intcount+1
- sleep(1)
- for i=3,2,-1 do
- term.setCursorPos(1,i)
- term.clearLine()
- end
- end
- if intcount==3 then
- print('You have entered an invalid username too many times.')
- sleep(5)
- os.shutdown()
- end
- end
- local intcount=0
- while true do
- write("Password: ")
- passwordInput = read("*")
- print("Verifying login...")
- sleep(2.5)
- if passwordInput == "admin" then
- print("Loading your settings...")
- sleep(1.5)
- print("Logging in...")
- sleep(3.5)
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to RandomZOS!")
- pause('x')
- term.setCursorPos(1,2)
- term.clearLine()
- break
- else
- print("The password you have entered is incorrect.")
- intcount=intcount+1
- sleep(1)
- for i=6,3,-1 do
- term.setCursorPos(1,i)
- term.clearLine()
- end
- end
- if intcount==3 then
- print('You have entered an incorrect password too many times.')
- sleep(5)
- os.shutdown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement