Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- AquaOS v1.51 - by AutoLocK and SSS
- Copyright 2013
- This is the Main Screen!
- REQUIREMENTS:
- - HTTP API needs to be enabled
- - Computer Width = 51
- - Computer Height = 19
- --]]
- themeWater = { 2048,8,512,1 }
- themeFire = { 16384,16,2,32768 }
- themeCarbon = { 32768,32,1,32 }
- themeGreyScale = { 32768,1,256,1 }
- os.loadAPI("/AquaOS/Resources/APIs/QuickTils")
- os.loadAPI("/AquaOS/Resources/APIs/Settings")
- slc = 0
- contextX = 0
- contextY = 0
- version = "1.51"
- filePath = "/AquaOS/.Boot/Main"
- cFilePath = "/AquaOS/Resources/.control"
- bootPath = "/AquaOS/.Boot/"
- configPath = "/AquaOS/.cfg"
- lLayout = ".loginLayout"
- sAliasBoot = {
- "originalPos = '/AquaOS/Resources/.aosBoot/startup'",
- "newPos = '/startup'",
- "function mvFiles()",
- " fs.delete('/startup')",
- " fs.move(originalPos,newPos)",
- " os.reboot()",
- "end",
- "mvFiles()"
- }
- sBootContents = {
- "term.clear()",
- "term.setCursorPos(1,1)",
- "term.setTextColor(colors.yellow)",
- "print('CraftOS - launched by AquaOS')",
- "term.setTextColor(colors.lightGray)",
- "print('Type AOSReturn to return to AquaOS!')",
- "shell.setAlias('AOSReturn','/AquaOS/Resources/.aosBoot/aliasFunc')"
- }
- if not fs.exists(configPath) then
- firstRun = true
- else
- firstRun = false
- end
- mainTitleText1 = "AquaOS"
- mainTitleText2 = "Launcher"
- mainBodyText1 = "version "..version..": "
- mainBodyText2 = "Just a bugbuster update.."
- mainBodyText3 = "- Quick code-run-through "
- mainBodyText4 = "- Quick bug-fixing "
- mainBodyText5 = "- Minor code changes "
- mainBodyText6 = "OS assisted by QuickTils "
- mainBodyText7 = "Made by AutoLocK and SSS "
- if firstRun == false then
- configFile = Settings.openSettingsFile(configPath)
- bGPic = configFile.getSectionedValue("Appearance","bGPic")
- iCon1Text = configFile.getSectionedValue("Appearance","iCon1Text")
- iCon1Pic = configFile.getSectionedValue("Appearance","iCon1Pic")
- iCon1Link= configFile.getSectionedValue("Appearance","iCon1Link")
- iCon2Text = configFile.getSectionedValue("Appearance","iCon2Text")
- iCon2Pic = configFile.getSectionedValue("Appearance","iCon2Pic")
- iCon2Link = configFile.getSectionedValue("Appearance","iCon2Link")
- tBarCol = configFile.getSectionedValue("Appearance","tBarCol")
- tBarTextCol = configFile.getSectionedValue("Appearance","tBarTextCol")
- backColor = configFile.getSectionedValue("Appearance","backColor")
- textColor = configFile.getSectionedValue("Appearance","textColor")
- adminUser = configFile.getSectionedValue("Accounts","adminUser")
- adminPass = configFile.getSectionedValue("Accounts","adminPass")
- basicUser1 = configFile.getSectionedValue("Accounts","basicUser1")
- basicPass1 = configFile.getSectionedValue("Accounts","basicPass1")
- basicUser2 = configFile.getSectionedValue("Accounts","basicUser2")
- basicPass2 = configFile.getSectionedValue("Accounts","basicPass2")
- basicUser3 = configFile.getSectionedValue("Accounts","basicUser3")
- basicPass3 = configFile.getSectionedValue("Accounts","basicPass3")
- loginPass = configFile.getSectionedValue("Other","loginPass")
- showIcons = configFile.getSectionedValue("Other","showIcons")
- currentTheme = configFile.getSectionedValue("Other","currentTheme")
- currentUser = configFile.getSectionedValue("Other","currentUser")
- tBarCol = tonumber(tBarCol)
- tBarTextCol = tonumber(tBarTextCol)
- backColor = tonumber(backColor)
- textColor = tonumber(textColor)
- loginPass = tonumber(loginPass)
- elseif firstRun == true then
- local file = fs.open(configPath,"w")
- file.writeLine("[Appearance]".."\n")
- file.writeLine("\n")
- file.writeLine("[Accounts]".."\n")
- file.writeLine("\n")
- file.writeLine("[Other]".."\n")
- file.writeLine("\n")
- file.close()
- configFile = Settings.openSettingsFile(configPath)
- configFile.setSectionedValue("Appearance","bGPic",".mainBG")
- configFile.setSectionedValue("Appearance","iCon1Text","LuaIDE")
- configFile.setSectionedValue("Appearance","iCon1Pic",".icon")
- configFile.setSectionedValue("Appearance","iCon1Link","LuaIDE")
- configFile.setSectionedValue("Appearance","iCon2Text","File Browser")
- configFile.setSectionedValue("Appearance","iCon2Pic",".iconFM")
- configFile.setSectionedValue("Appearance","iCon2Link","FileManager")
- configFile.setSectionedValue("Appearance","tBarCol","32768")
- configFile.setSectionedValue("Appearance","tBarTextCol","32")
- configFile.setSectionedValue("Appearance","backColor","1")
- configFile.setSectionedValue("Appearance","textColor","32")
- configFile.setSectionedValue("Accounts","adminUser","MUser")
- configFile.setSectionedValue("Accounts","adminPass","MPass")
- configFile.setSectionedValue("Accounts","basicUser1","User1")
- configFile.setSectionedValue("Accounts","basicPass1","password")
- configFile.setSectionedValue("Accounts","basicUser2","User2")
- configFile.setSectionedValue("Accounts","basicPass2","password")
- configFile.setSectionedValue("Accounts","basicUser3","User3")
- configFile.setSectionedValue("Accounts","basicPass3","password")
- configFile.setSectionedValue("Other","loginPass","0")
- configFile.setSectionedValue("Other","showIcons","true")
- configFile.setSectionedValue("Other","currentTheme","Carbon")
- configFile.setSectionedValue("Other","currentUser","admin")
- configFile.save(configPath)
- end
- -- The Title Bar
- function titleBar()
- QuickTils.cursor(1,1)
- QuickTils.bColor(tBarCol)
- QuickTils.color(tBarTextCol)
- term.clearLine()
- QuickTils.cursor(3,1)
- print("[LOGOUT]")
- QuickTils.cursor(19,1)
- print("[APPLICATIONS]")
- QuickTils.cursor(41,1)
- print("[OPTIONS]")
- end
- function lTitleBar()
- QuickTils.cursor(1,1)
- QuickTils.bColor(tBarCol)
- QuickTils.color(tBarTextCol)
- term.clearLine()
- QuickTils.cursor(3,1)
- print("[OPTIONS]")
- QuickTils.cursor(41,1)
- print("AOSLauncher")
- end
- function fTitleBar()
- QuickTils.cursor(1,1)
- QuickTils.bColor(colors.lightBlue)
- QuickTils.color(colors.white)
- term.clearLine()
- QuickTils.cursor(3,1)
- print("AOS FirstRun")
- QuickTils.cursor(41,1)
- print("AOSLauncher")
- end
- -- Returns to CraftOS
- function aosExit()
- QuickTils.bColor(colors.black)
- QuickTils.clean(1,1)
- if not fs.exists("/AquaOS/Resources/.aosBoot") then
- fs.makeDir("/AquaOS/Resources/.aosBoot")
- local file = fs.open("/AquaOS/Resources/.aosBoot/aliasFunc","w")
- for i=1,#sAliasBoot do
- file.writeLine(sAliasBoot[i])
- end
- file.close()
- end
- fs.move("/startup","/AquaOS/Resources/.aosBoot/startup")
- local file = fs.open("/startup","w")
- for i=1,#sBootContents do
- file.writeLine(sBootContents[i])
- end
- file.close()
- os.reboot()
- end
- -- The Desktop Layout
- function drawDesktop()
- QuickTils.bColor(backColor)
- term.clear()
- bground = paintutils.loadImage("/AquaOS/Resources/.backgrounds/"..bGPic)
- paintutils.drawImage(bground,-1,2)
- if showIcons == "true" then
- fileIcon1 = paintutils.loadImage("/AquaOS/Resources/.icons/"..iCon1Pic)
- paintutils.drawImage(fileIcon1,3,3)
- fileIcon2 = paintutils.loadImage("/AquaOS/Resources/.icons/"..iCon2Pic)
- paintutils.drawImage(fileIcon2,40,3)
- QuickTils.bColor(backColor)
- QuickTils.cursor(2,7)
- QuickTils.color(colors.red)
- print("+")
- QuickTils.bColor(backColor)
- QuickTils.cursor(39,7)
- print("+")
- QuickTils.color(textColor)
- QuickTils.cursor(3,8)
- print(iCon1Text)
- QuickTils.cursor(40,8)
- print(iCon2Text)
- end
- titleBar()
- end
- function lDrawDesktop()
- QuickTils.bColor(backColor)
- QuickTils.color(colors.black)
- term.clear()
- bGround = paintutils.loadImage("/AquaOS/Resources/.backgrounds/"..lLayout)
- paintutils.drawImage(bGround,1,1)
- QuickTils.bColor(backColor)
- QuickTils.cursor(35,5)
- QuickTils.color(colors.blue)
- print(mainTitleText1.." "..version)
- QuickTils.cursor(36,6)
- QuickTils.color(colors.black)
- print(mainTitleText2)
- QuickTils.cursor(5,5)
- QuickTils.color(colors.blue)
- print(mainTitleText1)
- QuickTils.cursor(5,6)
- QuickTils.color(colors.black)
- print(mainBodyText1)
- QuickTils.cursor(5,8)
- QuickTils.color(128)
- print(mainBodyText2)
- QuickTils.cursor(5,9)
- print(mainBodyText3)
- QuickTils.cursor(5,10)
- print(mainBodyText4)
- QuickTils.cursor(5,11)
- print(mainBodyText5)
- QuickTils.cursor(5,15)
- QuickTils.color(colors.black)
- print(mainBodyText6)
- QuickTils.cursor(5,16)
- QuickTils.color(256)
- print(mainBodyText7)
- QuickTils.cursor(35,10)
- QuickTils.color(colors.orange)
- print("|")
- QuickTils.cursor(37,10)
- QuickTils.color(colors.black)
- print("User Login")
- QuickTils.cursor(48,10)
- QuickTils.color(colors.orange)
- print("|")
- QuickTils.cursor(35,9)
- print("--------------")
- QuickTils.cursor(35,11)
- print("--------------")
- QuickTils.cursor(34,13)
- QuickTils.color(colors.black)
- print("Username")
- QuickTils.cursor(34,16)
- print("Password")
- QuickTils.cursor(34,14)
- QuickTils.bColor(colors.gray)
- print(" ")
- QuickTils.cursor(34,17)
- QuickTils.bColor(colors.gray)
- print(" ")
- lTitleBar()
- end
- -- Menu 1
- function drawMenu1()
- QuickTils.color(textColor)
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(1,2)
- print(" ")
- QuickTils.cursor(1,3)
- print(" Shutdown ")
- QuickTils.cursor(1,4)
- print(" Restart ")
- QuickTils.cursor(1,5)
- print(" CraftOS ")
- QuickTils.cursor(1,6)
- print(" ")
- end
- function lDrawMenu1()
- QuickTils.color(textColor)
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(1,2)
- print(" ")
- QuickTils.cursor(1,3)
- print(" Shutdown ")
- QuickTils.cursor(1,4)
- print(" Restart ")
- QuickTils.cursor(1,5)
- print(" ")
- end
- -- Menu 2
- function drawMenu2()
- QuickTils.bColor(tBarCol)
- QuickTils.color(textColor)
- QuickTils.cursor(contextX,contextY)
- print(" ")
- QuickTils.cursor(contextX,contextY+1)
- print(" edit AquaOS ")
- QuickTils.cursor(contextX,contextY+2)
- print(" Preferences ")
- QuickTils.cursor(contextX,contextY+3)
- print(" ")
- end
- -- Menu 3
- function drawMenu3(iX,iY)
- QuickTils.bColor(tBarCol)
- QuickTils.color(textColor)
- QuickTils.cursor(iX,iY)
- print(" ")
- QuickTils.cursor(iX,iY+1)
- print(" Rename ")
- QuickTils.cursor(iX,iY+2)
- print(" Re-Paint ")
- QuickTils.cursor(iX,iY+3)
- print(" Re-Link ")
- QuickTils.cursor(iX,iY+4)
- print(" ")
- end
- -- Menu 4
- function drawMenu4()
- QuickTils.bColor(tBarCol)
- QuickTils.color(textColor)
- QuickTils.cursor(40,2)
- print(" ")
- QuickTils.cursor(40,3)
- print(" About ")
- QuickTils.cursor(40,4)
- print(" Ctrl Panel ")
- QuickTils.cursor(40,5)
- print(" ")
- end
- -- Menu 5
- function drawMenu5()
- QuickTils.bColor(tBarCol)
- QuickTils.color(textColor)
- QuickTils.cursor(19,2)
- print(" ")
- QuickTils.cursor(19,3)
- print(" LuaIDE ")
- QuickTils.cursor(19,4)
- print(" NPaintPro ")
- QuickTils.cursor(19,5)
- print(" FileBrowser ")
- QuickTils.cursor(19,6)
- print(" ")
- end
- -- Main Desktop
- function mainDesktop()
- drawDesktop()
- while true do
- local event,button,X,Y = os.pullEventRaw()
- if slc == 0 then
- if event == "mouse_click" then
- if X>=3 and X<=13 and Y==1 and button==1 then
- drawMenu1()
- slc = 1
- elseif X>=41 and X<=49 and Y==1 and button==1 then
- drawMenu4()
- slc = 6
- elseif X>=19 and X<=32 and Y==1 and button==1 then
- drawMenu5()
- slc = 7
- elseif X>=3 and X<=6 and button==1 and Y>=3 and Y<=5 then
- shell.run("/AquaOS/Resources/Apps/"..iCon1Link)
- return
- shell.run(filePath)
- elseif X>=40 and X<=44 and button==1 and Y>=3 and Y<=5 then
- shell.run("/AquaOS/Resources/Apps/"..iCon2Link)
- return
- shell.run(filePath)
- elseif X >=1 and Y >=2 and button==2 then slc = 2
- if X >=38 then
- contextX = 38
- end
- if Y >=14 then
- contextX = 14
- end
- if X <=38 then
- contextX = X
- end
- if Y <=14 then
- contextY = Y
- end
- drawMenu2()
- elseif X==2 and Y==7 and button==1 then slc = 3
- drawMenu3(2,7)
- elseif X==39 and Y==7 and button==1 then slc = 4
- drawMenu3(39,7)
- end
- end
- elseif slc == 1 then
- if X>=2 and X<=9 and button==1 and Y==3 then slc=0
- configFile.setSectionedValue("Other","loginPass","0")
- configFile.save(configPath)
- os.shutdown()
- elseif X>=2 and X<=9 and button==1 and Y==4 then slc=0
- configFile.setSectionedValue("Other","loginPass","0")
- configFile.save(configPath)
- os.reboot()
- elseif X>=2 and X<=9 and button==1 and Y==5 then slc=0
- configFile.setSectionedValue("Other","loginPass","0")
- configFile.save(configPath)
- aosExit()
- break
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 2 then
- if X >= contextX and X <= contextX+13 and Y ==contextY+1 and button==1 then slc = 0
- if admin == true then
- shell.run("edit",filePath)
- return
- shell.run(filePath)
- end
- elseif X >= contextX and X <= contextX+13 and Y==contextY+2 and button == 1 then slc = 0
- if admin == true then
- shell.run("edit",configPath)
- shell.run(filePath)
- end
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 3 then
- if X >=2 and X <=10 and Y == 8 and button == 1 then
- drawDesktop()
- QuickTils.color(256)
- QuickTils.bColor(backColor)
- QuickTils.cursor(2,8)
- print(" ")
- QuickTils.cursor(2,8)
- local txtInput = read()
- configFile.setSectionedValue("Appearance","iCon1Text",txtInput)
- configFile.save(configPath)
- shell.run(filePath)
- elseif X >=2 and X <=10 and Y == 9 and button == 1 then
- drawDesktop()
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(16,7)
- print(" [CHANGE ICON] ")
- QuickTils.bColor(128)
- lY = 8
- for i=1,3 do
- QuickTils.cursor(16,lY)
- print(" ")
- lY = lY+1
- end
- QuickTils.bColor(256)
- QuickTils.cursor(17,9)
- print(" ")
- QuickTils.cursor(17,9)
- QuickTils.color(textColor)
- write("Path: ")
- local picInput = read()
- if not picInput == "" then
- if fs.exists("/AquaOS/Resources/.icons/"..picInput) then
- configFile.setSectionedValue("Appearance","iCon1Pic",picInput)
- configFile.save(configPath)
- end
- end
- shell.run(filePath)
- elseif X >=2 and X <=10 and Y == 10 and button == 1 then
- drawDesktop()
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(16,7)
- print(" [CHANGE ICON] ")
- QuickTils.bColor(128)
- lY = 8
- for i=1,3 do
- QuickTils.cursor(16,lY)
- print(" ")
- lY = lY+1
- end
- QuickTils.bColor(256)
- QuickTils.cursor(17,9)
- print(" ")
- QuickTils.cursor(17,9)
- QuickTils.color(textColor)
- write("Path: ")
- local lnkInput = read()
- if fs.exists("/AquaOS/Resources/Apps/"..lnkInput) then
- configFile.setSectionedValue("Appearance","iCon1Link",lnkInput)
- configFile.save(configPath)
- end
- shell.run(filePath)
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 4 then
- if X >=39 and X <=49 and Y == 8 and button == 1 then
- drawDesktop()
- QuickTils.color(256)
- QuickTils.bColor(backColor)
- QuickTils.cursor(40,8)
- print(" ")
- QuickTils.cursor(40,8)
- local txtInput2 = read()
- configFile.setSectionedValue("Appearance","iCon2Text",txtInput2)
- configFile.save(configPath)
- shell.run(filePath)
- elseif X >=39 and X <=49 and Y == 9 and button == 1 then
- drawDesktop()
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(16,7)
- print(" [CHANGE ICON] ")
- QuickTils.bColor(128)
- lY = 8
- for i=1,3 do
- QuickTils.cursor(16,lY)
- print(" ")
- lY = lY+1
- end
- QuickTils.bColor(256)
- QuickTils.cursor(17,9)
- print(" ")
- QuickTils.cursor(17,9)
- QuickTils.color(textColor)
- write("Path: ")
- local picInput2 = read()
- if not picInput2 == "" then
- if fs.exists("/AquaOS/Resources/.icons/"..picInput2) then
- configFile.setSectionedValue("Appearance","iCon2Pic",picInput2)
- configFile.save(configPath)
- end
- end
- shell.run(filePath)
- elseif X >=39 and X <=49 and Y == 10 and button == 1 then
- drawDesktop()
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(16,7)
- print(" [CHANGE ICON] ")
- QuickTils.bColor(128)
- lY = 8
- for i=1,3 do
- QuickTils.cursor(16,lY)
- print(" ")
- lY = lY+1
- end
- QuickTils.bColor(256)
- QuickTils.cursor(17,9)
- print(" ")
- QuickTils.cursor(17,9)
- QuickTils.color(textColor)
- write("Path: ")
- local lnkInput2 = read()
- if fs.exists("/AquaOS/Resources/Apps/"..lnkInput2) then
- configFile.setSectionedValue("Appearance","iCon2Link",lnkInput2)
- configFile.save(configPath)
- end
- shell.run(filePath)
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 6 then
- if X>=40 and X<=50 and Y==3 and button==1 then
- shell.run("/AquaOS/Resources/.about")
- break
- elseif X>=40 and X<=50 and Y==4 and button==1 then
- shell.run(cFilePath)
- break
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 7 then
- if X>=19 and X<=31 and Y==3 and button==1 then
- shell.run("/AquaOS/Resources/Apps/LuaIDE")
- return
- shell.run(filePath)
- elseif X>=19 and X<=31 and Y==4 and button==1 then
- drawDesktop()
- QuickTils.bColor(tBarCol)
- QuickTils.cursor(16,7)
- print(" [NPAINTPRO] ")
- QuickTils.bColor(128)
- lY = 8
- for i=1,3 do
- QuickTils.cursor(16,lY)
- print(" ")
- lY = lY+1
- end
- QuickTils.bColor(256)
- QuickTils.cursor(17,9)
- print(" ")
- QuickTils.cursor(17,9)
- QuickTils.color(textColor)
- write("Path: ")
- local paintFile = read()
- if not fs.exists(paintFile) then
- shell.run("/AquaOS/Resources/Apps/NPaintPro","-t "..paintFile)
- end
- return
- shell.run(filePath)
- elseif X>=19 and X<=31 and Y==5 and button==1 then
- shell.run("/AquaOS/Resources/Apps/FileManager")
- return
- shell.run(filePath)
- else
- slc = 0
- drawDesktop()
- end
- end
- end
- end
- -- The Launcher Desktop
- function lMainDesktop()
- lDrawDesktop()
- while true do
- local event,button,X,Y = os.pullEventRaw()
- if slc == 0 then
- if event == "mouse_click" then
- if X>=34 and X<=50 and Y==14 and button==1 then
- QuickTils.bColor(colors.gray)
- QuickTils.color(textColor)
- QuickTils.cursor(34,14)
- local userInput = read()
- QuickTils.cursor(34,17)
- local passInput = read("*")
- if userInput == adminUser and passInput == adminPass then
- admin = true
- lDrawDesktop()
- QuickTils.bColor(backColor)
- QuickTils.color(colors.lime)
- QuickTils.cursor(35,18)
- print("Welcome.")
- configFile.setSectionedValue("Other","loginPass","1")
- configFile.setSectionedValue("Other","currentUser","admin")
- configFile.save(configPath)
- sleep(3)
- shell.run(filePath)
- break
- elseif userInput == basicUser1 and passInput == basicPass1 then
- admin = false
- lDrawDesktop()
- QuickTils.bColor(backColor)
- QuickTils.color(colors.lime)
- QuickTils.cursor(35,18)
- print("Welcome.")
- configFile.setSectionedValue("Other","loginPass","1")
- configFile.setSectionedValue("Other","currentUser","user1")
- configFile.save(configPath)
- sleep(3)
- shell.run(filePath)
- break
- elseif userInput == basicUser2 and passInput == basicPass2 then
- admin = false
- lDrawDesktop()
- QuickTils.bColor(backColor)
- QuickTils.color(colors.lime)
- QuickTils.cursor(35,18)
- print("Welcome.")
- configFile.setSectionedValue("Other","loginPass","1")
- configFile.setSectionedValue("Other","currentUser","user2")
- configFile.save(configPath)
- sleep(3)
- shell.run(filePath)
- break
- elseif userInput == basicUser3 and passInput == basicPass3 then
- admin = false
- lDrawDesktop()
- QuickTils.bColor(backColor)
- QuickTils.color(colors.lime)
- QuickTils.cursor(35,18)
- print("Welcome.")
- sleep(3)
- configFile.setSectionedValue("Other","loginPass","1")
- configFile.setSectionedValue("Other","currentUser","user3")
- configFile.save(configPath)
- shell.run(filePath)
- break
- else
- lDrawDesktop()
- QuickTils.bColor(backColor)
- QuickTils.color(colors.red)
- QuickTils.cursor(35,18)
- print("Invalid.")
- end
- elseif X>=3 and X<=11 and Y==1 and button==1 then
- lDrawMenu1()
- slc = 1
- else
- lDrawDesktop()
- end
- end
- elseif slc == 1 then
- if X>=2 and X<=9 and button==1 and Y==3 then slc=0
- configFile.setSectionedValue("Other","loginPass","0")
- configFile.save(configPath)
- return
- os.shutdown()
- elseif X>=2 and X<=9 and button==1 and Y==4 then slc=0
- configFile.setSectionedValue("Other","loginPass","0")
- configFile.save(configPath)
- return
- os.reboot()
- else
- slc = 0
- lDrawDesktop()
- end
- end
- end
- end
- if firstRun == true then
- QuickTils.bColor(colors.white)
- QuickTils.clean(1,1)
- fTitleBar()
- QuickTils.bColor(colors.white)
- QuickTils.color(colors.black)
- QuickTils.cursor(20,4)
- print("Admin Username:")
- QuickTils.cursor(20,8)
- print("Admin Password:")
- QuickTils.bColor(colors.gray)
- QuickTils.cursor(20,5)
- print(" ")
- QuickTils.cursor(20,9)
- print(" ")
- QuickTils.cursor(20,5)
- QuickTils.color(colors.lightGray)
- local userInput = read()
- QuickTils.cursor(20,9)
- local passInput = read("*")
- configFile.setSectionedValue("Accounts","adminUser",userInput)
- configFile.setSectionedValue("Accounts","adminPass",passInput)
- configFile.save(configPath)
- shell.run(filePath)
- elseif firstRun == false then
- QuickTils.bColor(backColor)
- QuickTils.clean(1,1)
- if loginPass == 0 then
- lMainDesktop()
- elseif loginPass == 1 then
- mainDesktop()
- else
- error("I don't know how to start!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement