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 = {"1%","2%","3%","4%","5%","6%","7%","8%","9%","10%","11%","12%","13%","14%","15%","16%","17%","18%","19%","20%","21%","22%","23%","24%","25%","26%","27%","28%","29%","30%","31%","32%","33%","34%","35%","36%","37%","38%","39%","40%","41%","42%","43%","44%","45%","46%","47%","48%","49%","50%","51%","52%","53%","54%","55%","56%","57%","58%","59%","60%","61%","62%","63%","64%","65%","66%","67%","68%","69%","70%","71%","72%","72%","73%","74%","75%","76%","77%","78%","79%","80%","81%","82%","82%","83%","84%","85%","86%","87%","88%","89%","90%","91%","92%","92%","93%","94%","95%","96%","97%","98%","99%","100%",}
- term.clear()
- sleep(0.3)
- term.setCursorPos(15,2)
- print("CraftOS is starting...")
- for i=1,#progressbar do
- term.setCursorPos(24,4)
- print(progressbar[i])
- sleep(0.01)
- 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(0.5)
- 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(0.5)
- if passwordInput == "banana" then
- print("Loading your settings...")
- sleep(0.5)
- print("Logging in...")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to CraftOS!")
- 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