Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tab = 0
- term.setTextColor(colors.black)
- user = ""
- pass = ""
- if term.isColor() then
- paintutils.drawFilledBox(1,1,51,3,colors.orange)
- paintutils.drawFilledBox(1,4,51,19,colors.white)
- paintutils.drawImage(paintutils.loadImage("FireOS/32/Pictures/logoSmall.pu"),1,4)
- paintutils.drawLine(1,3,51,3,colors.black)
- paintutils.drawBox(9,4,11,19,colors.black)
- paintutils.drawLine(10,3,10,19,colors.orange)
- paintutils.drawBox(13,7,50,9,colors.black)
- paintutils.drawBox(13,12,50,14,colors.black)
- else
- paintutils.drawFilledBox(1,1,51,3,colors.lightGray)
- paintutils.drawFilledBox(1,4,51,19,colors.white)
- basic.drawImage(basic.loadImage("FireOS/32/Pictures/logoSmall.pu"),1,4)
- paintutils.drawLine(1,3,51,3,colors.black)
- paintutils.drawBox(9,4,11,19,colors.black)
- paintutils.drawLine(10,3,10,19,colors.lightGray)
- paintutils.drawBox(13,7,50,9,colors.black)
- paintutils.drawBox(13,12,50,14,colors.black)
- end
- term.setBackgroundColor(colors.white)
- term.setCursorPos(13,6)
- write("Enter Username")
- term.setCursorPos(13,11)
- write("Enter Password")
- local file = fs.open("FireOS/32/User","r")
- local userC = file.readLine()
- local passC = file.readLine()
- local passKey = "\7"
- if userC == "Momboggins" then
- passKey = "\3"
- end
- local function a()
- while true do
- local event, button, x, y = os.pullEvent()
- if event == "key" then
- if button == keys.tab then
- os.queueEvent("key",keys.enter)
- if tab == 2 then
- tab = 1
- else
- tab = 2
- end
- elseif button == keys.enter and tab == 0 then
- tab = 1
- elseif button == keys.enter and pass ~= "" and user ~= "" then
- if user == userC and pass == passC then
- if term.isColor() then
- term.setBackgroundColor(colors.orange)
- end
- term.clear()
- sleep(0)
- ks.center("Welcome...",true)
- shell.run("FireOS/32/Desk")
- break
- else
- if term.isColor() then
- term.setBackgroundColor(colors.orange)
- end
- term.clear()
- ks.center("Your username or password was incorrect!",true)
- sleep(0.6)
- os.reboot()
- end
- end
- end
- end
- end
- local function c(str)
- for i = 1,#str do
- os.queueEvent("char",string.sub(str,i,i))
- end
- end
- local function b()
- while true do
- if tab == 1 then
- term.setCursorPos(14,8)
- if tabChar ~= 1 then
- parallel.waitForAll(function()
- user = read()
- tab = 2
- end,
- function()
- sleep(0.1)
- c(user)
- end)
- tabChar = 1
- else
- user = read()
- end
- elseif tab == 2 then
- term.setCursorPos(14,13)
- if tabChar ~= 2 then
- parallel.waitForAll(function()
- pass = read(passKey)
- tab = 3
- tabChar = 2
- end, function()
- sleep(0.1)
- c(pass)
- end)
- else
- pass = read(passKey)
- end
- end
- sleep(0)
- end
- end
- while true do
- sleep(0)
- parallel.waitForAny(a,b)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- print("Something went wrong!!")
- break
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement