Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verze = "22.0222.R3"
- local tArgs = { ... }
- local anim = 0.1
- local RamCesta = ("/C/system/RAM/setting")
- local w, h = term.getSize()
- local idPC = os.getComputerID()
- local ADC = false
- local adMode = false
- local ModemPos=""
- local adPass=""
- local disAD = false
- local prepisAD = false
- local sound = false
- ----------------------------------------------------
- local f=fs.open("/C/system/RAM/user","r")
- user=f.readLine()
- f.close()
- local userRegistry = "/C/system/Users/"..user.."/.Registry/"
- local systemRegistry = "/C/system/.core/.Registry/"
- dofile("/C/system/api/decrypt.lua")
- function readuser()
- user=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 1)
- pass=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 2)
- Fname=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 3)
- Lname=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 4)
- isAdmin=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 5)
- mistni=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 6)
- if (Fname == nil) then Fname="" end
- if (Lname == nil) then Lname="" end
- if (isAdmin == nil) then isAdmin="t" end
- if (mistni == nil) then mistni="f" end
- if (isAdmin == "t") then Amode = true end
- if not prepisAD then
- adUser = user
- adPass = pass
- end
- end
- ----------------------------------------------------
- if fs.exists("/C/system/RAM/devices/speaker.tmp") and not fs.exists(userRegistry..".disableSound") then
- sound = true
- end
- function song(type)
- if sound and not fs.exists(userRegistry..".disableSound") then shell.run("/C/system/api/sound.api "..type) end
- end
- function ukonceni ()
- fs.delete (RamCesta)
- error("ukonceno")
- end
- ----------------------------------------------------
- if fs.exists("/C/system/.core/system") then
- local data = fs.open ("/C/system/.core/system", "r")
- edice = data.readLine()
- data.close()
- else
- edice = "Standard"
- end
- ----------------------------------------------------
- if (edice == "Server") then
- ServerMode = true
- end
- ----------------------------------------------------
- if fs.exists("/C/system/.core/defmodem") then
- local data = fs.open ("/C/system/.core/defmodem","r")
- modemPos = data.readLine()
- data.close()
- if not modemPos then
- fs.delete("/C/system/.core/defmodem")
- modemPos = "offline"
- end
- else
- modemPos = "offline"
- end
- if fs.exists ("/C/system/.core/AD") then
- local f=fs.open("/C/system/.core/AD","r")
- ADServer=f.readLine()
- f.close()
- adMode = true
- end
- -----------------------------------------------------
- local function downloading(dkod, cestaP)
- shell.run("/C/system/api/stahni.api get "..dkod.." "..cestaP)
- end
- ------------------------------------------------------------
- function cbarva()
- lista.setTextColor(colors.black)
- lista.setBackgroundColor(colors.gray)
- end
- function bbarva()
- txc(colors.black)
- bgc(colors.lightBlue)
- end
- local function bgc(barvaP) term.setBackgroundColor(barvaP) end
- local function txc(barvaP) term.setTextColor(barvaP) end
- local function curs(xi,yi) term.setCursorPos(xi,yi) end
- local function pbgc(barvaP) pozadi.setBackgroundColor(barvaP) end
- local function ptxc(barvaP) pozadi.setTextColor(barvaP) end
- local function pcurs(xi,yi) pozadi.setCursorPos(xi,yi) end
- local function Barvy()
- if fs.exists (userRegistry.."colors") then
- local data = fs.open(userRegistry.."colors", "r")
- BarPoz = tonumber(data.readLine())
- BarTxt = tonumber(data.readLine())
- data.close()
- end
- if BarPoz == nil or BarTxt == nil then BarPoz = 2048 BarTxt = 1 end
- end
- function defaultvalue()
- readuser()
- Nuser = " "
- Npass = ""
- NFname = " "
- NLname = " "
- IsAdmin = "f"
- end
- --------------------------
- function zapsat()
- local f=fs.open("/C/system/Users/"..user.."/.data","w")
- f.writeLine(user)
- f.writeLine(pass)
- f.writeLine(Fname)
- f.writeLine(Lname)
- f.writeLine(isAdmin)
- f.writeLine(mistni)
- f.close()
- ADsend()
- end
- function start()
- defaultvalue()
- Barvy()
- local StartWin = window.create(term.current(),w/2-11,h/2-5,25,9)
- StartWin.setBackgroundColor(BarPoz)
- StartWin.setTextColor(BarTxt)
- StartWin.clear()
- StartWin.setCursorPos (7, 5)
- StartWin.write"System Setting"
- StartWin.setCursorPos (1, 9)
- StartWin.write(verze)
- StartWin.setCursorPos (1, 1)
- StartWin.write"Pepek@Soft"
- StartWin.setCursorPos (22, 9)
- StartWin.write"2020"
- sleep(0.5)
- menu()
- end
- function flista(n1, n2, n3, n4, n5, n6, n7)
- lista = window.create(term.current(),1,3,12,h-2)
- lista.setBackgroundColor(BarPoz)
- lista.setTextColor(BarTxt)
- lista.clear()
- lista.setCursorPos(2,3)
- lista.write(n1)
- lista.setCursorPos(2,5)
- lista.write(n2)
- lista.setCursorPos(2,7)
- lista.write(n3)
- lista.setCursorPos(2,9)
- lista.write(n4)
- lista.setCursorPos(2,11)
- lista.write(n5)
- lista.setCursorPos(2,13)
- lista.write(n6)
- lista.setCursorPos(2,15)
- lista.write(n7)
- lista.setCursorPos(2,h-2)
- lista.setTextColor(colors.white)
- lista.write("Pepek@Soft")
- end
- function plocha()
- w, h = term.getSize()
- paintutils.drawLine(1, 1, w-1, 1, BarPoz)
- paintutils.drawPixel (w,1, colors.red)
- curs (w,1)
- txc(1)
- write "×"
- barW = window.create(term.current(),1,2,w,1)
- barW.setBackgroundColor(colors.gray)
- barW.clear()
- barW.setTextColor(colors.white)
- barW.setCursorPos(2,1)
- barW.write"Setting >"
- pozadi = window.create(term.current(),13,3,w,h-2)
- pbgc(colors.white)
- ptxc(colors.black)
- pozadi.clear()
- bgc(colors.lightGray)
- end
- -----------------------------------------------------------------------------
- if #tArgs > 0 then
- page = tArgs[1]
- else
- page = "main"
- end
- function main()
- barW.setCursorPos(12,1)
- barW.write"Dashboard"
- pcurs(2,2)
- bgc(colors.white)
- txc(colors.black)
- ----------------------------------------------------
- write ("Pepdroll Seven "..edice)
- pcurs(2, 6)
- write " "
- pcurs(2, 6)
- write ("Free disk space: "..(tonumber(fs.getFreeSpace("/")/1000)).." kB")
- pcurs(2, 7)
- write ("Use disk space: "..(1000-tonumber(fs.getFreeSpace("/")/1000)).." kB")
- vypMis = math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10
- vypMis = math.ceil(vypMis/100*33)
- misto = ""
- bgc(colors.lightBlue)
- pcurs(2, 8)
- term.write " " --33
- if (vypMis <24) then
- pcurs(((33-vypMis)/2)+vypMis-2, 8)
- term.write((100-(math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10)).."% Free")
- elseif (vypMis <30) then
- pcurs(((33-vypMis)/2)+vypMis, 8)
- write "Free"
- end
- for i=1,vypMis do
- misto = misto.." "
- end
- bgc(colors.blue)
- pcurs(2, 8)
- term.write(misto)
- ptxc(colors.black)
- if (vypMis > 7) then
- pcurs(((vypMis)/2)-2, 8)
- term.write((math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10).."% Used")
- elseif (vypMis > 2) then
- pcurs(((vypMis)/2)+1, 8)
- term.write((math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10).."%")
- end
- ptxc(colors.black)
- bgc(colors.white)
- internetcon = ""
- internetsrv = ""
- if fs.exists ("/C/system/RAM/online") then
- ptxc(colors.black)
- internetcon = "Internet access"
- local data = fs.open("/C/system/RAM/online", "r") internetsrv = data.readLine() data.close()
- else
- ptxc(colors.red)
- internetcon = "No internet access"
- end
- pcurs(12, 11)
- write (internetcon)
- ptxc(colors.black)
- pcurs(2, 11)
- write ("Network : ")
- pcurs(2, 12)
- write ("Server : "..internetsrv)
- pcurs(2, 14)
- if os.getComputerLabel() == nil or os.getComputerLabel() == "" then
- write ("Label : None")
- else
- write ("Label : "..(os.getComputerLabel()))
- end
- pcurs(2, 15)
- write ("Comp. ID: "..(os.getComputerID()))
- pcurs(2, 13)
- pozadi.write ("Update :")
- pcurs(12, 13)
- if not fs.exists (systemRegistry..".disableUpdate") then
- pozadi.write("Enable")
- else
- ptxc(colors.red) pozadi.write("Disabled")
- end
- end
- ------------------------------------------------------------------------------------------------------------------ ucty
- function ADsend()
- if adMode then
- modem = peripheral.wrap(modemPos)
- modem.open(idPC)
- modem.transmit(tonumber(ADServer),554,idPC)
- modem.transmit(tonumber(ADServer),555,user)
- prijmout()
- if ADC then
- local f=fs.open("/C/system/Users/"..user.."/.data","r")
- Docuser = f.readAll()
- f.close()
- modem.transmit(tonumber(ADServer),557,Docuser)
- end
- end
- end
- function account()
- stavlog = " No"
- if fs.exists("/C/system/.core/logon") then
- local f = fs.open("/C/system/.core/logon", "r")
- local Auser=f.readLine()
- f.close()
- if Auser == user then stavlog = "Yes" end
- end
- barW.setCursorPos(12,1)
- barW.write"Accounts"
- pcurs(2,2)
- txc(colors.black)
- ----------------------------------------------------
- bgc(colors.white)
- write ("Your info")
- bgc(colors.lightGray)
- pcurs(14,5)
- write (" ")
- pcurs(15,5)
- write(Fname)
- pcurs(14,6)
- write (" ")
- pcurs(15,6)
- write(Lname)
- pcurs(2,13)
- write (" Password ")
- pcurs(2,15)
- write (" Other Users ")
- pcurs(19,11)
- write (" ")
- pcurs(20,11)
- write(stavlog)
- if stavlog=="Yes" then paintutils.drawPixel(35,13, colors.green) else paintutils.drawPixel(31,13, colors.red) end
- bgc(colors.white)
- pcurs(2,4)
- write ("Username: "..user)
- pcurs(2,5)
- write ("First name:")
- pcurs(2,6)
- write ("Last name: ")
- pcurs(2,8)
- if (mistni == "t") then write("Local user") else write("Domain user") end
- pcurs(2,9)
- if (isAdmin == "t") then write("Administrator") else write("Limited account") end
- pcurs(2,11)
- write ("Automatic login:")
- bgc(colors.lightBlue)
- end
- function passWin()
- oPass = ""
- nPass1 = ""
- nPass2 = ""
- local function check()
- eComp.setCursorPos (11, 6)
- eComp.write" "
- if (nPass1 == nPass2) then
- eComp.setTextColor(colors.lime)
- eComp.setCursorPos (12, 6)
- eComp.write("Same")
- txc(colors.white)
- else
- eComp.setTextColor(colors.red)
- eComp.setCursorPos (12, 6)
- eComp.write("Different")
- txc(colors.white)
- end
- end
- eComp = window.create(term.current(),w/2-5,h/2-4,25,9)
- eComp.setBackgroundColor(colors.gray)
- eComp.clear()
- eComp.setBackgroundColor(colors.red)
- eComp.setCursorPos (25, 1)
- eComp.write"×"
- eComp.setBackgroundColor(colors.gray)
- eComp.setTextColor(colors.white)
- eComp.setCursorPos (2, 1)
- eComp.write"Change your password"
- eComp.setCursorPos (2, 4)
- eComp.write"Old: "
- eComp.setCursorPos (2, 5)
- eComp.write"New: "
- eComp.setCursorPos (2, 6)
- eComp.write"Confirm: "
- eComp.setBackgroundColor(colors.lightGray)
- eComp.setCursorPos (11, 4)
- eComp.write" "
- eComp.setCursorPos (11, 5)
- eComp.write" "
- check()
- eComp.setTextColor(colors.white)
- eComp.setCursorPos (10, 8)
- eComp.write" Apply "
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if event == "mouse_click" and x == 44 and y == 5 then
- menu()
- elseif event == "mouse_click" and x >= 30 and x <= 43 and y == 8 then
- bgc(colors.lightBlue)
- eComp.setCursorPos (11, 4)
- write" "
- eComp.setCursorPos (12, 4)
- oPass = read(string.char(7))
- bgc(colors.lightGray)
- eComp.setCursorPos (11, 4)
- write" "
- eComp.setCursorPos (12, 4)
- for i=1,#oPass do
- write(string.char(7))
- end
- elseif event == "mouse_click" and x >= 30 and x <= 43 and y == 9 then
- bgc(colors.lightBlue)
- eComp.setCursorPos (11, 5)
- write" "
- eComp.setCursorPos (12, 5)
- nPass1 = read(string.char(7))
- check()
- bgc(colors.lightGray)
- eComp.setCursorPos (11, 5)
- write" "
- eComp.setCursorPos (12, 5)
- for i=1,#nPass1 do
- write(string.char(7))
- end
- elseif event == "mouse_click" and x >= 30 and x <= 43 and y == 10 then
- bgc(colors.lightBlue)
- eComp.setCursorPos (11, 6)
- write" "
- eComp.setCursorPos (12, 6)
- nPass2 = read(string.char(7))
- check()
- elseif event == "mouse_click" and x >= 29 and x <= 35 and y == 12 then
- eComp.setTextColor(colors.white)
- eComp.setBackgroundColor(colors.gray)
- eComp.setCursorPos (10, 8)
- eComp.write" Apply "
- sleep(anim)
- if (oPass == pass) then
- pass = nPass1
- if stavlog == "Yes" then
- local f = fs.open("/C/system/.core/logon","w")
- f.writeLine(user)
- f.writeLine(pass)
- f.close()
- end
- return
- else
- eComp.setCursorPos (2, 3)
- eComp.write"Incorrect old password!"
- eComp.setBackgroundColor(colors.lightGray)
- eComp.setCursorPos (10, 8)
- eComp.write" Apply "
- song("error")
- end
- end
- end
- end
- function CreateWindow()
- DialWin = window.create(term.current(),14,4,25,14)
- DialWin.setBackgroundColor(colors.gray)
- DialWin.clear()
- ww, wh = DialWin.getSize()
- DialWin.setTextColor(colors.white)
- DialWin.setBackgroundColor(colors.red)
- DialWin.setCursorPos (25,1)
- DialWin.write "×"
- DialWin.setBackgroundColor(colors.lightGray)
- DialWin.setCursorPos (10,13)
- DialWin.write " Apply "
- DialWin.setBackgroundColor(colors.gray)
- DialWin.setTextColor(colors.white)
- end
- function UserWin(SUser)
- defaultvalue()
- if not (SUser == "") then
- local f=fs.open("/C/system/Users/"..SUser.."/.data","r")
- Cuser=f.readLine()
- Cpass=f.readLine()
- Fname=f.readLine()
- Lname=f.readLine()
- IsAdmin=f.readLine()
- f.close()
- end
- CreateWindow()
- DialWin.setCursorPos (3,2)
- DialWin.write "UserName:"
- DialWin.setCursorPos (3,5)
- DialWin.write "Password:"
- DialWin.setCursorPos (3,7)
- DialWin.write "F Name:"
- DialWin.setCursorPos (3,9)
- DialWin.write "L Name:"
- DialWin.setCursorPos (3,11)
- DialWin.write "Permissions:"
- DialWin.setBackgroundColor(colors.lightGray)
- DialWin.setCursorPos (3,3)
- DialWin.write " "
- DialWin.setCursorPos (13,5)
- DialWin.write " "
- DialWin.setCursorPos (13,7)
- DialWin.write " "
- DialWin.setCursorPos (13,9)
- DialWin.write " "
- DialWin.setCursorPos (16,11)
- DialWin.write " "
- if (SUser == "") then
- else
- DialWin.setCursorPos (4,3)
- if (Nuser == " " or Nuser == nil) then
- DialWin.write (tostring(Cuser))
- else
- DialWin.write (tostring(Nuser))
- end
- DialWin.setCursorPos (14,5)
- DialWin.write "Password"
- if Fname == nil then Fname = "" end
- DialWin.setCursorPos (14,7)
- DialWin.write (Fname)
- if Lname == nil then Lname = "" end
- DialWin.setCursorPos (14,9)
- DialWin.write (Lname)
- if (IsAdmin == "t") then
- DialWin.setCursorPos (16,11)
- DialWin.write " Admin "
- else
- DialWin.setCursorPos (16,11)
- DialWin.write " User "
- end
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- curs(1,1)
- write(x..","..y)
- if x >= 23 and x <= 29 and y == 16 and button == 1 then
- DialWin.setCursorPos (10,13)
- DialWin.write " Apply "
- sleep(anim)
- if Amode or SUser==user then
- if (SUser == "") then
- if not fs.exists ("/C/system/Users/"..Nuser.."/.data") and not (Nuser == "") and not (Nuser == nil)then
- local f=fs.open("/C/system/Users/"..Nuser.."/.data","w")
- f.writeLine(Nuser)
- f.writeLine(Npass)
- f.writeLine(NFname)
- f.writeLine(NLname)
- f.writeLine(IsAdmin)
- f.close()
- end
- else
- local f=fs.open("/C/system/Users/"..SUser.."/.data","w")
- f.writeLine(SUser)
- if not (Npass == " ") then f.writeLine(Npass) else f.writeLine("") end
- if not (NFname == " ") then f.writeLine(NFname) else f.writeLine("") end
- if not (NLname == " ") then f.writeLine(NLname) else f.writeLine("") end
- f.writeLine(IsAdmin)
- f.close()
- end
- else
- DialWin.setBackgroundColor(colors.gray)
- DialWin.setCursorPos (5,14)
- DialWin.write "You are not Admin!"
- sleep(1)
- end
- defaultvalue()
- menu()
- elseif x >= 16 and x <= 36 and y == 6 and button == 1 then
- bbarva()
- DialWin.setBackgroundColor(colors.lightBlue)
- DialWin.setCursorPos (3,3)
- DialWin.write " "
- DialWin.setCursorPos (4,3)
- Nuser = read()
- elseif x >= 26 and x <= 36 and y == 8 and button == 1 then
- bbarva()
- DialWin.setBackgroundColor(colors.lightBlue)
- DialWin.setCursorPos (13,5)
- DialWin.write " "
- DialWin.setCursorPos (14,5)
- Npass = read(string.char(7))
- elseif x >= 26 and x <= 36 and y == 10 and button == 1 then
- bbarva()
- DialWin.setBackgroundColor(colors.lightBlue)
- DialWin.setCursorPos (13,7)
- DialWin.write " "
- DialWin.setCursorPos (14,7)
- NFname = read()
- elseif x >= 26 and x <= 36 and y == 12 and button == 1 then
- bbarva()
- DialWin.setBackgroundColor(colors.lightBlue)
- DialWin.setCursorPos (13,9)
- DialWin.write " "
- DialWin.setCursorPos (14,9)
- NLname = read()
- elseif x >= 26 and x <= 36 and y == 14 and button == 1 then
- DialWin.setCursorPos (16,11)
- if (IsAdmin == "t") then
- IsAdmin = "f"
- DialWin.write " User "
- else
- DialWin.write " Admin "
- IsAdmin = "t"
- end
- elseif x == 38 and y == 4 and button == 1 then
- defaultvalue()
- menu()
- end
- end
- end
- function Oaccount()
- barW.setCursorPos(12,1)
- barW.write"Accounts > Other Accounts"
- pcurs(2,2)
- txc(colors.black)
- ----------------------------------------------------
- bgc(colors.white)
- write ("Other users, loged user: "..user)
- UsrT = window.create(term.current(),14,6,w-14,h-3)
- UsrT.setBackgroundColor(colors.lightBlue)
- UsrT.setTextColor(colors.black)
- UsrT.clear()
- cUsr = fs.list("/C/system/Users/")
- local a=1
- for i = 1, #cUsr do
- local name = tostring(cUsr[i])
- UsrT.setBackgroundColor(colors.lightBlue)
- UsrT.setCursorPos(2,a)
- UsrT.write(cUsr[i])
- a = a+1
- end
- end
- function update()
- barW.setCursorPos(12,1)
- barW.write"Update > Update service"
- pcurs(2,2)
- txc(colors.black)
- if not fs.exists (systemRegistry..".disableUpdate") then Eupdate = "Yes" else Eupdate = " No" end
- pcurs(2,4)
- write(" Update now ")
- pcurs(2, 2)
- pozadi.write "Enable automatic update: "
- pcurs(30, 2)
- write (" ")
- pcurs(31,2)
- write(Eupdate)
- if Eupdate=="Yes" then paintutils.drawPixel(46,4, colors.green) else paintutils.drawPixel(42,4, colors.red) end
- if fs.exists ("/C/system/RAM/UpdateList.tmp") then
- local data = fs.open("/C/system/RAM/UpdateList.tmp", "r")
- pcurs(2,7) pozadi.write(data.readLine())
- pcurs(2,8) pozadi.write(data.readLine())
- pcurs(2,9) pozadi.write(data.readLine())
- data.close()
- end
- end
- ------------------------------------------------------------------------------------------------------------------ network
- function prijmout()
- local odpoved = false
- timerRX = os.startTimer(2)
- while true do
- local event,p1,p2,p3,p4 = os.pullEvent()
- if event == ("modem_message") then
- if (p3 == 552) then
- odpoved = true
- if (p4 == "true") then
- ptxc(colors.green)
- if not disAD then
- local c = fs.open ("/C/system/.core/AD", "w")
- c.writeLine(tostring(adID))
- c.close()
- pcurs(2,16)
- pozadi.write"Successfully connected!"
- else
- fs.delete("/C/system/.core/AD")
- pcurs(2,16)
- pozadi.write"Successfully disconnected!"
- mistni = "t"
- adMode = false
- zapsat()
- end
- sleep(0.5)
- os.reboot()
- else
- pcurs(2,16)
- ptxc(colors.red)
- pozadi.write"Error, invalid login!"
- if sound then song("login") sleep (0.5)
- else sleep(1) end
- end
- elseif (p3 == 1) then
- if (p4 == user) then
- ADC = true
- else
- ADC = false
- end
- return
- end
- elseif event == "timer" then
- if p1 >= timerRX then
- pcurs(2,16)
- ptxc(colors.red)
- ADC = false
- if not odpoved then pozadi.write"Error, server not found!" sleep(1) end
- menu()
- end
- end
- end
- end
- function defmodem(size)
- local dm = fs.open("/C/system/.core/defmodem","w")
- dm.writeLine(size)
- dm.close()
- end
- function dotaz()
- if not (adID == nil) then
- modemC.open(idPC)
- modemC.transmit(tonumber(adID),550,idPC)
- if disAD then modemC.transmit(tonumber(adID),553,"DisConnect") end
- modemC.transmit(tonumber(adID),551,adUser)
- modemC.transmit(tonumber(adID),552,adPass)
- prijmout()
- end
- end
- function network()
- barW.setCursorPos(12,1)
- barW.write"Network"
- pcurs(2,2)
- txc(colors.black)
- pbgc(colors.white)
- if fs.exists("/C/system/.core/defmodem") then
- s = fs.open("/C/system/.core/defmodem","r")
- modemPos = s.readLine()
- s.close()
- AD = true
- modemE = peripheral.wrap(modemPos)
- if not modemE then
- fs.delete("/C/system/.core/defmodem")
- network()
- end
- else
- modemPos = "offline"
- AD = false
- end
- ptxc(colors.black)
- pcurs(2,1)
- pozadi.write"Primary modem"
- pcurs(2,10)
- pozadi.write"Set Label:"
- pbgc(colors.lightGray)
- pcurs(14,10)
- pozadi.write" "
- if not os.getComputerLabel() == nil or not os.getComputerLabel() == "" then
- pcurs(15,10)
- write (os.getComputerLabel())
- end
- if not (modemPos == "offline") then
- pbgc(colors.white)
- pcurs(2,14)
- pozadi.write"Admin user:"
- pcurs(2,15)
- pozadi.write"Admin pass:"
- if not adMode then
- pcurs(2,13)
- pozadi.write"Server ID:"
- pcurs(2,12)
- pozadi.write"Connect to AD server:"
- pbgc(colors.lightGray)
- pcurs(14,13)
- pozadi.write" "
- if not (adID == nil) then pcurs(15,13) pozadi.write(tostring(adID)) end
- pcurs(14,14)
- pozadi.write" "
- if not (adUser == "" or adUser == nil) then pcurs(15,14) pozadi.write(adUser) end
- pcurs(14,15)
- pozadi.write" "
- if not (adPass == ""or adPass == nil) then
- pcurs(15,15)
- for i=1,#adPass do
- pozadi.write(string.char(7))
- end
- end
- pbgc(colors.lightGray)
- ww = w-12
- pcurs(ww/2+1,h-2)
- pozadi.write" Connect "
- else
- pcurs(2,12)
- pozadi.write("Your AD server ID: "..ADServer)
- pbgc(colors.lightGray)
- pcurs(14,14)
- pozadi.write" "
- adID = ADServer
- if not (adUser == "" or adUser == nil) then pcurs(15,14) pozadi.write(adUser) end
- pcurs(14,15)
- pozadi.write" "
- if not (adPass == ""or adPass == nil) then
- pcurs(15,15)
- for i=1,#adPass do
- pozadi.write(string.char(7))
- end
- end
- pbgc(colors.lightGray)
- ww = w-12
- pcurs(ww/2+1,h-2)
- pozadi.write" Disconnect "
- end
- end
- ptxc(colors.black)
- pbgc(colors.lightGray)
- pcurs(8,3)
- if (modemPos == "top") then pbgc(colors.gray) else pbgc(colors.lightGray) end
- pozadi.write" TOP "
- pcurs(8,5)
- if (modemPos == "left") then pbgc(colors.gray) else pbgc(colors.lightGray) end
- pozadi.write" LEFT "
- pcurs(8,7)
- if (modemPos == "right") then pbgc(colors.gray) else pbgc(colors.lightGray) end
- pozadi.write" RIGHT "
- pcurs(20,3)
- if (modemPos == "back") then pbgc(colors.gray) else pbgc(colors.lightGray) end
- pozadi.write" BACK "
- pcurs(20,5)
- if (modemPos == "bottom") then pbgc(colors.gray) else pbgc(colors.lightGray) end
- pozadi.write" BOTTOM "
- pcurs(20,7)
- if (modemPos == "offline") then pbgc(colors.gray) else pbgc(colors.lightGray) end
- pozadi.write" OFFLINE "
- end
- ------------------------------------------------------------------------------------------------------------------ System
- function sounds()
- if fs.exists("/C/system/RAM/devices/speaker.tmp") and not fs.exists(userRegistry..".disableSound") then
- sound = true
- else
- sound = false
- end
- barW.setCursorPos(12,1)
- barW.write"Sounds"
- pcurs(2,2)
- txc(colors.black)
- pbgc(colors.white)
- if not fs.exists (userRegistry..".disableSound") then Esound = "Yes" else Esound = " No" end
- pcurs(2, 2)
- pozadi.write "Enable sound notifications: "
- pcurs(30, 2)
- write (" ")
- pcurs(31,2)
- write(Esound)
- if Esound=="Yes" then paintutils.drawPixel(46,4, colors.green) else paintutils.drawPixel(42,4, colors.red) end
- end
- function system()
- barW.setCursorPos(12,1)
- barW.write"Display"
- pcurs(2,2)
- txc(colors.black)
- pbgc(colors.white)
- pcurs(2, 2)
- pozadi.write "Connecting the monitor"
- pcurs(2, 12)
- pozadi.write"No monitor:"
- pcurs(2, 10)
- pozadi.write"User define: "
- pcurs(2, 16)
- pozadi.write"Show hidden items: "
- pcurs(2, 14)
- pozadi.write"Show real time: "
- pbgc(colors.lightGray)
- pcurs(7,5)
- pozadi.write" Left "
- pcurs(14,5)
- pozadi.write" Right "
- pcurs(23,5)
- pozadi.write" Back "
- pcurs(7, 7)
- pozadi.write " Top "
- pcurs(14, 7)
- pozadi.write " Bottom "
- pcurs(23,7)
- pozadi.write" Find "
- pcurs(15, 10)
- pozadi.write" "
- pcurs(15, 12)
- pozadi.write " Disconect "
- if not fs.exists (userRegistry..".showItem") then sItem = " No" else sItem = "Yes" end
- pcurs(30, 16)
- pozadi.write (" ")
- pcurs(31,16)
- pozadi.write(sItem)
- if sItem=="Yes" then paintutils.drawPixel(46,18, colors.green) else paintutils.drawPixel(42,18, colors.red) end
- if fs.exists (userRegistry..".realTime") then Ertime = "Yes" else Ertime = " No" end
- pcurs(30, 14)
- pozadi.write (" ")
- pcurs(31,14)
- pozadi.write(Ertime)
- if Ertime=="Yes" then paintutils.drawPixel(46,16, colors.green) else paintutils.drawPixel(42,16, colors.red) end
- pbgc(colors.gray)
- end
- function recovery()
- barW.setCursorPos(12,1)
- barW.write"Recovery"
- pcurs(2,2)
- txc(colors.black)
- pbgc(colors.white)
- pcurs(2, 2)
- pozadi.write "Select what to recover:"
- bgc(colors.lightGray)
- pcurs(2, 6)
- term.write " Users and Settings "
- pcurs(2, 8)
- term.write " Reinstall System "
- -- pcurs(2, 10)
- --term.write " Partially reinstall "
- --pbgc(colors.gray)
- end
- ------------------------------------------------------------------------------------------------------------------ vzhled
- function appearance()
- Barvy()
- if fs.exists (userRegistry..".menuColor") then CCM = "Yes" else CCM = " No" end
- barW.setCursorPos(12,1)
- barW.write"Appearance"
- pcurs(2,2)
- ptxc(colors.black)
- pbgc(colors.white)
- pcurs(2,4)
- pozadi.write"Text color:"
- pcurs(2,6)
- pozadi.write"Rear color:"
- pcurs(2,8)
- pozadi.write"Menu has theme color:"
- pcurs(24,8)
- write (" ")
- pcurs(25,8)
- write(CCM)
- if CCM=="Yes" then paintutils.drawPixel(40,10, colors.green) else paintutils.drawPixel(36,10, colors.red) end
- if not fs.exists (userRegistry..".disableAnim") then Eanim = "Yes" else Eanim = " No" end
- bgc(colors.lightGray)
- pcurs(2, 2)
- pozadi.write "Enable animations: "
- pcurs(24, 2)
- write (" ")
- pcurs(25,2)
- write(Eanim)
- if Eanim =="Yes" then paintutils.drawPixel(40,4, colors.green) else paintutils.drawPixel(36,4, colors.red) end
- pcurs(2,10)
- pozadi.write"Change Backgrounds"
- pbgc(colors.lightGray)
- pcurs(14,4)
- pozadi.write" V"
- pcurs(14,6)
- pozadi.write" V"
- pcurs(2,12)
- pozadi.write" Solid Color "
- pcurs(2,14)
- pozadi.write" Castle "
- pcurs(2,16)
- pozadi.write" Windows XP "
- pcurs(18,12)
- pozadi.write" Pepdroll 7 "
- pcurs(18,14)
- pozadi.write" Farm "
- pcurs(18,16)
- pozadi.write" Pastebin "
- local nb = BarTxt
- local t
- pcurs(15,4)
- if (nb==1) then t="White" elseif (nb==32768) then t="Black" elseif (nb==16384) then t="Red" elseif (nb==8192) then t="Green" elseif (nb==32) then t="Lime" elseif (nb==16) then t="Yellow" elseif (nb==8) then t="Light Blue" elseif (nb==2048) then t="Blue" elseif (nb==256) then t="Light Gray" elseif (nb==128) then t="Gray" else t="Other" end
- pozadi.write(t)
- nb = BarPoz
- pcurs(15,6)
- if (nb==1) then t="White" elseif (nb==32768) then t="Black" elseif (nb==16384) then t="Red" elseif (nb==8192) then t="Green" elseif (nb==32) then t="Lime" elseif (nb==16) then t="Yellow" elseif (nb==8) then t="Light Blue" elseif (nb==2048) then t="Blue" elseif (nb==256) then t="Light Gray" elseif (nb==128) then t="Gray" else t="Other" end
- pozadi.write(t)
- pbgc(colors.gray)
- end
- function textBarva()
- local textW = window.create(term.current(),26,6,17,10)
- textW.setBackgroundColor(BarPoz)
- textW.clear()
- textW.setCursorPos(2,1)
- textW.setTextColor(1)
- textW.write("White")
- textW.setCursorPos(2,2)
- textW.setTextColor(32768)
- textW.write("Black")
- textW.setCursorPos(2,3)
- textW.setTextColor(16384)
- textW.write("Red")
- textW.setCursorPos(2,4)
- textW.setTextColor(8192)
- textW.write("Green")
- textW.setCursorPos(2,5)
- textW.setTextColor(32)
- textW.write("Lime")
- textW.setCursorPos(2,6)
- textW.setTextColor(16)
- textW.write("Yellow")
- textW.setCursorPos(2,7)
- textW.setTextColor(8)
- textW.write("Light Blue")
- textW.setCursorPos(2,8)
- textW.setTextColor(2048)
- textW.write("Blue")
- textW.setCursorPos(2,9)
- textW.setTextColor(256)
- textW.write("Light Gray")
- textW.setCursorPos(2,10)
- textW.setTextColor(128)
- textW.write("Gray")
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if event == "mouse_click" and x >= 26 and x <= 42 then
- if y == 6 then
- text=1
- elseif y == 7 then
- text=32768
- elseif y == 8 then
- text=16384
- elseif y == 9 then
- text=8192
- elseif y == 10 then
- text=32
- elseif y == 11 then
- text=16
- elseif y == 12 then
- text=8
- elseif y == 13 then
- text=2048
- elseif y == 14 then
- text=256
- elseif y == 15 then
- text=128
- end
- if adMode then sync() end
- local f=fs.open(userRegistry.."colors","w") --#otevrit soubor
- f.writeLine(BarPoz)
- f.writeLine(text)
- f.close()
- Barvy()
- menu()
- else
- menu()
- end
- end
- end
- function backBarva()
- local textW = window.create(term.current(),26,8,17,10)
- textW.setTextColor(BarTxt)
- textW.setCursorPos(1,1)
- textW.setBackgroundColor(1)
- textW.write(" White ")
- textW.setCursorPos(1,2)
- textW.setBackgroundColor(32768)
- textW.write(" Black ")
- textW.setCursorPos(1,3)
- textW.setBackgroundColor(16384)
- textW.write(" Red ")
- textW.setCursorPos(1,4)
- textW.setBackgroundColor(8192)
- textW.write(" Green ")
- textW.setCursorPos(1,5)
- textW.setBackgroundColor(32)
- textW.write(" Lime ")
- textW.setCursorPos(1,6)
- textW.setBackgroundColor(16)
- textW.write(" Yellow ")
- textW.setCursorPos(1,7)
- textW.setBackgroundColor(8)
- textW.write(" Light Blue ")
- textW.setCursorPos(1,8)
- textW.setBackgroundColor(2048)
- textW.write(" Blue ")
- textW.setCursorPos(1,9)
- textW.setBackgroundColor(256)
- textW.write(" Light Gray ")
- textW.setCursorPos(1,10)
- textW.setBackgroundColor(128)
- textW.write(" Gray ")
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if event == "mouse_click" and x >= 26 and x <= 42 then
- if y == 8 then
- nastaveni=1
- elseif y == 9 then
- nastaveni=32768
- elseif y == 10 then
- nastaveni=16384
- elseif y == 11 then
- nastaveni=8192
- elseif y == 12 then
- nastaveni=32
- elseif y == 13 then
- nastaveni=16
- elseif y == 14 then
- nastaveni=8
- elseif y == 15 then
- nastaveni=2048
- elseif y == 16 then
- nastaveni=256
- elseif y == 17 then
- nastaveni=128
- end
- if adMode then sync() end
- local f=fs.open(userRegistry.."colors","w")
- f.writeLine(nastaveni)
- f.writeLine(BarTxt)
- f.close()
- Barvy()
- menu()
- else
- menu()
- end
- end
- end
- function sync()
- function zabalit(Zabal)
- local f=fs.open(Zabal,"r")
- sync_object=f.readAll()
- f.close()
- end
- if not (modemPos == "offline") then
- modem = peripheral.wrap(modemPos)
- modem.open(idPC)
- modem.transmit(tonumber(ADServer),554, idPC)
- modem.transmit(tonumber(ADServer),555, user) --sync plocha
- if fs.exists(userRegistry.."bar.nfp") then
- zabalit(userRegistry.."bar.nfp","r")
- modem.transmit(tonumber(ADServer),560, sync_object) --sync plocha
- end
- if fs.exists(userRegistry.."colors") then
- zabalit(userRegistry.."colors","r")
- modem.transmit(tonumber(ADServer),561, sync_object) --sync barva pozadi
- end
- else
- end
- end
- function RegistrySync(Reg, Regstatus)
- if not (modemPos == "offline") then
- modem = peripheral.wrap(modemPos)
- modem.open(idPC)
- modem.transmit(tonumber(ADServer),554, idPC)
- modem.transmit(tonumber(ADServer),555, user)
- modem.transmit(tonumber(ADServer),563, Reg)
- modem.transmit(tonumber(ADServer),564, Regstatus)
- end
- end
- function SolidCol()
- barW.setCursorPos(12,1)
- barW.write"Background Color"
- pcurs(2,2)
- txc(colors.black)
- pbgc(colors.white)
- pcurs(2, 2)
- pozadi.write "Choose the color of your background:"
- pbgc(colors.lightGray)
- pcurs(2, 4)
- pozadi.write " Black "
- pcurs(2, 6)
- pozadi.write " Brown "
- pcurs(2, 8)
- pozadi.write " Light gray "
- pcurs(2, 10)
- pozadi.write " Light blue "
- pcurs(2, 12)
- pozadi.write " Cyan "
- pbgc(colors.gray)
- end
- ------------------------------------------------------------------------------------------------------------------ menu
- function menu()
- readuser()
- plocha()
- if (page == "main") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- main()
- elseif (page == "account") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- account()
- elseif (page == "Oaccount") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- Oaccount()
- elseif (page == "network") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- network()
- elseif (page == "system") then
- flista("< System", "Display", "Sounds", "Recovery", "", "","")
- system()
- elseif (page == "Sounds") then
- flista("< System", "Display", "Sounds", "Recovery", "", "","")
- sounds()
- elseif (page == "recovery") then
- flista("< System", "Display", "Sounds", "Recovery", "", "","")
- recovery()
- elseif (page == "appearance") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- appearance()
- elseif (page == "SolidCol") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- SolidCol()
- elseif (page == "update") then
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- update()
- else
- flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
- pcurs(2,2)
- ptxc(colors.red)
- pbgc(colors.white)
- pozadi.write("Page not found")
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- else
- if (page == "appearance") then
- local function smazat()
- if fs.exists(userRegistry.."bar.nfp") then fs.delete(userRegistry.."bar.nfp") end
- if fs.exists(userRegistry..".BackgroundColor") then fs.delete(userRegistry..".BackgroundColor") end
- end
- if event == "mouse_click" and x >= 26 and x <= 42 and y == 6 then
- textBarva()
- if adMode then sync() end
- elseif event == "mouse_click" and x >= 35 and x <= 40 and y == 10 then
- if CCM == " No" then
- local f = fs.open(userRegistry..".menuColor","w")
- f.close()
- else
- fs.delete (userRegistry..".menuColor")
- end
- if adMode then if fs.exists(userRegistry..".menuColor") then RegistrySync(".menuColor", "true") else RegistrySync(".menuColor", "false") end end
- appearance()
- elseif event == "mouse_click" and x >= 35 and x <= 40 and y == 4 then
- if Eanim == "Yes" then
- local k = fs.open(userRegistry..".disableAnim","w")
- k.close()
- else
- fs.delete (userRegistry..".disableAnim")
- end
- appearance()
- elseif event == "mouse_click" and x >= 26 and x <= 42 and y == 8 then
- backBarva()
- if adMode then sync() end
- elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 14 then
- pcurs(2,12)
- pozadi.write" Solid Color "
- sleep(anim)
- smazat()
- page = "SolidCol"
- elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 16 then
- pcurs(2,14)
- pozadi.write" Castle "
- sleep(anim)
- smazat()
- downloading("C3MXEfYf", userRegistry.."bar.nfp")
- if adMode then sync() end
- elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 18 then
- pcurs(2,16)
- pozadi.write" Windows XP "
- sleep(anim)
- smazat()
- downloading("iy3EcA4Z", userRegistry.."bar.nfp")
- if adMode then sync() end
- elseif event == "mouse_click" and x >= 30 and x <= 42 and y == 14 then
- pcurs(18,12)
- pozadi.write" Pepdroll 7 "
- sleep(anim)
- smazat()
- downloading("ZQ8BBcVQ", userRegistry.."bar.nfp")
- if adMode then sync() end
- elseif event == "mouse_click" and x >= 30 and x <= 42 and y == 16 then
- pcurs(18,14)
- pozadi.write" Farm "
- sleep(anim)
- smazat()
- downloading("K0zXPiKn", userRegistry.."bar.nfp")
- if adMode then sync() end
- elseif event == "mouse_click" and x >= 30 and x <= 42 and y == 18 then
- pcurs(18,16)
- pbgc(colors.lightBlue)
- bgc(colors.lightBlue)
- pozadi.write" "
- pcurs(19,16)
- local kodB = read()
- sleep(anim)
- if not (kodB == "") then
- smazat()
- downloading(kodB, "/C/system/Users/"..user.."bar.nfp")
- if adMode then sync() end
- end
- end
- elseif (page == "SolidCol") then
- local function zapis(barva)
- local data = fs.open(userRegistry..".BackgroundColor", "w")
- data.writeLine(barva)
- data.close()
- end
- if event == "mouse_click" and x >= 14 and x <= 24 then
- if y == 6 then
- zapis("32768")
- pcurs(2, 4)
- pozadi.write " Black "
- elseif y == 8 then
- zapis("4096")
- pcurs(2, 6)
- pozadi.write " Brown "
- elseif y == 10 then
- zapis("256")
- pcurs(2, 8)
- pozadi.write " Light gray "
- elseif y == 12 then
- zapis("8")
- pcurs(2, 10)
- pozadi.write " Light blue "
- elseif y == 14 then
- zapis("512")
- pcurs(2, 12)
- pozadi.write " Cyan "
- end
- sleep(anim)
- page = "appearance"
- menu()
- end
- elseif (page == "account") then
- if event == "mouse_click" and x >= 26 and x <= 35 and y == 7 then
- pcurs(14,5)
- write (" ")
- pcurs(15,5)
- Fname = read()
- zapsat()
- menu()
- elseif event == "mouse_click" and x >= 26 and x <= 35 and y == 8 then
- pcurs(14,6)
- write (" ")
- pcurs(15,6)
- Lname = read()
- zapsat()
- menu()
- elseif event == "mouse_click" and x >= 31 and x <= 35 and y == 13 then
- pcurs(19,11)
- bgc(colors.gray)
- if stavlog == "Yes" then
- fs.delete("/C/system/.core/logon")
- else
- local f = fs.open("/C/system/.core/logon","w")
- f.writeLine(user)
- f.writeLine(pass)
- f.close()
- end
- menu()
- elseif event == "mouse_click" and x >= 14 and x <= 23 and y == 15 then
- bgc(colors.gray)
- pcurs(2,13)
- write (" Password ")
- sleep(anim)
- passWin()
- zapsat()
- menu()
- elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 17 then
- bgc(colors.gray)
- pcurs(2,15)
- write (" Other Users ")
- sleep(anim)
- page = "Oaccount"
- end
- elseif (page == "Oaccount") then
- if event == "mouse_click" and x >= 11 and x <= 20 and y == 2 then
- page = "account"
- elseif event == "mouse_click" and x >= 14 and x<= w-1 and y >= 6 and button == 1 then
- i = y-5
- if not (cUsr[i] == nil) then
- paintutils.drawLine(14, y, w-1, y, colors.lightGray)
- curs(15,y)
- write(cUsr[i])
- sleep(anim)
- UserWin(cUsr[i])
- end
- end
- elseif (page == "network") then
- if event == "mouse_click" and x >= 20 and x<= 28 and y == 5 and button == 1 then
- defmodem("top")
- network()
- elseif event == "mouse_click" and x >= 32 and x<= 40 and y == 5 and button == 1 then
- defmodem("back")
- network()
- elseif event == "mouse_click" and x >= 20 and x<= 28 and y == 7 and button == 1 then
- defmodem("left")
- network()
- elseif event == "mouse_click" and x >= 32 and x<= 40 and y == 7 and button == 1 then
- defmodem("bottom")
- network()
- elseif event == "mouse_click" and x >= 20 and x<= 28 and y == 9 and button == 1 then
- defmodem("right")
- network()
- elseif event == "mouse_click" and x >= 32 and x<= 40 and y == 9 and button == 1 then
- if fs.exists("/C/system/.core/defmodem") then
- fs.delete("/C/system/.core/defmodem")
- end
- network()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 12 and button == 1 then
- bgc(colors.lightBlue)
- pbgc(colors.lightBlue)
- pcurs(14,10)
- pozadi.write" "
- pcurs(15,10)
- local propojeni = read()
- os.setComputerLabel(propojeni)
- network()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 15 and AD and button == 1 then
- bgc(colors.lightBlue)
- pbgc(colors.lightBlue)
- pcurs(14,13)
- pozadi.write" "
- pcurs(15,13)
- adID = read()
- network()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 16 and AD and button == 1 then
- bgc(colors.lightBlue)
- pbgc(colors.lightBlue)
- pcurs(14,14)
- pozadi.write" "
- pcurs(15,14)
- prepisAD = true
- adUser = read()
- network()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 17 and AD and button == 1 then
- bgc(colors.lightBlue)
- pbgc(colors.lightBlue)
- pcurs(14,15)
- pozadi.write" "
- pcurs(15,15)
- prepisAD = true
- adPass = read(string.char(7))
- network()
- elseif event == "mouse_click" and x >= 32 and x<= 40 and y == h and button == 1 and not adMode and not (adUser == "" or adUser == nil) then
- pbgc(colors.gray)
- pcurs(ww/2+1,h-2)
- pozadi.write" Connect "
- sleep(0.1)
- pbgc(colors.white)
- if AD then
- modemC = peripheral.wrap(modemPos)
- dotaz()
- end
- adPass = ""
- network()
- elseif event == "mouse_click" and x >= 32 and x<= 43 and y == h and button == 1 and adMode and not (adUser == "" or adUser == nil) then
- pbgc(colors.gray)
- pcurs(ww/2+1,h-2)
- pozadi.write" Disconnect "
- disAD = true
- sleep(0.1)
- pbgc(colors.white)
- if AD then
- modemC = peripheral.wrap(modemPos)
- dotaz()
- end
- adPass = ""
- network()
- end
- elseif (page == "system") then
- local function setmonitor()
- if fs.exists("/C/system/.core/display") then
- fs.delete("/C/system/.core/display")
- end
- local f=fs.open("/C/system/.core/display","w")
- f.writeLine(monitor)
- f.close()
- sleep(0.1)
- local data = fs.open ("/C/system/RAM/displayreboot", "w")
- data.close ()
- bgc(colors.black)
- term.clear()
- song("hwin")
- os.reboot()
- end
- if event == "mouse_click" and x >= 42 and x <= 46 and y == 18 then
- if sItem == " No" then
- local f = fs.open(userRegistry..".showItem","w")
- f.close()
- else
- fs.delete (userRegistry..".showItem")
- end
- system()
- elseif event == "mouse_click" and x >= 42 and x <= 46 and y == 16 then
- if Ertime == " No" then
- local f = fs.open(userRegistry..".realTime","w")
- f.close()
- else
- fs.delete (userRegistry..".realTime")
- end
- system()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
- cbarva()
- lista.setCursorPos(1,3)--
- lista.write" < System "
- sleep(anim)
- page = "main"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 7 then
- cbarva()
- lista.setCursorPos(1,5)--
- lista.write" Display "
- sleep(anim)
- page = "system"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 9 then
- cbarva()
- lista.setCursorPos(1,7)--
- lista.write" Sounds "
- sleep(anim)
- page = "Sounds"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 11 then
- cbarva()
- lista.setCursorPos(1,9)--
- lista.write" Recovery "
- sleep(anim)
- page = "recovery"
- menu()
- end
- if event == "mouse_click" and x >= 19 and x <= 24 and y == 7 then
- pcurs(7,5)
- pozadi.write" Left "
- monitor = "left"
- sleep(anim)
- setmonitor()
- elseif x >= 26 and x <= 33 and y == 7 and button == 1 then
- pcurs(14,5)
- pozadi.write" Right "
- monitor = "right"
- sleep(anim)
- setmonitor()
- elseif x >= 34 and x <= 40 and y == 7 and button == 1 then
- pcurs(23,5)
- pozadi.write" Back "
- monitor = "back"
- sleep(anim)
- setmonitor()
- elseif event == "mouse_click" and x >= 19 and x <= 24 and y == 9 then
- pcurs(7,7)
- pozadi.write" Top "
- monitor = "top"
- sleep(anim)
- setmonitor()
- elseif x >= 26 and x <= 33 and y == 9 and button == 1 then
- pcurs(14,7)
- pozadi.write" Bottom "
- monitor = "bottom"
- sleep(anim)
- setmonitor()
- elseif x >= 34 and x <= 40 and y == 9 and button == 1 then
- pcurs(23,7)
- pozadi.write" Find "
- local names = {}
- local function filter(name)
- table.insert(names, name)
- monitor = name
- pbgc(colors.white)
- pcurs(7,9)
- pozadi.write("System finded: "..tostring(name))
- sleep(1)
- setmonitor()
- return true
- end
- peripheral.find("monitor", filter)
- elseif x >= 27 and x <= 38 and y == 12 and button == 1 then
- pcurs(15, 10)
- pbgc(colors.lightBlue)
- bgc(colors.lightBlue)
- pozadi.write" "
- pcurs(16, 10)
- monitor = read()
- setmonitor()
- elseif x >= 27 and x <= 38 and y == 14 and button == 1 then
- local data = fs.open ("/C/system/RAM/displayreboot", "w")
- data.close ()
- pcurs(15, 12)
- pozadi.write " Disconect "
- sleep(anim)
- if fs.exists("/C/system/.core/display") then
- fs.delete("/C/system/.core/display")
- end
- bgc(colors.black)
- term.clear()
- os.reboot()
- end
- elseif (page == "update") then
- if event == "mouse_click" and x >= 42 and x <= 46 and y == 4 then
- if Eupdate == "Yes" then
- local f = fs.open(systemRegistry..".disableUpdate","w")
- f.close()
- else
- fs.delete (systemRegistry..".disableUpdate")
- end
- update()
- elseif event == "mouse_click" and x >= 12 and x <= 46 and y == 6 then
- pcurs(2,4)
- pbgc(colors.gray)
- pozadi.write(" Update now ")
- sleep(anim)
- shell.run("/C/system/api/update.lua setting")
- update()
- end
- elseif (page == "Sounds") then
- if event == "mouse_click" and x >= 42 and x <= 46 and y == 4 then
- if Esound == "Yes" then
- local f = fs.open(userRegistry..".disableSound","w")
- f.close()
- else
- fs.delete (userRegistry..".disableSound")
- end
- sounds()
- end
- elseif (page == "recovery") then
- if event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
- cbarva()
- lista.setCursorPos(1,3)--
- lista.write" < System "
- sleep(anim)
- page = "main"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 7 then
- cbarva()
- lista.setCursorPos(1,5)--
- lista.write" Display "
- sleep(anim)
- page = "system"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 9 then
- cbarva()
- lista.setCursorPos(1,7)--
- lista.write" Recovery "
- sleep(anim)
- page = "recovery"
- menu()
- end
- if event == "mouse_click" and x >= 14 and x <= 34 and y == 8 then
- pcurs(2, 6)
- pozadi.write " Users and Settings "
- sleep(anim)
- fs.delete("/Users")
- fs.delete("/C/system/Users")
- fs.delete("/C/system/.core/ucet")
- if fs.exists ("/C/system/.core/defuser") then
- fs.delete("/C/system/.core/defuser")
- end
- os.reboot()
- elseif event == "mouse_click" and x >= 14 and x <= 34 and y == 10 then
- pcurs(2, 8)
- pozadi.write " Reinstall System "
- sleep(anim)
- if fs.exists("./setting") then
- fs.delete("./setting")
- end
- fs.delete("/C")
- os.reboot()
- --elseif event == "mouse_click" and x >= 14 and x <= 34 and y == 12 then
- --pcurs(2, 10)
- --pozadi.write " Partially reinstall "
- --sleep(anim)
- end
- end
- if event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
- cbarva()
- lista.setCursorPos(1,3)--
- lista.write" Dashboard "
- sleep(anim)
- page = "main"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 7 then
- cbarva()
- lista.setCursorPos(1,5)--
- lista.write" Accounts "
- sleep(anim)
- page = "account"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 9 then
- cbarva()
- lista.setCursorPos(1,7)--
- lista.write" Network "
- sleep(anim)
- page = "network"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 11 then
- cbarva()
- lista.setCursorPos(1,9)--
- lista.write" System "
- sleep(anim)
- page = "system"
- menu()
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 13 then
- if page ~= "Sounds" and page ~= "system" and page ~= "recovery" then
- cbarva()
- lista.setCursorPos(1,11)--
- lista.write" Appearance "
- sleep(anim)
- page = "appearance"
- menu()
- end
- elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 15 then
- if page ~= "Sounds" and page ~= "system" and page ~= "recovery" then
- cbarva()
- lista.setCursorPos(1,13)--
- lista.write" Update "
- sleep(anim)
- page = "update"
- menu()
- end
- end
- menu() -------- stejne jako nazev funkce
- end
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement