Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tx, ty = term.getSize()
- reading = "false"
- name = ""
- pass = ""
- passHid = ""
- passHide = ""
- x = 0
- y = 0
- while true do
- if os.time() <= 7 then
- timeColour = colors.cyan
- timeColourb = colors.gray
- elseif os.time() >= 19 then
- timeColour = colors.cyan
- timeColourb = colors.gray
- else
- timeColour = colors.lightBlue
- timeColourb = colors.white
- end
- function draw()
- while true do
- sleep(0)
- if reading ~= "true" then
- ks.clear()
- ks.setBackgroundColor(timeColour)
- term.setTextColor(colors.blue)
- term.setBackgroundColor(timeColour)
- write("HydrOS ".._HYDROSVERNUM)
- paintutils.drawLine(1,2,tx,2,colors.black)
- paintutils.drawLine(6,2,6,ty,colors.black)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.black)
- basic.drawLine(1,2,tx,2)
- basic.drawLine(6,2,6,ty)
- term.setBackgroundColor(timeColour)
- term.setTextColor(colors.blue)
- basic.drawLine(2,math.floor(ty/2)-1,2,math.floor(ty/2)+1)
- basic.drawPixel(3,math.floor(ty/2))
- basic.drawLine(4,math.floor(ty/2)-1,4,math.floor(ty/2)+1)
- paintutils.drawLine(2,math.floor(ty/2)-1,2,math.floor(ty/2)+1,colors.blue)
- paintutils.drawPixel(3,math.floor(ty/2),colors.blue)
- paintutils.drawLine(4,math.floor(ty/2)-1,4,math.floor(ty/2)+1,colors.blue)
- paintutils.drawBox(8,4,tx-1,6,colors.blue)
- basic.drawBox(8,4,tx-1,6)
- paintutils.drawLine(9,5,tx-2,5,timeColourb)
- term.setBackgroundColor(timeColourb)
- term.setCursorPos(9,5)
- write(name)
- term.setBackgroundColor(timeColour)
- term.setCursorPos(8,3)
- print("Username")
- paintutils.drawBox(8,8,tx-1,10,colors.blue)
- basic.drawBox(8,8,tx-1,10)
- paintutils.drawLine(9,9,tx-2,9,timeColourb)
- term.setCursorPos(9,9)
- term.setBackgroundColor(timeColourb)
- write(passHid)
- term.setCursorPos(8,7)
- term.setBackgroundColor(timeColour)
- print("Password")
- term.setCursorPos(tx,1)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- write("X")
- term.setCursorPos(tx-1,1)
- term.setBackgroundColor(colors.orange)
- write("O")
- paintutils.drawFilledBox(8,15,10,17,colors.lime)
- term.setTextColor(colors.lime)
- basic.drawFilledBox(8,15,10,17)
- term.setCursorPos(9,16)
- term.setTextColor(colors.white)
- write(">")
- term.setCursorPos(tx-10,ty)
- term.setBackgroundColor(timeColour)
- term.setTextColor(colors.blue)
- write("X:"..x.."Y:"..y)
- term.setBackgroundColour(timeColour)
- term.setTextColour(colors.blue)
- term.setCursorPos(tx/2,ty/2)
- end
- end
- end
- sleep(0)
- function time()
- while true do
- sleep(0)
- local time = textutils.formatTime(os.time(),true)
- local len = string.len(time)
- if reading ~= "true" then
- term.setTextColour(colors.blue)
- ks.center(time,1)
- end
- end
- end
- function updater()
- while true do
- if reading ~= "true" then
- sleep(0)
- break
- end
- sleep(0)
- end
- end
- function getInput()
- reading = "true"
- if x <= tx-1 and x >= 8 and y <= 6 and y >= 4 then
- term.setBackgroundColour(timeColourb)
- term.setCursorPos(9,5)
- name = read()
- return
- elseif x <= tx-1 and x >= 8 and y >= 8 and y <= 10 then
- term.setBackgroundColour(timeColourb)
- term.setCursorPos(9,9)
- pass = read("*")
- for i =1,string.len(pass) do
- passHide = passHide.."*"
- end
- passHid = passHide
- return
- end
- end
- function click()
- local event, button, x2, y2 = os.pullEvent("mouse_click")
- if x2 >= tx-1 and x2 <= 8 and y2 >= 6 and y2 <= 4 then
- os.queueEvent("key",28)
- elseif x2 >= tx-1 and x2 <= 8 and y2 >= 8 and y2 <= 10 then
- os.queueEvent("key",28)
- elseif x2 <= tx-1 and x2 >=8 and y2 <= 6 and y2 >= 4 then
- x = x2
- y = y2
- parallel.waitForAny(getInput,click)
- return
- else
- x = x2
- y = y2
- parallel.waitForAny(getInput,click)
- return
- end
- end
- function wait()
- event, button, x, y = os.pullEvent("mouse_click")
- if button == 1 then
- if x <= tx-1 and x >= 8 and y <= 6 and y >= 4 then
- parallel.waitForAny(getInput,click)
- reading = "false"
- elseif x <= tx-1 and x >=8 and y <= 10 and y >= 8 then
- parallel.waitForAny(getInput,click)
- reading = "false"
- elseif x == tx and y == 1 then
- os.shutdown()
- elseif x == tx-1 and y == 1 then
- os.reboot()
- elseif x < 11 and x > 7 and y > 14 and y < 18 then
- local User = fs.open("HydrOS/user/name","r")
- local Pass = fs.open("HydrOS/user/pass","r")
- local CUser = User.readLine()
- local CPass = Pass.readLine()
- if CUser == User and CPass == Pass then
- os.shutdown()
- shell.run("HydrOS/user/desktop")
- end
- end
- end
- end
- parallel.waitForAny(wait,draw,time,updater)
- end
- ks.clear()
- ks.setBackgroundColor(colors.white)
- sleep(0.5)
- ks.setBackgroundColor(colors.lightBlue)
- sleep(0.5)
- ks.setBackgroundColor(colors.cyan)
- sleep(0.5)
- ks.setBackgroundColor(colors.blue)
- sleep(0.5)
- ks.setBackgroundColor(colors.gray)
- sleep(0.5)
- os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement