Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.gray)
- 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"}
- term.clear()
- sleep(.3)
- term.setCursorPos(1,1)
- print("[/////////////////////////////////////////////////]")
- print("[/////////////8///88888/88888/////////////////////]")
- print("[///////////88888/8///8/8/////////////////////////]")
- print("[/////////////8///8///8/88888/////////////////////]")
- print("[////////8888/8///8///8/////8///8/8///88//////////]")
- print("[////////8//8/8///8///8/////8///8/8////8//////////]")
- print("[////////8888/8///88888/88888///8/8////8//////////]")
- print("[////////8///////////////////////8//o/888/////////]")
- print("[////////8////////////////////////////////////////]")
- print("[/////////////////////////////////////////////////]")
- for i=1,#progressbar do
- term.setCursorPos(20,12)
- print(progressbar[i])
- sleep(.5)
- end
- sleep(1)
- 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.clear()
- 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 == "password" then
- print("Loading your settings...")
- sleep(1.5)
- print("Logging in...")
- sleep(3.5)
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to ptOS!")
- 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 incorret password too many times.')
- sleep(5)
- os.shutdown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement