Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function usersettings()
- term.setTextColor(1)
- term.setBackgroundColor(1)
- term.clear()
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(15, 1, 15, 19, colors.red)
- paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
- term.setCursorPos(2,3)
- term.write('User >')
- term.setCursorPos(2,5)
- term.write('System')
- term.setCursorPos(2,7)
- term.write('Desktop')
- term.setCursorPos(2,9)
- term.write('Info')
- term.setCursorPos(2,17)
- term.write('< desktop')
- end
- function systemsettings()
- term.setTextColor(1)
- term.setBackgroundColor(1)
- term.clear()
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(15, 1, 15, 19, colors.red)
- paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
- term.setCursorPos(2,3)
- term.write('User')
- term.setCursorPos(2,5)
- term.write('System >')
- term.setCursorPos(2,7)
- term.write('Desktop')
- term.setCursorPos(2,9)
- term.write('Info')
- term.setCursorPos(2,17)
- term.write('< desktop')
- end
- function desktopsettings()
- term.setTextColor(1)
- term.setBackgroundColor(1)
- term.clear()
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(15, 1, 15, 19, colors.red)
- paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
- term.setCursorPos(2,3)
- term.write('User')
- term.setCursorPos(2,5)
- term.write('System')
- term.setCursorPos(2,7)
- term.write('Desktop >')
- term.setCursorPos(2,9)
- term.write('Info')
- term.setCursorPos(2,17)
- term.write('< desktop')
- end
- function info()
- term.setTextColor(1)
- term.setBackgroundColor(1)
- term.clear()
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(15, 1, 15, 19, colors.red)
- paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
- term.setCursorPos(2,3)
- term.write('User')
- term.setCursorPos(2,5)
- term.write('System')
- term.setCursorPos(2,7)
- term.write('Desktop')
- term.setCursorPos(2,9)
- term.write('Info >')
- term.setCursorPos(2,17)
- term.write('< desktop')
- end
- function settings()
- term.setTextColor(1)
- term.setBackgroundColor(1)
- term.clear()
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(15, 1, 15, 19, colors.red)
- paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
- term.setCursorPos(2,3)
- term.write('User')
- term.setCursorPos(2,5)
- term.write('System')
- term.setCursorPos(2,7)
- term.write('Desktop')
- term.setCursorPos(2,9)
- term.write('Info')
- term.setCursorPos(2,17)
- term.write('< desktop')
- while true do
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- if xPos > 1 and xPos < 11 and yPos == 17 then
- DESKTOP()
- elseif xPos > 1 and xPos < 6 and yPos == 3 then
- usersettings()
- elseif xPos > 1 and xPos < 9 and yPos == 5 then
- systemsettings()
- elseif xPos > 1 and xPos < 10 and yPos == 7 then
- desktopsettings()
- elseif xPos > 1 and xPos < 6 and yPos == 9 then
- info()
- end
- end
- end
- function DESKTOP()
- while true do
- term.setTextColor(1)
- term.setBackgroundColor(1)
- term.clear()
- paintutils.drawPixel(1, 1, colors.red)
- paintutils.drawLine(5, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(2, 1, 4, 1, colors.gray)
- term.setCursorPos(2,1)
- term.write('EOS')
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- if xPos > 1 and xPos < 5 and yPos == 1 then
- settings()
- end
- end
- end
- function welcome()
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(25,10)
- term.write("ooo")
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- sleep(0.2)
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(25,10)
- term.write("0oo")
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- sleep(0.2)
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(25,10)
- term.write("o0o")
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- sleep(0.2)
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(25,10)
- term.write("oo0")
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- end
- function welcomeuser()
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(18,10)
- term.write('Welcome, '..logread..'!')
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- sleep(5)
- DESKTOP()
- end
- function startwelcome()
- welcome()
- sleep(0.2)
- welcome()
- sleep(0.2)
- welcome()
- sleep(0.2)
- welcome()
- sleep(0.2)
- welcomeuser()
- end
- function auth()
- logAPI.authlog("Waiting for auth...")
- while true do
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(19,3)
- term.write("Authorization")
- paintutils.drawLine(15, 9, 37, 9, colors.red)
- paintutils.drawLine(15, 5, 37, 5, colors.red)
- paintutils.drawLine(38, 5, 38, 9, colors.red)
- paintutils.drawLine(14, 5, 14, 9, colors.red)
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- paintutils.drawLine(16, 7, 36, 7, colors.red)
- term.setCursorPos(16,7)
- term.setTextColor(1)
- term.write("Login:")
- term.setCursorPos(23,7)
- l = "login"
- logread = read()
- logAPI.lauthlog(logread)
- if fs.exists('/.root/.programs/.login/.accounts/'..logread..'.db') then
- paintutils.drawPixel(25, 11, colors.green)
- paintutils.drawPixel(28, 11, colors.green)
- paintutils.drawPixel(25, 12, colors.green)
- paintutils.drawPixel(25, 13, colors.green)
- paintutils.drawPixel(26, 13, colors.green)
- paintutils.drawPixel(27, 12, colors.green)
- sleep(1)
- while true do
- term.setTextColor(16384)
- term.setBackgroundColor(1)
- term.clear()
- term.setCursorPos(19,3)
- term.write("Authorization")
- paintutils.drawLine(15, 9, 37, 9, colors.red)
- paintutils.drawLine(15, 5, 37, 5, colors.red)
- paintutils.drawLine(38, 5, 38, 9, colors.red)
- paintutils.drawLine(14, 5, 14, 9, colors.red)
- paintutils.drawLine(1, 1, 51, 1, colors.red)
- paintutils.drawLine(1, 1, 1, 19, colors.red)
- paintutils.drawLine(1, 19, 51, 19, colors.red)
- paintutils.drawLine(51, 19, 51, 1, colors.red)
- paintutils.drawLine(16, 7, 36, 7, colors.red)
- term.setCursorPos(16,7)
- term.setTextColor(1)
- term.write("Password: ")
- term.setCursorPos(26,7)
- pread = read()
- logAPI.pauthlog(pread)
- local fp = fs.open('/.root/.programs/.login/.accounts/'..logread..'.db', 'r')
- local fpl1 = fp.readLine(1)
- if pread == fpl1 then
- paintutils.drawPixel(25, 11, colors.green)
- paintutils.drawPixel(28, 11, colors.green)
- paintutils.drawPixel(25, 12, colors.green)
- paintutils.drawPixel(25, 13, colors.green)
- paintutils.drawPixel(26, 13, colors.green)
- paintutils.drawPixel(27, 12, colors.green)
- sleep(1)
- logAPI.reglog("Auth success.")
- startwelcome()
- end
- end
- end
- end
- end
- auth()
Advertisement
Add Comment
Please, Sign In to add comment