Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function s(...) return sleep(...) end
- function w(...) return write(...) end
- function p(...) return print(...) end
- function tw(...) return term.write(...) end
- function scp(...) return term.setCursorPos(...) end
- function sbc(...) return term.setBackgroundColor(...) end
- function stc(...) return term.setTextColor(...) end
- function tc(...) return term.clear(...) end
- function tcl(...) return term.clearLine() end
- function scb(...) return term.setCursorBlink(...) end
- function ts(...) return term.scroll(...) end
- function r(...) return shell.run(...) end
- function para(...) return parallel.waitForAny(...) end
- function sw(...) return textutils.slowWrite(...) end
- function sp(...) return textutils.slowPrint(...) end
- os.pullEvent = os.pullEventRaw
- -- Change Username Function
- function username()
- logincheck = fs.open("disk/users/1", "r")
- if logincheck then
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- end
- logincheck = fs.open("disk/users/2", "r")
- if logincheck then
- username2 = logincheck.readLine()
- userpass2 = logincheck.readLine()
- end
- if loggedinuser == (username1) then
- scp(2,8)
- w([[ ]])
- scp(2,8)
- newusername = read()
- writeusername = fs.open("disk/users/1", "w")
- writeusername.writeLine(newusername)
- writeusername.writeLine(therepassword)
- writeusername.close()
- sbc( colors.white )
- stc( colors.black )
- scp(2,5)
- term.clearLine()
- scp(2,8)
- term.clearLine()
- scp(2,10)
- term.clearLine()
- scp(15,8)
- print("These Changes Require A Reboot")
- scp(15,9)
- print("Reboot now?")
- scp(14,11)
- stc(1)
- sbc( colors.lime )
- print(" Yes ")
- scp(21,11)
- sbc( colors.red )
- stc(1)
- print(" No ")
- while true do
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 14 and X <= 19 and Y == 11 then
- sbc( colors.white )
- term.clear()
- sleep(2)
- os.reboot()
- elseif X >= 21 and X <= 25 and Y == 11 then
- shell.run('Services/Desktop')
- end
- end
- elseif loggedinuser == (username2) then
- scp(2,8)
- w([[ ]])
- scp(2,8)
- newusername = read()
- writeusername = fs.open("disk/users/2", "w")
- writeusername.writeLine(newusername)
- writeusername.writeLine(therepassword)
- writeusername.close()
- end
- end
- ----------------------------------------
- function password()
- logincheck = fs.open("disk/users/1", "r")
- if logincheck then
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- end
- logincheck = fs.open("disk/users/2", "r")
- if logincheck then
- username2 = logincheck.readLine()
- userpass2 = logincheck.readLine()
- end
- if loggedinuser == (username1) then
- scp(2,10)
- w([[ ]])
- scp(2,10)
- newpassword = read()
- writeusername = fs.open("disk/users/1", "w")
- writeusername.writeLine(username1)
- writeusername.writeLine(newpassword)
- writeusername.close()
- sbc( colors.white )
- stc( colors.black )
- scp(2,5)
- term.clearLine()
- scp(2,8)
- term.clearLine()
- scp(2,10)
- term.clearLine()
- scp(15,8)
- print("These Changes Require A Reboot")
- scp(15,9)
- print("Reboot now?")
- scp(14,11)
- stc(1)
- sbc( colors.lime )
- print(" Yes ")
- scp(21,11)
- sbc( colors.red )
- stc(1)
- print(" No ")
- while true do
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 14 and X <= 19 and Y == 11 then
- sbc( colors.white )
- term.clear()
- sleep(2)
- os.reboot()
- elseif X >= 21 and X <= 25 and Y == 11 then
- shell.run('Services/Desktop')
- end
- end
- elseif loggedinuser == (username2) then
- scp(2,10)
- w([[ ]])
- scp(2,10)
- newpassword = read()
- writeusername = fs.open("disk/users/2", "w")
- writeusername.writeLine(username2)
- writeusername.writeLine(newpassword)
- writeusername.close()
- end
- end
- -- Options Functions
- -- ## Profile ## --
- function profile()
- scp(50,1)
- sbc( colors.lightGray )
- stc( colors.orange )
- print("@")
- scp(2,5)
- sbc( colors.white )
- stc( colors.black )
- print("Username: ", loggedinuser)
- scp(2,6)
- sbc( colors.lightGray )
- stc(1)
- scp(2,8)
- print(" Change Username ")
- scp(2,10)
- print(" Change Password ")
- -- click events while the user is looking at option profile
- while true do
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 2 and X <= 19 and Y == 8 then
- username()
- elseif X >= 2 and X <= 19 and Y == 10 then
- password()
- elseif X >= 51 and X <= 51 and Y == 1 then
- shell.run('Services/Desktop')
- elseif X >= 50 and X <= 50 and Y == 1 then
- shell.run('Programs/Settings')
- end
- end
- end
- --#### CHANGE USER 1 BACKGROUND ####--
- --########System########--
- function System()
- scp(50,1)
- sbc( colors.lightGray )
- stc( colors.orange )
- print("@")
- stc( colors.white )
- scp(6,6)
- sbc( colors.blue )
- print(" ")
- scp(6,7)
- print(" ")
- scp(6,7)
- print(" OS: TaZerOS ", version)
- scp(6,8)
- print(" ")
- scp(6,10)
- print(" ")
- scp(6,11)
- print(" ")
- scp(6,11)
- print(" Checking For Update... ")
- scp(6,12)
- print(" ")
- sleep(4)
- if version == (OnlineVersion) then
- scp(6,11)
- print(" Your on the latest version ")
- else
- scp(6,11)
- print(" ")
- scp(6,11)
- print(" Update Available. ", OnlineVersion)
- sbc( colors.green )
- scp(6,14)
- print(" UPDATE ")
- updatebutton = "yes"
- while true do
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 6 and X <= 14 and Y == 14 and updatebutton == "yes" then
- shell.run('disk/updates/UpdaterProgram')
- elseif X >= 51 and X <= 51 and Y == 1 then
- shell.run('Services/Desktop')
- elseif X >= 50 and X <= 50 and Y == 1 then
- shell.run('Programs/Settings')
- end
- end
- end
- end
- --#####Background#######--
- function background()
- while true do
- scp(50,1)
- sbc( colors.lightGray )
- stc( colors.orange )
- print("@")
- stc(1)
- if username1 == (loggedinuser) then
- backgrounds = fs.open("disk/Users/.1data", "r")
- background = backgrounds.readLine()
- backgrounds.close()
- elseif username2 == (loggedinuser) then
- backgrounds = fs.open("disk/Users/.2data", "r")
- background = backgrounds.readLine()
- backgrounds.close()
- end
- if background == "Textures/backgrounds/computer" then
- scp(4,4)
- sbc( colors.blue )
- print(" Computer ")
- else
- scp(4,4)
- sbc( colors.lightGray )
- print(" Computer ")
- end
- if background == "Textures/backgrounds/code" then
- scp(16,4)
- sbc( colors.blue )
- print(" Code ")
- else
- scp(16,4)
- sbc( colors.lightGray )
- print(" Code ")
- end
- -- EVENTS
- -- MOUSE CLICK
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 4 and X <= 14 and Y == 4 and loggedinuser == (username1) then
- logincheck = fs.open("disk/users/1", "r")
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- logincheck = fs.open("disk/users/2", "r")
- username2 = logincheck.readLine()
- userpass2 = logincheck.readLine()
- backgrounds = fs.open("disk/Users/.1data", "w")
- backgrounds.writeLine("Textures/backgrounds/computer")
- backgrounds.close()
- elseif X >= 16 and X <= 21 and Y == 4 and loggedinuser == (username1) then
- logincheck = fs.open("disk/users/1", "r")
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- logincheck = fs.open("disk/users/2", "r")
- username2 = logincheck.readLine()
- userpass2 = logincheck.readLine()
- backgrounds = fs.open("disk/Users/.1data", "w")
- backgrounds.writeLine("Textures/backgrounds/code")
- backgrounds.close()
- --
- elseif X >= 4 and X <= 14 and Y == 4 and loggedinuser == (username2) then
- logincheck = fs.open("disk/users/1", "r")
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- logincheck = fs.open("disk/users/2", "r")
- username2 = logincheck.readLine()
- userpass2 = logincheck.readLine()
- backgrounds = fs.open("disk/Users/.2data", "w")
- backgrounds.writeLine("Textures/backgrounds/computer")
- backgrounds.close()
- elseif X >= 16 and X <= 21 and Y == 4 and loggedinuser == (username2) then
- logincheck = fs.open("disk/users/1", "r")
- username1 = logincheck.readLine()
- userpass1 = logincheck.readLine()
- logincheck = fs.open("disk/users/2", "r")
- username2 = logincheck.readLine()
- userpass2 = logincheck.readLine()
- backgrounds = fs.open("disk/Users/.2data", "w")
- backgrounds.writeLine("Textures/backgrounds/code")
- backgrounds.close()
- --
- elseif X >= 50 and X <= 50 and Y == 1 then
- shell.run('Programs/Settings')
- end
- end
- end
- --------------------------
- -- Background And Task Bar
- sbc(1)
- term.clear()
- scp(1,1)
- sbc( colors.lightGray )
- w([[ ]])
- scp(51,1)
- stc( colors.red )
- print("@")
- scp(1,1)
- stc(1)
- print("Settings")
- scp(21,1)
- stc( colors.white )
- sbc( colors.green )
- w([[ Panel ]])
- --Options---------------------------------------------
- sbc( colors.lightGray )
- scp(2,5)
- p([[ ]])
- scp(2,6)
- p([[ Profile ]])
- scp(2,7)
- p([[ ]])
- scp(15,5)
- p([[ ]])
- scp(15,6)
- p([[ Background ]])
- scp(15,7)
- p([[ ]])
- scp(29,5)
- p([[ ]])
- scp(29,6)
- p([[ System ]])
- scp(29,7)
- p([[ ]])
- while true do
- event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 2 and X <= 12 and Y >= 5 and Y <= 7 then
- sbc(1)
- term.clear()
- sbc(1)
- term.clear()
- scp(1,1)
- sbc( colors.lightGray )
- w([[ ]])
- scp(51,1)
- stc( colors.red )
- print("@")
- scp(1,1)
- stc(1)
- print("Settings")
- scp(21,1)
- stc( colors.white )
- sbc( colors.green )
- w([[ Panel ]])
- profile()
- elseif X >= 29 and X <= 41 and Y >= 5 and Y <= 7 then
- sbc(1)
- term.clear()
- sbc(1)
- term.clear()
- scp(1,1)
- sbc( colors.lightGray )
- w([[ ]])
- scp(51,1)
- stc( colors.red )
- print("@")
- scp(1,1)
- stc(1)
- print("Settings")
- scp(21,1)
- stc( colors.white )
- sbc( colors.green )
- w([[ Panel ]])
- System()
- elseif X >= 15 and X <= 27 and Y >= 5 and Y <= 7 then
- sbc(1)
- term.clear()
- sbc(1)
- term.clear()
- scp(1,1)
- sbc( colors.lightGray )
- w([[ ]])
- scp(51,1)
- stc( colors.red )
- print("@")
- scp(1,1)
- stc(1)
- print("Settings")
- scp(21,1)
- stc( colors.white )
- sbc( colors.green )
- w([[ Panel ]])
- background()
- elseif X >= 51 and X <= 51 and Y == 1 then
- shell.run('Services/Desktop')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement