Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local verze = "20.0327.2"
- local w,h = term.getSize()
- local register = 0
- local login = 0
- local deleteusers = 0
- local nastaveni={barva=colors.blue}
- local cestaProgramu = ""
- local adUser = ""
- local adPass = ""
- local idPC = os.getComputerID()
- 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
- local f=fs.open("/C/system/RAM/user","r")
- user=f.readLine()
- f.close()
- if not fs.exists("/C/system/Users/"..user.."/colors") then
- shell.run ("pastebin get ECh4d3A4 /C/system/Users/"..user.."/colors")
- end
- local f=fs.open("/C/system/Users/"..user.."/colors","r")
- cnt=f.readAll()
- f.close()
- nastaveni=textutils.unserialize(cnt)
- if not fs.exists("/C/system/Users/"..user.."/textcol") then
- shell.run ("pastebin get 4JttBRbg /C/system/Users/"..user.."/textcol")
- end
- local f=fs.open("/C/system/Users/"..user.."/textcol","r")
- tnt=f.readAll()
- f.close()
- text=textutils.unserialize(tnt)
- if not fs.exists ("/C/system/.core/setting/Ikon.nft") then
- shell.run ("pastebin get RPyte0cc /C/system/.core/setting/Ikon.nft")
- end
- local propojeni = ""
- local function prc(text, y)
- local w = term.getSize()
- local _, cy = term.getCursorPos()
- term.setCursorPos(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- function start ()
- if fs.exists ("/C/system/RAM/setting/"..user.."/setdata") then
- local data = fs.open ("/C/system/RAM/setting/"..user.."/setdata", "r")
- local funkce = data.readLine ()
- data.close ()
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- resus ()
- else
- term.setBackgroundColor(colors.magenta)
- term.setTextColor(colors.white)
- term.clear ()
- local image = paintutils.loadImage("/C/system/.core/setting/Ikon.nft")
- paintutils.drawImage(image, w/2-7.5, h/2-6.5)
- prc ("Setting", h/2+8)
- -- o=fs.open ("/C/system/RAM/setting/"..user.."/setting", "r")
- -- user=o.readLine()
- -- passI=o.readLine()
- -- o.close()
- sleep (1)
- setupmenu ()
- end
- end
- function minimalizace ()
- if not fs.exists ("/C/system/.core/setting/mineditor") then
- shell.run ("pastebin get EiKMubhV /C/system/.core/setting/mineditor")
- minimalizace()
- end
- if fs.exists ("/C/system/RAM/setting/"..user.."/setdata") then
- fs.delete ("/C/system/RAM/setting/"..user.."/setdata")
- end
- local data = fs.open ("/C/system/RAM/setting/"..user.."/setdata", "w")
- data.writeLine(funkce)
- data.close ()
- local data = fs.open ("/C/system/RAM/"..user.."/prlists", "w")
- data.writeLine ("setting")
- data.close ()
- shell.exit ()
- shell.run ("/C/system/.core/setting/mineditor")
- end
- function ukonceni ()
- fs.delete ("/C/system/RAM/setting/"..user)
- shell.run("/C/system/api/closeApp")
- end
- function resus ()
- local data = fs.open ("/C/system/RAM/setting/"..user.."/setdata", "r")
- local funkce = data.readLine ()
- data.close ()
- local myFuncs = {
- ["label"] = function()
- network ()
- end,
- ["modem"] = function()
- network ()
- end,
- ["info"] = function()
- info ()
- end,
- ["display"] = function()
- display ()
- end,
- ["credits"] = function()
- credits ()
- end,
- ["diskinfo"] = function()
- disk ()
- end,
- ["startup"] = function()
- startup ()
- end,
- ["theme"] = function()
- theme ()
- end,
- ["tapety"] = function()
- tapety ()
- end,
- ["account"] = function()
- account ()
- end,
- ["deleteuser"] = function()
- account ()
- end,
- ["createuser"] = function()
- account ()
- end,
- ["logon"] = function()
- account ()
- end,
- ["password"] = function()
- account ()
- end,
- ["network"] = function()
- network ()
- end,
- ["updates"] = function()
- updates ()
- end,
- ["recovery"] = function()
- recovery ()
- end,
- ["update"] = function()
- update ()
- end,
- ["setprograms"] = function()
- setprograms ()
- end,
- ["language"] = function()
- language ()
- end,
- }
- myFuncs[funkce]()
- end
- function setupmenu ()
- term.setBackgroundColor(colors.white)
- term.clear()
- local myWindow = window.create(term.current(),16,1,37,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- if not fs.exists ("/C/system/.core/ikon/logo.nft") then
- shell.run("pastebin get u5hbXtBq /C/system/.core/ikon/logo.nft")
- setupmenu()
- end
- local image = paintutils.loadImage("/C/system/.core/ikon/logo.nft")
- paintutils.drawImage(image, 22, 5)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- myWindow.setCursorPos(20,17)
- write " Pepek"
- myWindow.setCursorPos(28,17)
- write "Soft "
- myWindow.setCursorPos(22,18)
- term.setTextColor(colors.black)
- write "2014-2020"
- myWindow.setCursorPos(27,17)
- myWindow.setTextColor(colors.lime)
- write "@"
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "Setting"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Info"
- term.setCursorPos(2,7)
- write "Accounts"
- term.setCursorPos(2,9)
- write "Network"
- term.setCursorPos(2,11)
- write "Language"
- term.setCursorPos(2,13)
- write "System"
- term.setCursorPos(2,15)
- write "Programs"
- term.setCursorPos(2,17)
- write "Themes"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 5 and button == 1 then
- info ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- account ()
- elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
- network ()
- elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
- language ()
- elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
- display ()
- elseif x >= 2 and x <= 16 and y == 15 and button == 1 then
- setprograms ()
- elseif x >= 2 and x <= 16 and y == 17 and button == 1 then
- theme ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- else
- setupmenu ()
- end
- end
- break
- end
- end
- end
- function label ()
- funkce = "label"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 9)
- write ("Set label: ")
- myWindow.setCursorPos(2, 11)
- write ("Label clear: ")
- term.setBackgroundColor(colors.lightGray)
- myWindow.setTextColor(colors.white)
- myWindow.setCursorPos(14, 9)
- write " "
- myWindow.setCursorPos(14, 9)
- if os.getComputerLabel() == nil then
- write "None"
- else
- write (os.getComputerLabel())
- end
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos(15, 11)
- write " Clear "
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 29 and x <= 39 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos(14, 9)
- write " "
- myWindow.setCursorPos(14, 9)
- propojeni = read ()
- os.setComputerLabel(propojeni)
- label ()
- elseif x >= 30 and x <= 37 and y == 11 and button == 1 then
- myWindow.setCursorPos(14, 9)
- shell.run ("label clear")
- label ()
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- modemS ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- label ()
- elseif event == "mouse_click" then
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- network ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- label ()
- end
- end
- end
- end
- end
- function defmodem(size)
- local dm = fs.open("/C/system/.core/defmodem","w")
- dm.writeLine(size)
- dm.close()
- end
- 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
- local c = fs.open ("/C/system/.core/AD", "w")
- c.writeLine(tostring(adID))
- c.close()
- plocha.setCursorPos(2,17)
- plocha.setTextColor(colors.green)
- plocha.write"Successfully connected!"
- sleep(0.5)
- restartovat()
- else
- plocha.setCursorPos(2,17)
- plocha.setTextColor(colors.red)
- plocha.write"Error, invalid login!"
- sleep(0.5)
- end
- end
- elseif event == "timer" then
- if p1 >= timerRX then
- plocha.setCursorPos(2,17)
- plocha.setTextColor(colors.red)
- if not odpoved then plocha.write"Error, server not found!" sleep(1) end
- modemS ()
- end
- end
- end
- end
- function dotaz()
- if not (adID == nil) then
- modemC.open(idPC)
- modemC.transmit(tonumber(adID),550,idPC)
- modemC.transmit(tonumber(adID),551,adUser)
- modemC.transmit(tonumber(adID),552,adPass)
- prijmout()
- end
- end
- function modemS ()
- funkce = "modem"
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- plocha = window.create(term.current(),17,1,w-16,h)
- plocha.setBackgroundColor(colors.white)
- plocha.clear()
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Network"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Modem"
- term.setCursorPos(2,7)
- write "Label"
- if fs.exists("/C/system/.core/defmodem") then
- s = fs.open("/C/system/.core/defmodem","r")
- modem = s.readLine()
- s.close()
- AD = true
- modemE = peripheral.wrap(modem)
- if not modemE then
- fs.delete("/C/system/.core/defmodem")
- modemS ()
- end
- else
- modem = "offline"
- AD = false
- end
- plocha.setTextColor(colors.black)
- plocha.setCursorPos(5,3)
- plocha.write"Choose your primary modem."
- if not (modem == "offline") then
- plocha.setCursorPos(2,11)
- plocha.write"If you already have an AD server,"
- plocha.setCursorPos(2,12)
- plocha.write" you can connect here."
- plocha.setCursorPos(2,14)
- plocha.write"Server ID:"
- plocha.setCursorPos(2,15)
- plocha.write"Admin user:"
- plocha.setCursorPos(2,16)
- plocha.write"Admin pass:"
- plocha.setBackgroundColor(colors.lightGray)
- plocha.setCursorPos(14,14)
- plocha.write" "
- if not (adID == nil) then plocha.setCursorPos(15,14) plocha.write(tostring(adID)) end
- plocha.setCursorPos(14,15)
- plocha.write" "
- if not (adUser == "") then plocha.setCursorPos(15,15) plocha.write(adUser) end
- plocha.setCursorPos(14,16)
- plocha.write" "
- if not (adPass == "") then plocha.setCursorPos(15,16) plocha.write("Password") end
- plocha.setBackgroundColor(colors.lightGray)
- ww = w-12
- plocha.setCursorPos(ww/2-5,h-1)
- plocha.write" Connect "
- end
- plocha.setBackgroundColor(colors.white)
- plocha.setTextColor(colors.black)
- plocha.setBackgroundColor(colors.lightGray)
- plocha.setCursorPos(8,5)
- if (modem == "top") then plocha.setBackgroundColor(colors.gray) else plocha.setBackgroundColor(colors.lightGray) end
- plocha.write" TOP "
- plocha.setCursorPos(8,7)
- if (modem == "left") then plocha.setBackgroundColor(colors.gray) else plocha.setBackgroundColor(colors.lightGray) end
- plocha.write" LEFT "
- plocha.setCursorPos(8,9)
- if (modem == "right") then plocha.setBackgroundColor(colors.gray) else plocha.setBackgroundColor(colors.lightGray) end
- plocha.write" RIGHT "
- plocha.setCursorPos(20,5)
- if (modem == "back") then plocha.setBackgroundColor(colors.gray) else plocha.setBackgroundColor(colors.lightGray) end
- plocha.write" BACK "
- plocha.setCursorPos(20,7)
- if (modem == "bottom") then plocha.setBackgroundColor(colors.gray) else plocha.setBackgroundColor(colors.lightGray) end
- plocha.write" BOTTOM "
- plocha.setCursorPos(20,9)
- if (modem == "offline") then plocha.setBackgroundColor(colors.gray) else plocha.setBackgroundColor(colors.lightGray) end
- plocha.write" OFFLINE "
- while true do
- event, button, x,y = os.pullEvent()
- if event == "mouse_click" and x >= 24 and x<= 32 and y == 5 and button == 1 then
- defmodem("top")
- modemS ()
- elseif event == "mouse_click" and x >= 36 and x<= 44 and y == 5 and button == 1 then
- defmodem("back")
- modemS ()
- elseif event == "mouse_click" and x >= 24 and x<= 32 and y == 7 and button == 1 then
- defmodem("left")
- modemS ()
- elseif event == "mouse_click" and x >= 36 and x<= 44 and y == 7 and button == 1 then
- defmodem("bottom")
- modemS ()
- elseif event == "mouse_click" and x >= 24 and x<= 32 and y == 9 and button == 1 then
- defmodem("right")
- modemS ()
- elseif event == "mouse_click" and x >= 36 and x<= 44 and y == 9 and button == 1 then
- if fs.exists("/C/system/.core/defmodem") then
- fs.delete("/C/system/.core/defmodem")
- end
- modemS ()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 14 and AD and button == 1 then
- term.setBackgroundColor(colors.lightBlue)
- plocha.setBackgroundColor(colors.lightBlue)
- plocha.setCursorPos(14,14)
- plocha.write" "
- plocha.setCursorPos(15,14)
- adID = read()
- modemS ()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 15 and AD and button == 1 then
- term.setBackgroundColor(colors.lightBlue)
- plocha.setBackgroundColor(colors.lightBlue)
- plocha.setCursorPos(14,15)
- plocha.write" "
- plocha.setCursorPos(15,15)
- adUser = read()
- modemS ()
- elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 16 and AD and button == 1 then
- term.setBackgroundColor(colors.lightBlue)
- plocha.setBackgroundColor(colors.lightBlue)
- plocha.setCursorPos(14,16)
- plocha.write" "
- plocha.setCursorPos(15,16)
- adPass = read("x")
- modemS()
- elseif event == "mouse_click" and x >= 30 and x<= 38 and y == h-1 and button == 1 then
- plocha.setBackgroundColor(colors.gray)
- plocha.setCursorPos(ww/2-5,h-1)
- plocha.write" Connect "
- sleep(0.1)
- plocha.setBackgroundColor(colors.white)
- if AD then
- modemC = peripheral.wrap(modem)
- dotaz()
- end
- modemS()
- elseif event == "mouse_click" and x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif event == "mouse_click" and x >= 2 and x <= 16 and y == 5 and button == 1 then
- modemS ()
- elseif event == "mouse_click" and x >= 2 and x <= 16 and y == 7 and button == 1 then
- label ()
- elseif (event == "mouse_click") then
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- network ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- modemS ()
- end
- end
- end
- end
- end
- local function prc(text, y)
- local w = term.getSize()
- local _, cy = term.getCursorPos()
- term.setCursorPos(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- function info ()
- funkce = "info"
- local myWindow = window.create(term.current(),16,1,37,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- write "< Info"
- term.setCursorPos(2,3)
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setTextColor(colors.blue)
- myWindow.setCursorPos(9, 18)
- write "Pepek@Soft"
- term.setTextColor(colors.black)
- myWindow.setCursorPos(20, 18)
- write "Software"
- myWindow.setTextColor(colors.lime)
- myWindow.setCursorPos(14, 18)
- write "@"
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 3)
- write ("Pepdroll Seven "..edice)
- myWindow.setCursorPos(2, 6)
- write " "
- myWindow.setCursorPos(2, 6)
- write ("Free disk space: "..(tonumber(fs.getFreeSpace("/")/1000)).." kB")
- myWindow.setCursorPos(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 = ""
- term.setBackgroundColor(colors.lightBlue)
- myWindow.setCursorPos(2, 8)
- term.write " " --33
- if (vypMis <24) then
- myWindow.setCursorPos(((33-vypMis)/2)+vypMis-2, 8)
- term.write((100-(math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10)).."% Free")
- elseif (vypMis <30) then
- myWindow.setCursorPos(((33-vypMis)/2)+vypMis, 8)
- write "Free"
- end
- for i=1,vypMis do
- misto = misto.." "
- end
- term.setBackgroundColor(colors.blue)
- myWindow.setCursorPos(2, 8)
- term.write(misto)
- myWindow.setTextColor(colors.black)
- if (vypMis > 7) then
- myWindow.setCursorPos(((vypMis)/2)-2, 8)
- term.write((math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10).."% Used")
- elseif (vypMis > 2) then
- myWindow.setCursorPos(((vypMis)/2)+1, 8)
- term.write((math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10).."%")
- end
- myWindow.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- internetcon = ""
- myWindow.setCursorPos(2, 13)
- if fs.exists ("/C/system/RAM/online") then
- myWindow.setTextColor(colors.black)
- internetcon = "Internet access"
- else
- myWindow.setTextColor(colors.red)
- internetcon = "No internet access"
- end
- myWindow.setCursorPos(12, 13)
- write (internetcon)
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 13)
- write ("Network : ")
- myWindow.setCursorPos(2, 14)
- if os.getComputerLabel() == nil then
- write ("Label : None")
- else
- write ("Label : "..(os.getComputerLabel()))
- end
- myWindow.setCursorPos(2, 15)
- write ("Comp. ID: "..(os.getComputerID()))
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Info"
- term.setTextColor(colors.white)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- credits ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- disk ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- info ()
- end
- end
- end
- end
- end
- function credits ()
- funkce = "credits"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setTextColor(colors.lime)
- myWindow.setCursorPos(2, 2)
- write "Pepek@Soft"
- term.setTextColor(colors.black)
- myWindow.setCursorPos(13, 2)
- write "Programs"
- myWindow.setTextColor(colors.blue)
- myWindow.setCursorPos(7, 2)
- write "@"
- myWindow.setTextColor(colors.black)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- credits ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- disk ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- info ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- credits ()
- end
- end
- end
- end
- end
- function disk ()
- funkce = "diskinfo"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 9)
- write ("Free Space: "..fs.getFreeSpace("/").." KB")
- if fs.exists ("disk/") then
- write ("Free Space: "..fs.getFreeSpace("disk/").." KB")
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- credits ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- disk ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- info ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- disk ()
- end
- end
- end
- end
- end
- function theme ()
- funkce = "theme"
- if funkces == nil then
- local f=fs.open("/C/system/Users/"..user.."/colors","r")
- local cnt=f.readAll()
- f.close()
- local nastaveni=textutils.unserialize(cnt)
- local f=fs.open("/C/system/Users/"..user.."/textcol","r")
- local tnt=f.readAll()
- f.close()
- local text=textutils.unserialize(tnt)
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Info"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Colors"
- term.setCursorPos(2,7)
- write "Background"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Theme"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- end
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- term.setCursorPos(19,6)
- term.setTextColor(colors.black)
- write "Change background color."
- term.setCursorPos(19,13)
- write "Change text color."
- term.setCursorPos(30,8)
- write "W"
- term.setCursorPos(30,15)
- write "W"
- paintutils.drawPixel(20, 8, colors.orange)
- paintutils.drawPixel(22, 8, colors.magenta)
- paintutils.drawPixel(24, 8, colors.yellow)
- paintutils.drawPixel(26, 8, colors.cyan)
- paintutils.drawPixel(28, 8, colors.purple)
- paintutils.drawPixel(20, 10, colors.blue)
- paintutils.drawPixel(22, 10, colors.brown)
- paintutils.drawPixel(24, 10, colors.green)
- paintutils.drawPixel(26, 10, colors.red)
- paintutils.drawPixel(28, 10, colors.black)
- paintutils.drawPixel(30, 10, colors.gray)
- paintutils.drawPixel(20, 15, colors.orange)
- paintutils.drawPixel(22, 15, colors.magenta)
- paintutils.drawPixel(24, 15, colors.yellow)
- paintutils.drawPixel(26, 15, colors.cyan)
- paintutils.drawPixel(28, 15, colors.purple)
- paintutils.drawPixel(20, 17, colors.blue)
- paintutils.drawPixel(22, 17, colors.brown)
- paintutils.drawPixel(24, 17, colors.green)
- paintutils.drawPixel(26, 17, colors.red)
- paintutils.drawPixel(28, 17, colors.black)
- paintutils.drawPixel(30, 17, colors.gray)
- paintutils.drawPixel(35, 8, nastaveni.barva)
- paintutils.drawPixel(36, 8, nastaveni.barva)
- paintutils.drawPixel(37, 8, nastaveni.barva)
- paintutils.drawPixel(35, 9, nastaveni.barva)
- paintutils.drawPixel(36, 9, nastaveni.barva)
- paintutils.drawPixel(37, 9, nastaveni.barva)
- paintutils.drawPixel(35, 10, nastaveni.barva)
- paintutils.drawPixel(36, 10, nastaveni.barva)
- paintutils.drawPixel(37, 10, nastaveni.barva)
- paintutils.drawPixel(38, 8, nastaveni.barva)
- paintutils.drawPixel(38, 9, nastaveni.barva)
- paintutils.drawPixel(38, 10, nastaveni.barva)
- term.setCursorPos (35,9)
- term.setTextColor(text.barva)
- write "Text"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(44, 16)
- write " Apply "
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 20 and y == 8 and button == 1 then
- local novaBarva= "orange"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 22 and y == 8 and button == 1 then
- local novaBarva= "magenta"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 30 and y == 8 and button == 1 then
- local novaBarva= "white"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 24 and y == 8 and button == 1 then
- local novaBarva= "yellow"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 26 and y == 8 and button == 1 then
- local novaBarva= "cyan"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 28 and y == 8 and button == 1 then
- local novaBarva= "purple"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 20 and y == 10 and button == 1 then
- local novaBarva= "blue"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 22 and y == 10 and button == 1 then
- local novaBarva= "brown"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 24 and y == 10 and button == 1 then
- local novaBarva= "green"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 26 and y == 10 and button == 1 then
- local novaBarva= "red"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 28 and y == 10 and button == 1 then
- local novaBarva= "black"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 30 and y == 10 and button == 1 then
- local novaBarva= "gray"
- if colors[novaBarva:lower()] then
- nastaveni.barva=colors[novaBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 20 and y == 15 and button == 1 then
- local textBarva= "orange"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 22 and y == 15 and button == 1 then
- local textBarva= "magenta"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 24 and y == 15 and button == 1 then
- local textBarva= "yellow"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 26 and y == 15 and button == 1 then
- local textBarva= "cyan"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 28 and y == 15 and button == 1 then
- local textBarva= "purple"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 20 and y == 17 and button == 1 then
- local textBarva= "blue"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 22 and y == 17 and button == 1 then
- local textBarva= "brown"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 24 and y == 17 and button == 1 then
- local textBarva= "green"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 26 and y == 17 and button == 1 then
- local textBarva= "red"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 30 and y == 15 and button == 1 then
- local textBarva= "white"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 30 and y == 17 and button == 1 then
- local textBarva= "gray"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x == 28 and y == 17 and button == 1 then
- local textBarva= "black"
- if colors[textBarva:lower()] then
- text.barva=colors[textBarva:lower()]
- end
- funkces = 1
- theme ()
- elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
- local f=fs.open("/C/system/Users/"..user.."/colors","w") --#otevrit soubor
- f.write(textutils.serialize(nastaveni)) --#zapsat tabulku jako text a ten ulozit
- f.close()
- local nastaveni={barva=colors.blue}
- local f=fs.open("/C/system/Users/"..user.."/textcol","w") --#otevrit soubor
- f.write(textutils.serialize(text)) --#zapsat tabulku jako text a ten ulozit
- f.close()
- local text={barva=colors.white}
- funkces = nil
- theme ()
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- funkces = nil
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- funkces = nil
- theme ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- funkces = nil
- tapety ()
- else
- funkces = nil
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- theme ()
- end
- end
- end
- end
- end
- function tapety ()
- funkce = "tapety"
- tap1 = "- Background clear"
- tap2 = "- Pepdroll"
- tap3 = "- Farm"
- tap4 = "- Windows XP"
- tap5 = "- Castle"
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Info"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Colors"
- term.setCursorPos(2,7)
- write "Background"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Theme"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setCursorPos(2,6)
- term.setTextColor(colors.black)
- write "Change background image."
- myWindow.setCursorPos(2, 8)
- write (tap1)
- myWindow.setCursorPos(2, 10)
- write (tap2)
- myWindow.setCursorPos(2, 12)
- write (tap3)
- myWindow.setCursorPos(2, 14)
- write (tap4)
- myWindow.setCursorPos(2, 16)
- write (tap5)
- myWindow.setCursorPos(2, 18)
- write "Pastebin code: "
- term.setBackgroundColor(colors.lightGray)
- write " "
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 33 and x <= 42 and y == 18 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos(33, 18)
- write " "
- term.setCursorPos(34, 18)
- backcode = read()
- --if backcode == "" then
- --tapety()
- --end
- if fs.exists("/C/system/Users/"..user.."/bar.nfp") then
- fs.delete("/C/system/Users/"..user.."/bar.nfp")
- end
- shell.run("pastebin get "..backcode.." /C/system/Users/"..user.."/bar.nfp")
- tapety()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- theme ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- theme ()
- elseif x >= 16 and x <= 35 and y == 8 and button == 1 then
- myWindow.setCursorPos(2, 8)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- write (tap1)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos(2, 1)
- fs.delete("/C/system/Users/"..user.."/bar.nfp")
- sleep(0.1)
- tapety ()
- elseif x >= 16 and x <= 35 and y == 10 and button == 1 then
- myWindow.setCursorPos(2, 10)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- write (tap2)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos(2, 1)
- shell.run(" delete /C/system/Users/"..user.."/bar.nfp")
- myWindow.setCursorPos(2, 1)
- shell.run("pastebin get ZQ8BBcVQ /C/system/Users/"..user.."/bar.nfp")
- sleep(0.1)
- tapety ()
- elseif x >= 16 and x <= 35 and y == 12 and button == 1 then
- myWindow.setCursorPos(2, 12)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- write (tap3)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos(2, 1)
- shell.run(" delete /C/system/Users/"..user.."/bar.nfp")
- myWindow.setCursorPos(2, 1)
- shell.run("pastebin get K0zXPiKn /C/system/Users/"..user.."/bar.nfp")
- sleep(0.1)
- tapety ()
- elseif x >= 16 and x <= 35 and y == 14 and button == 1 then
- myWindow.setCursorPos(2, 14)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- write (tap4)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos(2, 1)
- shell.run(" delete /C/system/Users/"..user.."/bar.nfp")
- myWindow.setCursorPos(2, 1)
- shell.run("pastebin get iy3EcA4Z /C/system/Users/"..user.."/bar.nfp")
- sleep(0.1)
- tapety ()
- elseif x >= 16 and x <= 35 and y == 16 and button == 1 then
- myWindow.setCursorPos(2, 16)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- write (tap5)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos(2, 1)
- shell.run(" delete /C/system/Users/"..user.."/bar.nfp")
- myWindow.setCursorPos(2, 1)
- shell.run("pastebin get C3MXEfYf /C/system/Users/"..user.."/bar.nfp")
- sleep(0.1)
- tapety ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- tapety ()
- end
- end
- end
- end
- end
- function account ()
- funkce = "account"
- defuser = user
- local myWindow = window.create(term.current(),16,1,37,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Accounts"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Password"
- term.setCursorPos(2,7)
- write "Login"
- term.setCursorPos(2,9)
- write "New user"
- term.setCursorPos(2,11)
- write "Delete users"
- term.setCursorPos(2,13)
- write "Log out"
- -- if fs.exists ("/C/system/RAM/setting/"..user.."/setdata")then
- -- local data = fs.open ("/C/system/RAM/setting/"..user.."/setdata", "r")
- -- funkce = data.readLine ()
- -- data.close ()
- -- end
- if funkce == "password" then
- password ()
- elseif funkce == logon then
- login ()
- elseif funkce == "createuser" then
- createuser ()
- elseif funkce == "deleteuser" then
- deleteuser ()
- end
- logon ()
- end
- function deleteuser ()
- funkce = "deleteuser"
- function dele ()
- term.setCursorPos (20, 13)
- term.setTextColor(colors.lime)
- write "User is deleted!"
- sleep (1)
- fs.delete ("/C/system/Users/"..deluser)
- deleteusers = 0
- deleteuser ()
- end
- function defuserdel ()
- if defuser == deluser then
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "User is a default!"
- sleep (1)
- local myWindow = window.create(term.current(),19,10,21,5)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),18,9,21,5)
- myWindow.setBackgroundColor(colors.yellow)
- myWindow.clear()
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,2)
- write "Do you want change"
- myWindow.setCursorPos (2,3)
- write "default user now ?"
- myWindow.setCursorPos (2,5)
- write "Yes No"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 19 and x <= 21 and y == 13 and button == 1 then
- logon ()
- else
- deleteusers = 1
- deleteuser ()
- end
- end
- else
- dele ()
- end
- end
- function resetnow ()
- local myWindow = window.create(term.current(),19,10,21,5)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),18,9,21,5)
- myWindow.setBackgroundColor(colors.yellow)
- myWindow.clear()
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,2)
- write "Do you want "
- myWindow.setCursorPos (2,3)
- write "restart now ? "
- myWindow.setCursorPos (2,5)
- write "Yes No"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 19 and x <= 21 and y == 13 and button == 1 then
- restart ()
- else
- deleteusers = 1
- deleteuser ()
- end
- end
- end
- if deleteusers == 0 then
- deluser = ""
- end
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- myWindow.setCursorPos (2,3)
- write "Delete an account"
- term.setTextColor(colors.black)
- myWindow.setCursorPos(2, 5)
- write "User name:"
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- myWindow.setCursorPos(30, 16)
- write " Apply "
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos(13, 5)
- write " "
- term.setCursorPos(29, 5)
- write (deluser)
- myWindow.setCursorPos(35,9)
- write "<"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 29 and x <= 44 and y == 5 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(29, 5)
- write " "
- term.setCursorPos(29, 5)
- deluser = read ()
- deleteusers = 1
- deleteuser ()
- elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
- term.setBackgroundColor(colors.white)
- if fs.exists ("/C/system/RAM/setting/"..user.."/"..deluser) then
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "You must restart computer"
- sleep (1)
- resetnow ()
- end
- if fs.exists ("/C/system/Users/"..deluser) then
- if fs.exists ("/C/system/.core/defuser") then
- data = fs.open ("/C/system/.core/defuser", "r")
- defuser = data.readLine ()
- defuserdel ()
- else
- dele ()
- end
- else
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "User is not found!"
- sleep (1)
- deleteusers = 1
- deleteuser ()
- end
- elseif x == 51 and y == 9 and button == 1 then
- local myWindow = window.create(term.current(),1,17,51,3)
- myWindow.setBackgroundColor(colors.yellow)
- myWindow.clear()
- term.setCursorPos(1,17)
- shell.run ("ls /C/system/Users/")
- while true do
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- local myWindow = window.create(term.current(),1,17,15,3)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),17,17,40,3)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel(16, 17, colors.gray)
- paintutils.drawPixel(16, 18, colors.gray)
- paintutils.drawPixel(16, 19, colors.gray)
- deleteuser ()
- end
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- password ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- logon ()
- elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
- createuser ()
- elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
- deleteuser ()
- elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
- odhlasit ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- account ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- deleteuser ()
- end
- end
- end
- end
- end
- function createuser ()
- funkce = "createuser"
- if register == 0 then
- newuser = ""
- newpass = ""
- newpas = ""
- end
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- myWindow.setCursorPos (2,3)
- term.setTextColor(colors.blue)
- term.setBackgroundColor(colors.white)
- write "Create a new account"
- term.setTextColor(colors.black)
- myWindow.setCursorPos(2, 5)
- write "User name:"
- myWindow.setCursorPos(2, 7)
- write " Password:"
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- myWindow.setCursorPos(30, 16)
- write " Apply "
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos(13, 5)
- write " "
- myWindow.setCursorPos(13, 5)
- write (newuser)
- myWindow.setCursorPos(13, 7)
- write " "
- myWindow.setCursorPos(13, 7)
- write (newpas)
- myWindow.setCursorPos(35,9)
- write "<"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 29 and x <= 44 and y == 5 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(29, 5)
- write " "
- term.setCursorPos(29, 5)
- newuser = read ()
- register = 1
- createuser ()
- elseif x >= 29 and x <= 44 and y == 7 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(29, 7)
- write " "
- term.setCursorPos(29, 7)
- newpass= read ("@")
- newpas = "Password"
- register = 1
- createuser ()
- elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
- term.setBackgroundColor(colors.white)
- if not fs.exists ("/C/system/Users/"..newuser) then
- file = fs.open ("/C/system/Users/"..newuser.."/.data", "w")
- file.writeLine(newuser)
- file.writeLine(newpass)
- file.close ()
- term.setCursorPos(17,13)
- shell.run ("pastebin get ZQ8BBcVQ ", "/C/system/Users/"..newuser.."/bar.nfp")
- term.setCursorPos(17,13)
- shell.run ("pastebin get 2Rg15U0q ", "/C/system/Users/"..newuser.."/user")
- local myWindow = window.create(term.current(),17,13,34,3)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear ()
- term.setCursorPos(20,14)
- term.setTextColor(colors.lime)
- write "Complete"
- register = 0
- local myWindow = window.create(term.current(),1,14,15,2)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- paintutils.drawPixel(16, 14, colors.gray)
- paintutils.drawPixel(16, 15, colors.gray)
- sleep (1)
- createuser ()
- else
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "User is exists"
- sleep (1)
- register = 1
- createuser ()
- end
- elseif x == 51 and y == 9 and button == 1 then
- local myWindow = window.create(term.current(),1,17,51,3)
- myWindow.setBackgroundColor(colors.yellow)
- myWindow.clear()
- term.setCursorPos(1,17)
- shell.run ("ls /C/system/Users/")
- while true do
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- local myWindow = window.create(term.current(),1,17,15,3)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),17,17,40,3)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel(16, 17, colors.gray)
- paintutils.drawPixel(16, 18, colors.gray)
- paintutils.drawPixel(16, 19, colors.gray)
- createuser ()
- end
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- password ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- logon ()
- elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
- createuser ()
- elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
- deleteuser ()
- elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
- odhlasit ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- account ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- createuser ()
- end
- end
- end
- end
- end
- function logon ()
- funkce = "logon"
- defuser = user
- function apply ()
- term.setBackgroundColor(colors.white)
- data = fs.open("/C/system/.core/defuser","w")
- data.writeLine(defuser)
- data.close()
- term.setCursorPos (20, 13)
- term.setTextColor(colors.lime)
- write "Successeful!"
- sleep (1)
- logon ()
- end
- local data = fs.open("/C/system/.core/defuser","r")
- defuser = data.readLine ()
- data.close ()
- local n=fs.open("/C/system/.core/logon.cfg","r")
- preskoclog = n.readLine ()
- n.close ()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setTextColor(colors.blue)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (2,3)
- write "Setting a login"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(22, 9)
- write ("You must log")
- term.setCursorPos(20, 16)
- write ("If you want skip login,")
- term.setCursorPos(20, 17)
- write ("default user will ")
- term.setCursorPos(38, 17)
- term.setBackgroundColor(colors.lightGray)
- write (defuser)
- myWindow.setCursorPos(35,9)
- write "<"
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(37,9)
- if preskoclog == "1" then
- stavlog = "No"
- else
- stavlog = "Yes"
- end
- term.setTextColor(colors.white)
- write (" "..stavlog.." ")
- if stavlog == "Yes" then
- paintutils.drawPixel (37, 9, colors.lime)
- elseif stavlog == "No" then
- paintutils.drawPixel (43, 9, colors.red)
- paintutils.drawPixel (37, 9, colors.lightGray)
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 37 and x <= 43 and y == 17 and button == 1 then
- term.setCursorPos(38, 17)
- term.setBackgroundColor(colors.gray)
- write " "
- term.setCursorPos(38, 17)
- defus = read ()
- if fs.exists ("/C/system/Users/"..defus) then
- defuser = defus
- apply ()
- else
- term.setBackgroundColor(colors.white)
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "User not found!"
- sleep (1)
- logon ()
- end
- end
- if x >= 37 and x <= 43 and y == 9 and button == 1 then
- if preskoclog == "1" then
- preskoclog = "0"
- elseif preskoclog == "0" then
- preskoclog = "1"
- end
- local n=fs.open("/C/system/.core/logon.cfg","w")
- n.writeLine(preskoclog)
- n.close()
- logon ()
- elseif x == 51 and y == 9 and button == 1 then
- local myWindow = window.create(term.current(),1,17,51,3)
- myWindow.setBackgroundColor(colors.yellow)
- myWindow.clear()
- term.setCursorPos(1,17)
- shell.run ("ls /C/system/Users/")
- while true do
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- local myWindow = window.create(term.current(),1,17,15,3)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),17,17,40,3)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel(16, 17, colors.gray)
- paintutils.drawPixel(16, 18, colors.gray)
- paintutils.drawPixel(16, 19, colors.gray)
- logon ()
- end
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- password ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- logon ()
- elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
- createuser ()
- elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
- deleteuser ()
- elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
- odhlasit ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- account ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- logon ()
- end
- end
- end
- end
- end
- function password ()
- funkce = "password"
- if login == 1 then
- else
- passold = ""
- passoldp = ""
- pass1 = ""
- pass1p = ""
- pass2 = ""
- pass2p = ""
- end
- local n=fs.open("/C/system/.core/logon.cfg","r")
- preskoclog = n.readLine ()
- n.close ()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- myWindow.setCursorPos (2,3)
- write "Change your password"
- term.setTextColor(colors.black)
- myWindow.setCursorPos(2, 5)
- write "Your old password:"
- myWindow.setCursorPos(2, 7)
- write "Your new password:"
- myWindow.setCursorPos(3, 9)
- write "Confirm password:"
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- myWindow.setCursorPos(30, 16)
- write " Apply "
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos(21, 5)
- write " "
- myWindow.setCursorPos(21, 5)
- write (passoldp)
- myWindow.setCursorPos(21, 7)
- write " "
- myWindow.setCursorPos(21, 7)
- write (pass1p)
- myWindow.setCursorPos(21, 9)
- write " "
- myWindow.setCursorPos(21, 9)
- if pass2 == pass1 then
- term.setTextColor(colors.lime)
- write "Valid"
- else
- term.setTextColor(colors.red)
- write "Invalid"
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 37 and x <= 50 and y == 5 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(37, 5)
- write " "
- term.setCursorPos(37, 5)
- term.setTextColor(colors.white)
- passold = read ("@")
- passoldp = "Old Password"
- login = 1
- password ()
- elseif x >= 37 and x <= 50 and y == 7 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(37, 7)
- write " "
- term.setCursorPos(37, 7)
- term.setTextColor(colors.white)
- pass1 = read ("@")
- pass1p = "New Password"
- login = 1
- password ()
- elseif x >= 37 and x <= 50 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(37, 9)
- write " "
- term.setCursorPos(37, 9)
- term.setTextColor(colors.white)
- pass2 = read ("@")
- password ()
- elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
- o=fs.open ("/C/system/Users/"..user.."/.data", "r")
- user=o.readLine()
- passI=o.readLine()
- o.close()
- term.setBackgroundColor(colors.white)
- if passold == passI then
- if pass1 == pass2 then
- term.setCursorPos (20, 13)
- term.setTextColor(colors.lime)
- data = fs.open("/C/system/Users/"..user.."/.data","w")
- data.writeLine(user)
- data.writeLine(pass1)
- data.close()
- write "Your accound has been changed."
- login = 0
- sleep (1)
- password ()
- else
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "Invalid confirm password!"
- login = 1
- sleep (1)
- password ()
- end
- else
- term.setCursorPos (20, 13)
- term.setTextColor(colors.red)
- write "Invalid old password!"
- sleep (1)
- login = 1
- password ()
- end
- elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
- login = 0
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- login = 0
- password ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- login = 0
- logon ()
- elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
- createuser ()
- elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
- deleteuser ()
- elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
- odhlasit ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- login = 0
- ukonceni ()
- elseif x == w-1 and y == 1 then
- login = 0
- account ()
- elseif x == w-2 and y == 1 then
- login = 1
- minimalizace ()
- else
- login = 1
- password ()
- end
- end
- end
- end
- end
- function network ()
- funkce = "network"
- if not fs.exists ("/C/system/.core/network.nfp") then
- shell.run("pastebin get 8zkYBLPE /C/system/.core/network.nfp")
- network()
- end
- local image = paintutils.loadImage("/C/system/.core/network.nfp")
- paintutils.drawImage(image, 17, 1)
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Network"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Modem"
- term.setCursorPos(2,7)
- write "Label"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- modemS ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- label ()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- if fs.exists ("/C/system/RAM/setting/"..user.."/setdata")then
- local data = fs.open ("/C/system/RAM/setting/"..user.."/setdata", "r")
- funkce = data.readLine ()
- data.close ()
- end
- if funkce == "network" then
- modemS ()
- elseif funkce == "network" then
- label ()
- end
- network ()
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- else
- network ()
- end
- end
- end
- end
- end
- function language ()
- funkce = "language"
- local myWindow = window.create(term.current(),16,1,37,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Language"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Account"
- term.setCursorPos(2,7)
- write "Primary"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- fs.delete ("/C/system/RAM/setting/"..user.."/jazyk1")
- shell.run ("pastebin get uVRBmFvy /C/system/RAM/"..user.."/jazyk1")
- shell.run ("/C/system/RAM/setting/"..user.."/jazyk1")
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- fs.delete ("/C/system/RAM/setting/"..user.."/jazyk2")
- shell.run ("pastebin get uVRBmFvy /C/system/RAM/"..user.."/jazyk2")
- shell.run ("/C/system/RAM/setting/"..user.."/jazyk2")
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- language ()
- end
- end
- end
- end
- end
- function updates ()
- funkce = "updates"
- local myWindow = window.create(term.current(),16,1,37,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< System"
- term.setTextColor(text.barva)
- term.setCursorPos(2,6)
- write "Update's"
- term.setCursorPos(2,8)
- write "Monitor's"
- term.setCursorPos(2,10)
- write "Recovery"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y >= 3 and y <= 4 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 6 and button == 1 then
- update ()
- elseif x >= 2 and x <= 16 and y == 8 and button == 1 then
- display()
- elseif x >= 2 and x <= 16 and y == 10 and button == 1 then
- recovery()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- updates ()
- end
- end
- end
- end
- end
- function update ()
- funkce = "updates"
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- if not fs.exists ("/C/system/.core/update") then
- data = fs.open ("/C/system/.core/update", "w")
- data.writeLine ("0")
- data.close ()
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,5)
- write "Update"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 6 and button == 1 then
- update ()
- elseif x >= 2 and x <= 16 and y == 8 and button == 1 then
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- updates ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- update ()
- end
- end
- end
- end
- end
- end
- function display ()
- funkce = "display"
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< System"
- term.setTextColor(text.barva)
- term.setCursorPos(2,6)
- write "Update's"
- term.setCursorPos(2,8)
- write "Monitor's"
- term.setCursorPos(2,10)
- write "Recovery"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 3)
- write "Connecting the monitor"
- myWindow.setCursorPos(2, 14)
- write"No monitor:"
- myWindow.setCursorPos(2, 5)
- write "Where is the monitor located?"
- myWindow.setCursorPos(7, 7)
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- write " Left Right Back "
- myWindow.setCursorPos(7, 9)
- write " Top Bottom "
- paintutils.drawPixel (29,7, colors.white)
- paintutils.drawPixel (29,9, colors.white)
- paintutils.drawPixel (38,7, colors.white)
- myWindow.setCursorPos(2, 12)
- myWindow.setTextColor(colors.black)
- write"User define: "
- term.setBackgroundColor(colors.lightGray)
- write" "
- term.setTextColor(colors.white)
- myWindow.setCursorPos(15, 14)
- write " Disconect "
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y >= 3 and y <= 4 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 6 and button == 1 then
- update ()
- elseif x >= 2 and x <= 16 and y == 8 and button == 1 then
- display()
- elseif x >= 2 and x <= 16 and y == 10 and button == 1 then
- recovery()
- elseif x >= 23 and x <= 28 and y == 7 and button == 1 then
- term.setCursorPos(23,7)
- write" Left "
- monitor = "left"
- setmonitor()
- elseif x >= 30 and x <= 37 and y == 7 and button == 1 then
- term.setCursorPos(30,7)
- write" Right "
- monitor = "right"
- setmonitor()
- elseif x >= 31 and x <= 43 and y == 12 and button == 1 then
- term.setCursorPos(31,12)
- write" "
- term.setCursorPos(32,12)
- monitor = read()
- setmonitor()
- elseif x >= 31 and x <= 41 and y == 14 and button == 1 then
- local data = fs.open ("/C/system/RAM/displayreboot", "w")
- data.close ()
- term.setCursorPos(31,14)
- write" Disconect "
- if fs.exists("/C/system/.core/display") then
- fs.delete("/C/system/.core/display")
- end
- term.setBackgroundColor(colors.black)
- term.clear()
- os.reboot()
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- display ()
- end
- end
- end
- end
- end
- function recovery()
- funkce = "recovery"
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< System"
- term.setTextColor(text.barva)
- term.setCursorPos(2,6)
- write "Update's"
- term.setCursorPos(2,8)
- write "Monitor's"
- term.setCursorPos(2,10)
- write "Recovery"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(17,1)
- write " "
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos(2, 3)
- term.write "Select what to recover:"
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- myWindow.setCursorPos(2, 5)
- term.write " - Users and Settings "
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y >= 3 and y <= 4 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 6 and button == 1 then
- update ()
- elseif x >= 2 and x <= 16 and y == 8 and button == 1 then
- display()
- elseif x >= 2 and x <= 16 and y == 10 and button == 1 then
- recovery()
- elseif x >= 18 and x <= 39 and y == 5 and button == 1 then
- term.setBackgroundColor(colors.lightBlue)
- myWindow.setCursorPos(2, 5)
- term.write " - Users and Settings "
- sleep(0.1)
- fs.delete("/Users")
- fs.delete("/C/system/Users")
- if fs.exists ("/C/system/.core/defuser") then
- fs.delete("/C/system/.core/defuser")
- end
- local f=fs.open("/C/system/ducet","w")
- f.close()
- restartovat()
- else
- myWindow.setTextColor(colors.white)
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- recovery ()
- end
- end
- end
- end
- end
- 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 ()
- term.setBackgroundColor(colors.black)
- term.clear()
- os.reboot()
- end
- function startup ()
- funkce = "startup"
- local function zapsat()
- local f=fs.open("/C/system/Users/"..user.."/startupProgram","w")
- f.writeLine (cestaProgramu)
- f.close()
- startup()
- end
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Startup"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Menu"
- term.setCursorPos(2,7)
- write "Startup"
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos(3,5)
- write("Start the program after startup")
- myWindow.setCursorPos(3,7)
- write("Run:")
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- term.setCursorPos(37,7)
- write(" ")
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(43, 16)
- write " Restart "
- term.setCursorPos(43, 18)
- write " Log Out "
- if fs.exists("/C/system/Users/"..user.."/startupProgram") then
- if fs.exists("/C/system/Users/"..user.."/startupProgram") then
- local f=fs.open("/C/system/Users/"..user.."/startupProgram","r")
- afterstart=f.readLine()
- f.close()
- else
- afterstart= ""
- end
- paintutils.drawPixel (37, 7, colors.lime)
- paintutils.drawPixel (42, 7, colors.lightGray)
- spustitProgram = "ano"
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- myWindow.setCursorPos(3,11)
- write(" ")
- myWindow.setCursorPos(4,11)
- write(afterstart)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos(3,10)
- write("Path:")
- else
- paintutils.drawPixel (42, 7, colors.red)
- paintutils.drawPixel (37, 7, colors.lightGray)
- spustitProgram = "ne"
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- setprograms ()
- elseif x >= 43 and x <= 51 and y == 16 and button == 1 then
- restartovat()
- elseif x >= 43 and x <= 51 and y == 18 and button == 1 then
- logout()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- startup ()
- elseif x >= 19 and x <= 49 and y == 11 and spustitProgram == "ano" and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- myWindow.setCursorPos(3,11)
- write(" ")
- myWindow.setCursorPos(4,11)
- cestaProgramu = read()
- if fs.exists (cestaProgramu) then
- zapsat()
- else
- cestaProgramu1 = cestaProgramu
- cestaProgramu = ("/C/Programs/"..cestaProgramu)
- if fs.exists (cestaProgramu) then
- zapsat()
- else
- cestaProgramu = ("/C/Programs/pepeksoft/"..cestaProgramu1)
- end
- if fs.exists (cestaProgramu) then
- zapsat()
- else
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.red)
- myWindow.setCursorPos(3,12)
- write("The program could not be found.")
- cestaProgramu = ""
- sleep(0.5)
- end
- end
- startup()
- elseif x >= 37 and x <= 42 and y == 7 and button == 1 then
- if fs.exists("/C/system/Users/"..user.."/startupProgram") then
- fs.delete("/C/system/Users/"..user.."/startupProgram")
- else
- local f=fs.open("/C/system/Users/"..user.."/startupProgram","w")
- f.close()
- end
- startup()
- else
- term.setTextColor(text.barva)
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- setupmenu ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- startup ()
- end
- end
- end
- end
- end
- function setprograms ()
- funkce = "setprograms"
- function apply ()
- data = fs.open ("/C/system/Users/"..user.."/lsprogram", "w")
- data.writeLine(nmenu1)
- data.writeLine(npath1)
- data.writeLine(nmenu2)
- data.writeLine(npath2)
- data.writeLine(nmenu3)
- data.writeLine(npath3)
- data.writeLine(nmenu4)
- data.writeLine(npath4)
- data.writeLine(nmenu5)
- data.writeLine(npath5)
- data.writeLine(nmenu6)
- data.writeLine(npath6)
- data.writeLine(nmenu7)
- data.writeLine(npath7)
- data.close ()
- if ok == "0" then
- term.setCursorPos (26, 13)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.lime)
- write "Successfull"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos (31,14)
- write "OK"
- else
- term.setCursorPos (26, 17)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.lime)
- write "Successfull"
- ok = "0"
- end
- sleep (0.5)
- setprograms ()
- end
- local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "r")
- menu1 = data.readLine ()
- path1 = data.readLine ()
- menu2 = data.readLine ()
- path2 = data.readLine ()
- menu3 = data.readLine ()
- path3 = data.readLine ()
- menu4 = data.readLine ()
- path4 = data.readLine ()
- menu5 = data.readLine ()
- path5 = data.readLine ()
- menu6 = data.readLine ()
- path6 = data.readLine ()
- menu7 = data.readLine ()
- path7 = data.readLine ()
- data.close()
- nmenu1 = menu1
- npath1 = path1
- nmenu2 = menu2
- npath2 = path2
- nmenu3 = menu3
- npath3 = path3
- nmenu4 = menu4
- npath4 = path4
- nmenu5 = menu5
- npath5 = path5
- nmenu6 = menu6
- npath6 = path6
- nmenu7 = menu7
- npath7 = path7
- term.setBackgroundColor(nastaveni.barva)
- term.setCursorPos(1,1)
- write " "
- paintutils.drawPixel(16, 1, colors.gray)
- local myWindow = window.create(term.current(),17,1,w-16,h)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (4,3)
- write "1.position"
- myWindow.setCursorPos (4,5)
- write "2.position"
- myWindow.setCursorPos (4,7)
- write "3.position"
- myWindow.setCursorPos (4,9)
- write "4.position"
- myWindow.setCursorPos (4,11)
- write "5.position"
- myWindow.setCursorPos (4,13)
- write "6.position"
- myWindow.setCursorPos (4,15)
- write "7.position"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (16,3)
- write " "
- myWindow.setCursorPos (16,5)
- write " "
- myWindow.setCursorPos (16,7)
- write " "
- myWindow.setCursorPos (16,9)
- write " "
- myWindow.setCursorPos (16,11)
- write " "
- myWindow.setCursorPos (16,13)
- write " "
- myWindow.setCursorPos (16,15)
- write " "
- myWindow.setCursorPos (17,3)
- write (nmenu1)
- myWindow.setCursorPos (17,5)
- write (nmenu2)
- myWindow.setCursorPos (17,7)
- write (nmenu3)
- myWindow.setCursorPos (17,9)
- write (nmenu4)
- myWindow.setCursorPos (17,11)
- write (nmenu5)
- myWindow.setCursorPos (17,13)
- write (nmenu6)
- myWindow.setCursorPos (17,15)
- write (nmenu7)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- myWindow.setCursorPos (30,3)
- write "*"
- myWindow.setCursorPos (30,5)
- write "*"
- myWindow.setCursorPos (30,7)
- write "*"
- myWindow.setCursorPos (30,9)
- write "*"
- myWindow.setCursorPos (30,11)
- write "*"
- myWindow.setCursorPos (30,13)
- write "*"
- myWindow.setCursorPos (30,15)
- write "*"
- local myWindow = window.create(term.current(),1,1,16,h)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),1,1,15,h)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- term.setBackgroundColor (nastaveni.barva)
- term.setTextColor(colors.lime)
- term.setCursorPos(2,3)
- write "< Programs"
- term.setTextColor(text.barva)
- term.setCursorPos(2,5)
- write "Menu"
- term.setCursorPos(2,7)
- write "Startup"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 2 and x <= 16 and y == 3 and button == 1 then
- setupmenu ()
- elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
- setprograms ()
- elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
- startup ()
- elseif x == 46 and y == 3 and button == 1 then
- nmenu1 = ""
- npath1 = ""
- ok = "1"
- apply ()
- elseif x == 46 and y == 5 and button == 1 then
- nmenu2 = ""
- npath2 = ""
- ok = "1"
- apply ()
- elseif x == 46 and y == 7 and button == 1 then
- nmenu3 = ""
- npath3 = ""
- ok = "1"
- apply ()
- elseif x == 46 and y == 9 and button == 1 then
- nmenu4 = ""
- npath4 = ""
- ok = "1"
- apply ()
- elseif x == 46 and y == 11 and button == 1 then
- nmenu5 = ""
- npath5 = ""
- ok = "1"
- apply ()
- elseif x == 46 and y == 13 and button == 1 then
- nmenu6 = ""
- npath6 = ""
- ok = "1"
- apply ()
- elseif x == 46 and y == 15 and button == 1 then
- nmenu7 = ""
- npath7 = ""
- ok = "1"
- apply ()
- elseif x >= 32 and x <= 45 and y == 3 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,3)
- write " "
- term.setCursorPos (33,3)
- write (nmenu1)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "1. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu1)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path1)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu1 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath1 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 32 and x <= 45 and y == 5 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,5)
- write " "
- term.setCursorPos (33,5)
- write (nmenu2)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "2. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu2)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path2)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu2 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath2 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 32 and x <= 45 and y == 7 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,7)
- write " "
- term.setCursorPos (33,7)
- write (nmenu3)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "3. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu3)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path3)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu3 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath3 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 32 and x <= 45 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,9)
- write " "
- term.setCursorPos (33,9)
- write (nmenu4)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "4. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu4)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path4)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu4 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath4 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 32 and x <= 45 and y == 11 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,11)
- write " "
- term.setCursorPos (33,11)
- write (nmenu5)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "5. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu5)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path5)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu5 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath5 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 32 and x <= 45 and y == 13 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,13)
- write " "
- term.setCursorPos (33,13)
- write (nmenu6)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "6. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu6)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path6)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu6 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath6 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 32 and x <= 45 and y == 15 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (32,15)
- write " "
- term.setCursorPos (33,15)
- write (nmenu7)
- sleep(0.1)
- local myWindow = window.create(term.current(),22,7,22,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),21,6,22,10)
- myWindow.setBackgroundColor(colors.lime)
- myWindow.clear()
- local myWindow = window.create(term.current(),22,7,20,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (42,6, colors.red)
- term.setCursorPos(42,6)
- write "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (6,1)
- write "7. Posion"
- myWindow.setCursorPos (2,3)
- write "Name"
- myWindow.setCursorPos (2,5)
- write "Path:"
- myWindow.setCursorPos (10,8)
- write "OK"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- write (menu7)
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- write (path7)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 23 and x <= 40 and y == 10 and button == 1 then
- myWindow.setCursorPos (2,4)
- write " "
- myWindow.setCursorPos (2,4)
- nmenu7 = read ()
- elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
- myWindow.setCursorPos (2,6)
- write " "
- myWindow.setCursorPos (2,6)
- npath7 = read ()
- elseif x == 42 and y == 6 and button == 1 then
- setprograms ()
- elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
- apply ()
- end
- end
- else
- paintutils.drawLine(1, 1, w, 1, colors.black)
- paintutils.drawPixel (w,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (w,1)
- write "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (w-1,1)
- write "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (w-2,1)
- write "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == w and y == 1 then
- ukonceni ()
- elseif x == w-1 and y == 1 then
- apps ()
- elseif x == w-2 and y == 1 then
- minimalizace ()
- else
- setprograms ()
- end
- end
- end
- end
- end
- function odhlasit ()
- local data = fs.delete ("/C/system/RAM")
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- sleep (0.1)
- term.setBackgroundColor(colors.gray)
- term.clear()
- sleep (0.1)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(23, 7)
- prc "Logging out..."
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.setCursorPos(20,18)
- write " Pepek"
- term.setCursorPos(28,18)
- write "Soft "
- term.setCursorPos(27,18)
- term.setTextColor(colors.lime)
- write "@"
- sleep (1)
- local data = fs.open ("/C/system/RAM/logout", "w")
- data.close ()
- shell.run("/startup.lua")
- end
- function restartovat()
- os.reboot()
- end
- start ()
Add Comment
Please, Sign In to add comment