Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = term.getSize()
- local correctPass = "amita"
- os.loadAPI("term")
- term.setTextColor(colors.lime)
- os.pullEvent = os.pullEventRaw
- blit = function( txt, txtcol, backcol)
- term.setBackgroundColor(backcol)
- term.setTextColor(txtcol)
- term.write(txt)
- end
- function txt(i,o)
- shell.run("clear")
- textutils.slowPrint("WELCOME TO ROBCO INDUSTRIES (TM) TERMLINK",i)
- print(nil)
- term.write("> ")
- blink(2)
- textutils.slowWrite("SET TERMINAL/INQUIRE",o)
- blink(1)
- print(nil)
- print(nil)
- textutils.slowWrite("RIT-V300",o)
- blink(1)
- print(nil)
- print(nil)
- term.write("> ")
- blink(2)
- textutils.slowWrite("SET FILE/PROTECTION-OWNER:RWED ACCOUNTS.F",o)
- blink(1)
- print(nil)
- term.write("> ")
- blink(2)
- textutils.slowWrite("SET HALT RESTART/MAINT",o)
- blink(1)
- print(nil)
- blink(1,.2)
- print(nil)
- blink(2,.2)
- textutils.slowWrite("Initializing Robco Industries(TM) MF Boot Agent",i)
- blinkN(1,.1)
- textutils.slowWrite("RETROS BIOS",i)
- blinkN(1,.1)
- textutils.slowWrite("RBIOS-4.02.08.00 52EE5.E7.E8",i)
- blinkN(1,.1)
- textutils.slowWrite("Copyright 2201-2201 Robco Ind.",i)
- blinkN(1,.1)
- textutils.slowWrite("Uppermem: 64 KB",i)
- blinkN(1,.1)
- textutils.slowWrite("Root (5AB)",i)
- blinkN(1,.1)
- textutils.slowWrite("Maintenance Mode",i)
- blinkN(1,.1)
- print(nil)
- term.write("> ")
- blink(3)
- textutils.slowWrite("RUN DEBUG/ACCOUNTS.F",o)
- blink(1)
- sleep(.5)
- end
- function password()
- shell.run("clear")
- textutils.slowPrint("ROBCO INDUSTRIES (TM) TERMLINK PROTOCOL",i)
- textutils.slowPrint("ENTER PASSWORD NOW",i)
- local c,d = term.getCursorPos()
- textutils.slowWrite("4 ATTEMPT(S) LEFT: ")
- boxes("slow",4)
- for i=1,5 do
- for i=1,3 do
- term.setCursorPos(c,d+2+i)
- term.clearLine()
- end
- term.setCursorPos(c,d+2)
- term.clearLine()
- term.write("> ")
- term.setCursorBlink(false)
- local pass = read("*")
- if pass:lower() ~= correctPass and i == 5 then
- textutils.slowWrite(">Entry Denied",80)
- blinkN(1)
- textutils.slowWrite(">Lockout in progress")
- blinkN(1)
- scroll()
- while true do
- term.setCursorPos((x/2)-(7),(y/2)-1)
- term.write("TERMINAL LOCKED")
- term.setCursorPos((x/2)-(15),(y/2)+1)
- term.write("PLEASE CONTACT AN ADMINISTRATOR")
- sleep(1)
- end
- elseif pass:lower() ~= correctPass then
- textutils.slowWrite(">Entry Denied",80)
- blinkN(1)
- local mem = NumCorrect(pass)
- textutils.slowWrite(">"..mem.." correct",80)
- blinkN(1)
- else
- textutils.slowWrite(">Exact Match!",80)
- blinkN(1)
- textutils.slowPrint(">Please Wait",80)
- textutils.slowPrint(">while system",80)
- textutils.slowPrint(">is accessed",80)
- blinkN(1)
- scroll()
- break
- end
- term.setCursorPos(c,d)
- term.clearLine()
- term.write(tostring(4-i).." ATTEMPT(S) LEFT: ")
- boxes(nil,4-i)
- end
- end
- function scroll()
- local g,h = term.getCursorPos()
- for i=1,h+1 do
- term.scroll(1)
- sleep(.1)
- end
- end
- function next()
- blink(1)
- print(nil)
- end
- function NumCorrect(pass)
- local count = 0
- for i=1,#correctPass do
- if pass:sub(i,i) == correctPass:sub(i,i) then
- count = count + 1
- end
- end
- return tostring(count).."/"..tostring(#correctPass)
- end
- function boxes(a,f)
- if a == "slow" then
- for i=1,f do
- term.setBackgroundColor(colors.lime)
- textutils.slowWrite(" ")
- term.setBackgroundColor(colors.black)
- textutils.slowWrite(" ")
- end
- print(nil)
- elseif a == nil then
- for i=1,f do
- term.setBackgroundColor(colors.lime)
- term.write(" ")
- term.setBackgroundColor(colors.black)
- term.write(" ")
- end
- end
- end
- function blink(p,s)
- if not s then
- s = .4
- end
- local a,b = term.getCursorPos()
- for i = 1,p do
- sleep(s)
- term.setCursorPos(a,b)
- blit(" ",colors.lime,colors.lime)
- sleep(s)
- term.setCursorPos(a,b)
- blit(" ",colors.lime,colors.black)
- end
- term.setCursorPos(a,b)
- end
- function blinkN(p,s)
- if not s then
- s = .4
- end
- local a,b = term.getCursorPos()
- for i = 1,p do
- sleep(s)
- term.setCursorPos(a,b)
- blit(" ",colors.lime,colors.lime)
- sleep(s)
- term.setCursorPos(a,b)
- blit(" ",colors.lime,colors.black)
- end
- term.setCursorPos(1,b+1)
- end
- --local blink = coroutine.create(blink)
- txt(160,30)
- password()
- shell.run("clear")
- shell.run("shell")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement