Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- box(1,1,51,19,Filled,purple)
- term.setCursorPos(1,4)
- term.setTextColor(black)
- print("HydroTech 0.2 Alpha")
- box(1,1,51,3,Filled,blue)
- term.setBackgroundColor(purple)
- term.setTextColor(black)
- local function User()
- box(5,8,46,10,Empty,blue)
- line(6,9,45,9,white)
- term.setBackgroundColor(purple)
- interact.centertext("Create Username",7)
- term.setCursorPos(6,9)
- term.setBackgroundColor(white)
- local User = read()
- term.clearLine()
- line(1,9,51,9,purple)
- line(5,9,46,9,blue)
- line(6,9,45,9,white)
- line(1,10,51,10,purple)
- line(5,10,46,10,blue)
- term.setBackgroundColor(purple)
- interact.centertext("Create Password",7)
- term.setBackgroundColor(white)
- term.setCursorPos(6,9)
- local Pass = read()
- box(1,5,51,19,Filled,purple)
- term.setBackgroundColor(purple)
- interact.centertext("Generating User",9)
- local file = fs.open(".User","w")
- file.write(User)
- file.close()
- local file = fs.open(".Pass","w")
- file.write(Pass)
- file.close()
- box(1,5,51,19,Filled,purple)
- interact.centertext("Generated",9)
- interact.centertext("User!",10)
- sleep(1)
- os.reboot()
- end
- if not fs.exists(".User") then
- if fs.exists(".Pass") then
- fs.delete(".Pass")
- User()
- else
- User()
- end
- elseif not fs.exists(".Pass") then
- if fs.exists(".User") then
- fs.delete(".User")
- User()
- else
- User()
- end
- else
- line(20,4,20,19,white)
- box(4,6,6,13,Filled,blue)
- box(7,9,8,10,Filled,blue)
- box(9,6,11,13,Filled,blue)
- box(22,6,40,8,Empty,blue)
- line(23,7,39,7,white)
- box(22,10,40,12,Empty,blue)
- line(23,11,39,11,white)
- term.setCursorPos(22,5)
- term.setTextColor(black)
- term.setBackgroundColor(purple)
- print("Enter Username")
- term.setCursorPos(22,9)
- print("Enter Password")
- box(22,14,40,18,Filled,lime)
- term.setCursorPos(28,16)
- print("Confirm")
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- term.setCursorPos(1,18)
- print("button "..button.." was pressed at X:"..x.." Y:"..y)
- if button == 1 then
- local Pass = 0
- local User = 0
- if y > 13 then
- if y < 19 then
- if x > 21 then
- if x < 41 then
- print("ding")
- local Pfile = fs.open(".User","r")
- local Ufile = fs.open(".Pass","r")
- local RPass = Pfile.readLine()
- local RUser = Ufile.readLine()
- local CPass = tostring(RPass)
- local CUser = tostring(RUser)
- if not Pass == CPass then
- if not User == CUser then
- term.setCursorPos(22,5)
- term.setTextColor(red)
- term.setBackgroundColor(purple)
- print("Invalid Username")
- term.setCursorPos(22,9)
- print("Incorrect Password")
- term.setTextColor(black)
- else
- term.setCursorPos(22,9)
- term.setBackgroundColor(purple)
- term.setTextColor(red)
- print("Incorrect Password")
- term.setTextColor(black)
- end
- elseif Pass == CPass then
- if not User == CUser then
- term.setCursorPos(22,9)
- term.setBackgroundColor(purple)
- term.setTextColor(red)
- print("Invalid Username")
- term.setTextColor(black)
- else
- shell.run(".desktop")
- end
- end
- Pfile.close()
- Ufile.close()
- end
- end
- end
- elseif y == 7 then
- if x < 40 then
- if x > 22 then
- term.setCursorPos(23,7)
- term.setBackgroundColor(white)
- local User = read()
- end
- end
- elseif y == 11 then
- if x > 22 then
- if x < 40 then
- term.setBackgroundColor(white)
- term.setCursorPos(23,11)
- local Pass = read("*")
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement