Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- log("==> Loading profile menu")
- passwordwindow = window.create(term.current(),2,9,15,1)
- passwordwindow.setVisible(false)
- usernamewindow = window.create(term.current(),2,9,15,1)
- usernamewindow.setVisible(false)
- taskbar.setCursorPos(1,1)
- taskbar.write(" Settings - Profile")
- taskbar.setCursorPos(49,1)
- taskbar.setTextColor(colors.red)
- taskbar.write("#")
- taskbar.setCursorPos(48,1)
- taskbar.setTextColor(colors.orange)
- taskbar.write("#")
- taskbar.setTextColor(colors.white)
- pw = window.create(term.current(),1,2,51,18)
- pw.setBackgroundColor(colors.white)
- pw.clear()
- passwordwindow.setBackgroundColor(colors.lightGray)
- passwordwindow.clear()
- passwordwindow.write("New Password")
- usernamewindow.setBackgroundColor(colors.lightGray)
- usernamewindow.clear()
- usernamewindow.write("New Username")
- pw.setCursorPos(2,4)
- pw.setBackgroundColor(colors.red)
- pw.write(" ")
- pw.setCursorPos(2,5)
- pw.write(" Change Password ")
- pw.setCursorPos(2,6)
- pw.write(" ")
- pw.setCursorPos(20,4)
- pw.write(" ")
- pw.setCursorPos(20,5)
- pw.write(" Change Username ")
- pw.setCursorPos(20,6)
- pw.write(" ")
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 48 and y == 1 then
- skip = "yes"
- shell.run('OS/programs/settings/start.lua')
- elseif x == 49 and y == 1 then
- shell.run('OS/desktop.lua')
- elseif x >= 2 and x <= 18 and y >= 5 and y <= 7 then
- passwordwindow.setVisible(true)
- os.pullEvent("key")
- passwordwindow.setBackgroundColor(colors.lightGray)
- passwordwindow.clear()
- scp(2,9)
- term.setBackgroundColor(colors.lightGray)
- newpassword = read()
- checkCurrentUserId()
- logincheck = fs.open("OS/Users/"..userid.."/info.data", "r")
- if logincheck then
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- admin = logincheck.readLine()
- logincheck.close()
- end
- newlogincheck = fs.open("OS/Users/"..userid.."/info.data", "w")
- if newlogincheck then
- newlogincheck.writeLine(username1)
- newlogincheck.writeLine(newpassword)
- newlogincheck.writeLine(admin)
- newlogincheck.close()
- end
- elseif x >= 20 and x <= 36 and y >= 4 and y <= 7 then
- usernamewindow.setVisible(true)
- checkCurrentUserId()
- os.pullEvent("key")
- usernamewindow.setBackgroundColor(colors.lightGray)
- usernamewindow.clear()
- scp(2,9)
- term.setBackgroundColor(colors.lightGray)
- newusername = read()
- logincheck = fs.open("OS/Users/"..userid.."/info.data", "r")
- if logincheck then
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- admin = logincheck.readLine()
- logincheck.close()
- end
- newlogincheck = fs.open("OS/Users/"..userid.."/info.data", "w")
- if newlogincheck then
- newlogincheck.writeLine(newusername)
- newlogincheck.writeLine(userpass1)
- newlogincheck.writeLine(admin)
- newlogincheck.close()
- end
- end
- end
Add Comment
Please, Sign In to add comment