Advertisement
pepeknamornik

Setting 0.8.2

Feb 20th, 2015
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 89.83 KB | None | 0 0
  1. local w,h = term.getSize()
  2. local fgc = term.setTextColor
  3. local bgc = term.setBackgroundColor
  4. local register = 0
  5. local login = 0
  6. local deleteusers = 0
  7. local nastaveni={barva=colors.blue}
  8. local f=fs.open("system/.core/colors","r")
  9. local cnt=f.readAll()
  10. f.close()
  11. local nastaveni=textutils.unserialize(cnt)
  12. local f=fs.open("system/.core/textcol","r")
  13. local tnt=f.readAll()
  14. f.close()
  15.  
  16. if not fs.exists ("/system/local/programs/setdata/Ikon.nft") then
  17.     shell.run ("pastebin get RPyte0cc /system/local/programs/setdata/Ikon.nft")
  18.     end
  19.    
  20. local text=textutils.unserialize(tnt)
  21. local propojeni = ""
  22.  
  23.  
  24.  
  25. local function prc(text, y)
  26.   local w = term.getSize()
  27.   local _, cy = term.getCursorPos()
  28.   term.setCursorPos(math.ceil((w-#text)/2), y or cy)
  29.   write(text)
  30. end
  31.  
  32. function start ()
  33.     if fs.exists ("/system/RAM/setdata") then
  34.         local data = fs.open ("/system/RAM/setdata", "r")
  35.         local funkce = data.readLine ()
  36.         data.close ()
  37.         local myWindow = window.create(term.current(),1,1,16,19)
  38.     myWindow.setBackgroundColor(colors.gray)
  39.     myWindow.clear()
  40.         resus ()
  41.     else
  42.     term.setBackgroundColor(colors.magenta)
  43.     term.setTextColor(colors.white)
  44.     term.clear ()
  45.     local image = paintutils.loadImage("/system/local/programs/setdata/Ikon.nft")
  46.     paintutils.drawImage(image, 18, 4)
  47.     prc ("Setting", 16)
  48.     o=fs.open ("/system/RAM/setting", "r")
  49.     user=o.readLine()
  50.     passI=o.readLine()
  51.     o.close()
  52.     sleep (1)
  53. setupmenu ()
  54. end
  55. end
  56.  
  57. function minimalizace ()
  58.     if fs.exists ("/system/RAM/setdata") then
  59.     fs.delete ("/system/RAM/setdata")
  60.     end
  61.    
  62.     local data = fs.open ("/system/RAM/setdata", "w")
  63.     data.writeLine(funkce)
  64.     data.close ()
  65.     local data = fs.open ("/system/RAM/prlists", "w")
  66.         data.writeLine ("setting")
  67.         data.close ()
  68.     shell.exit ()
  69.     shell.run ("/system/api/mineditor")
  70. end
  71.  
  72. function ukonceni ()
  73.     fs.delete ("/system/RAM/setdata")
  74.     shell.run ("/system/desktop")
  75. end
  76.  
  77. function resus ()
  78.  
  79. local data = fs.open ("/system/RAM/setdata", "r")
  80.         local funkce = data.readLine ()
  81.         data.close ()
  82.        
  83.     local myFuncs = {
  84.         ["label"] = function()
  85.         network ()
  86.         end,
  87.        
  88.         ["modem"] = function()
  89.         network ()
  90.         end,
  91.        
  92.         ["info"] = function()
  93.         info ()
  94.         end,
  95.        
  96.         ["credits"] = function()
  97.          credits ()
  98.         end,
  99.        
  100.         ["diskinfo"] = function()
  101.          disk ()
  102.         end,
  103.        
  104.         ["theme"] = function()
  105.          theme ()
  106.         end,
  107.        
  108.         ["tapety"] = function()
  109.          tapety ()
  110.         end,
  111.        
  112.         ["account"] = function()
  113.          account ()
  114.         end,
  115.        
  116.         ["deleteuser"] = function()
  117.          account ()
  118.         end,
  119.        
  120.         ["createuser"] = function()
  121.          account ()
  122.         end,
  123.        
  124.         ["logon"] = function()
  125.          account ()
  126.         end,
  127.        
  128.         ["password"] = function()
  129.         account ()
  130.         end,
  131.        
  132.         ["network"] = function()
  133.          network ()
  134.         end,
  135.        
  136.         ["updates"] = function()
  137.          updates ()
  138.         end,
  139.        
  140.         ["update"] = function()
  141.          update ()
  142.         end,
  143.        
  144.         ["apps"] = function()
  145.          apps ()
  146.         end,
  147.        
  148.         ["setprograms"] = function()
  149.          apps ()
  150.         end,
  151.        
  152.         ["downloader"] = function()
  153.          downloader ()
  154.         end,
  155.        
  156.         ["language"] = function()
  157.          language ()
  158.         end,
  159. }
  160.  
  161. myFuncs[funkce]()
  162. end
  163.  
  164. function setupmenu ()
  165.     local myWindow = window.create(term.current(),16,1,37,19)
  166.     myWindow.setBackgroundColor(colors.white)
  167.     myWindow.clear()
  168.     local image = paintutils.loadImage("/system/.core/ikon/logo.nft")
  169.     paintutils.drawImage(image, 22, 5)
  170.     term.setBackgroundColor(colors.white)
  171.     term.setTextColor(colors.blue)
  172.     myWindow.setCursorPos(20,17)
  173.     print"  Pepek"
  174.     myWindow.setCursorPos(28,17)
  175.     print"Soft  "
  176.     myWindow.setCursorPos(22,18)
  177.     term.setTextColor(colors.black)
  178.     print"2014-2016"
  179.     myWindow.setCursorPos(27,17)
  180.     myWindow.setTextColor(colors.lime)
  181.     print"@"
  182.     local myWindow = window.create(term.current(),1,1,16,19)
  183.     myWindow.setBackgroundColor(colors.gray)
  184.     myWindow.clear()
  185.     local myWindow = window.create(term.current(),1,1,15,19)
  186.     myWindow.setBackgroundColor(nastaveni.barva)
  187.     myWindow.clear()
  188.     term.setBackgroundColor (nastaveni.barva)
  189.     term.setTextColor(colors.lime)
  190.     term.setCursorPos(2,3)
  191.     print "Setting"
  192.     term.setTextColor(text.barva)
  193.     term.setCursorPos(2,5)
  194.     print "Info"
  195.     term.setCursorPos(2,7)
  196.     print "Accounts"
  197.     term.setCursorPos(2,9)
  198.     print "Network"
  199.     term.setCursorPos(2,11)
  200.     print "Language"
  201.     term.setCursorPos(2,13)
  202.     print "System"
  203.     term.setCursorPos(2,15)
  204.     print "Programs"
  205.     term.setCursorPos(2,17)
  206.     print "Themes"
  207.    
  208.       while true do
  209.     local event, button, x, y = os.pullEvent("mouse_click")
  210.     xy = x..","..y
  211.      
  212.     if x >= 2 and x <= 16 and y == 5 and button == 1 then
  213.     info ()
  214.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  215.     account ()
  216.     elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
  217.     network ()
  218.     elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
  219.     language ()
  220.     elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
  221.     updates ()
  222.     elseif x >= 2 and x <= 16 and y == 15 and button == 1 then
  223.     apps ()
  224.     elseif x >= 2 and x <= 16 and y == 17 and button == 1 then
  225.     theme ()
  226.     else
  227.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  228.     paintutils.drawPixel (51,1, colors.red)
  229.     term.setCursorPos (51,1)
  230.     print "*"
  231.              while true do
  232.         local event, button, x, y = os.pullEvent("mouse_click")
  233.         xy = x..","..y
  234.        
  235.         if x == 51 and y == 1 then
  236.             ukonceni ()
  237.         else
  238.         setupmenu ()
  239.             end
  240.             end
  241.     break
  242.     end
  243.     end
  244. end
  245.  
  246. function label ()
  247. funkce = "label"
  248.         local myWindow = window.create(term.current(),17,1,37,19)
  249.     myWindow.setBackgroundColor(colors.white)
  250.     myWindow.clear()
  251.     term.setBackgroundColor(nastaveni.barva)
  252.        term.setCursorPos(1,1)
  253.        print "               "
  254.        paintutils.drawPixel(16, 1, colors.gray)
  255.        term.setBackgroundColor(colors.white)
  256.        term.setCursorPos(17,1)
  257.        print "                                   "
  258.      myWindow.setTextColor(colors.black)
  259.     myWindow.setCursorPos(2, 9)
  260.     print("Set label: ")
  261.     myWindow.setCursorPos(2, 11)
  262.     print("Label clear: ")
  263.     term.setBackgroundColor(colors.lightGray)
  264.     myWindow.setTextColor(colors.white)
  265.     myWindow.setCursorPos(14, 9)
  266.     print "          "
  267.     myWindow.setCursorPos(14, 9)
  268.     if os.getComputerLabel() == nil then
  269.         print "None"
  270.         else
  271.     print(os.getComputerLabel())
  272.     end
  273.     term.setBackgroundColor(colors.gray)
  274.     myWindow.setCursorPos(15, 11)
  275.     print " Clear "
  276.    
  277.    
  278.         while true do
  279.         local event, button, x, y = os.pullEvent("mouse_click")
  280.         xy = x..","..y
  281.    
  282.     if x >= 29 and x <= 39 and y == 9 and button == 1 then
  283.         term.setBackgroundColor(colors.gray)
  284.         myWindow.setCursorPos(14, 9)
  285.         print "          "
  286.         myWindow.setCursorPos(14, 9)
  287.         propojeni = read ()
  288.         os.setComputerLabel(propojeni)
  289.         label ()
  290.     elseif x >= 30 and x <= 37 and y == 11 and button == 1 then
  291.         myWindow.setCursorPos(14, 9)
  292.         shell.run ("label clear")
  293.         label ()
  294.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  295.     setupmenu ()
  296.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  297.     modem ()
  298.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  299.     label ()
  300.     else
  301.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  302.     paintutils.drawPixel (51,1, colors.red)
  303.     term.setTextColor(colors.white)
  304.     term.setCursorPos (51,1)
  305.     print "*"
  306.     paintutils.drawPixel (50,1, colors.lightGray)
  307.     term.setCursorPos (50,1)
  308.     print "<"
  309.     paintutils.drawPixel (49,1, colors.lightGray)
  310.         term.setCursorPos (49,1)
  311.         print "_"
  312.  
  313.              while true do
  314.         local event, button, x, y = os.pullEvent("mouse_click")
  315.         xy = x..","..y
  316.        
  317.         if x == 51 and y == 1 then
  318.             ukonceni ()
  319.         elseif x == 50 and y == 1 then
  320.             network ()
  321.         elseif x == 49 and y == 1 then
  322.             minimalizace ()
  323.         else
  324.         label ()
  325.             end
  326.             end
  327. end
  328. end
  329. end
  330.  
  331. function modem ()
  332.     funkce = "modem"
  333.     term.setBackgroundColor(nastaveni.barva)
  334.        term.setCursorPos(1,1)
  335.        print "               "
  336.        paintutils.drawPixel(16, 1, colors.gray)
  337.     local myWindow = window.create(term.current(),17,1,37,19)
  338.     myWindow.setBackgroundColor(colors.white)
  339.     myWindow.clear()
  340.         if not fs.exists ("/system/.core/modem") then
  341.         back = "0"
  342.         left = "0"
  343.         right = "0"
  344.         top = "1"
  345.         bottom = "0"
  346.         else
  347.     data = fs.open ("/system/.core/modem", "r")
  348.         back = data.readLine ()
  349.         left = data.readLine ()
  350.         right = data.readLine ()
  351.         top = data.readLine ()
  352.         bottom = data.readLine ()
  353.         data.close ()
  354.         end
  355.        
  356.     if back == "1" then
  357. local function openRednet()
  358.   for _,side in ipairs({"back"}) do
  359.         if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
  360.           rednet.open(side)
  361.           return side
  362.         end
  363.   end
  364.   back = "0"
  365. end
  366.  
  367. modemSide = openRednet()
  368. if modemSide == nil then
  369.   back = "0"
  370. else
  371.   print("Opened modem on "..modemSide)
  372. end
  373.     end
  374.    
  375.     if left == "1" then
  376. local function openRednet()
  377.   for _,side in ipairs({"left"}) do
  378.         if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
  379.           rednet.open(side)
  380.           return side
  381.         end
  382.   end
  383.   left = "0"
  384. end
  385.  
  386. modemSide = openRednet()
  387. if modemSide == nil then
  388.   left = "0"
  389. else
  390.   print("Opened modem on "..modemSide)
  391. end
  392.     end
  393.    
  394.     if right == "1" then
  395. local function openRednet()
  396.   for _,side in ipairs({"right"}) do
  397.         if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
  398.           rednet.open(side)
  399.           return side
  400.         end
  401.   end
  402.   right = "0"
  403. end
  404.  
  405. modemSide = openRednet()
  406. if modemSide == nil then
  407.   right = "0"
  408. else
  409.   print("Opened modem on "..modemSide)
  410. end
  411.  
  412.     end
  413.    
  414.     if top == "1" then
  415. local function openRednet()
  416.   for _,side in ipairs({"top"}) do
  417.         if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
  418.           rednet.open(side)
  419.           return side
  420.         end
  421.   end
  422.   top = "0"
  423. end
  424.  
  425. modemSide = openRednet()
  426. if modemSide == nil then
  427.   top = "0"
  428. else
  429.   print("Opened modem on "..modemSide)
  430. end
  431.  
  432.     end
  433.    
  434.     if bottom == "1" then
  435. local function openRednet()
  436.   for _,side in ipairs({"bottom"}) do
  437.         if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
  438.           rednet.open(side)
  439.           return side
  440.         end
  441.   end
  442.   bottom = "0"
  443. end
  444.  
  445. modemSide = openRednet()
  446. if modemSide == nil then
  447.   bottom = "0"
  448. else
  449.   print("Opened modem on "..modemSide)
  450. end
  451.  
  452.     end
  453.    
  454. term.setBackgroundColor(colors.white)
  455.     term.setTextColor(colors.blue)
  456.     myWindow.setCursorPos (2,2)
  457.     print "Modem connection"
  458.     term.setCursorPos(22, 7)
  459.     term.setTextColor(colors.black)
  460.     print ("Back")
  461.     term.setCursorPos(37, 7)
  462.          if back == "0" then
  463.         stavback = "No"
  464.         else
  465.         stavback = "Yes"
  466.         end
  467.        
  468.         term.setBackgroundColor(colors.lightGray)
  469.         term.setTextColor(colors.white)
  470.     print ("  "..stavback.."  ")
  471.         if stavback == "Yes" then
  472.             paintutils.drawPixel (37, 7, colors.lime)
  473.         elseif stavback == "No" then
  474.             paintutils.drawPixel (43, 7, colors.red)
  475.             paintutils.drawPixel (37, 7, colors.lightGray)
  476.        end
  477.        term.setBackgroundColor(colors.white)
  478.        term.setTextColor(colors.black)
  479.        term.setCursorPos(22, 9)
  480.     print ("Left")
  481.     term.setCursorPos(37, 9)
  482.          if left == "0" then
  483.         stavleft = "No"
  484.         else
  485.         stavleft = "Yes"
  486.         end
  487.        
  488.         term.setBackgroundColor(colors.lightGray)
  489.         term.setTextColor(colors.white)
  490.     print ("  "..stavleft.."  ")
  491.         if stavleft == "Yes" then
  492.             paintutils.drawPixel (37, 9, colors.lime)
  493.         elseif stavleft == "No" then
  494.             paintutils.drawPixel (43, 9, colors.red)
  495.             paintutils.drawPixel (37, 9, colors.lightGray)
  496.        end
  497.        term.setBackgroundColor(colors.white)
  498.        term.setTextColor(colors.black)
  499.        term.setCursorPos(22, 11)
  500.     print ("Right")
  501.     term.setCursorPos(37, 11)
  502.          if right == "0" then
  503.         stavright = "No"
  504.         else
  505.         stavright = "Yes"
  506.         end
  507.        
  508.         term.setBackgroundColor(colors.lightGray)
  509.         term.setTextColor(colors.white)
  510.     print ("  "..stavright.."  ")
  511.         if stavright == "Yes" then
  512.             paintutils.drawPixel (37, 11, colors.lime)
  513.         elseif stavright == "No" then
  514.             paintutils.drawPixel (43, 11, colors.red)
  515.             paintutils.drawPixel (37, 11, colors.lightGray)
  516.        end
  517.        term.setBackgroundColor(colors.white)
  518.        term.setTextColor(colors.black)
  519.        term.setCursorPos(22, 13)
  520.     print ("Top")
  521.     term.setCursorPos(37, 13)
  522.          if top == "0" then
  523.         stavtop = "No"
  524.         else
  525.         stavtop = "Yes"
  526.         end
  527.        
  528.         term.setBackgroundColor(colors.lightGray)
  529.         term.setTextColor(colors.white)
  530.     print ("  "..stavtop.."  ")
  531.         if stavtop == "Yes" then
  532.             paintutils.drawPixel (37, 13, colors.lime)
  533.         elseif stavtop == "No" then
  534.             paintutils.drawPixel (43, 13, colors.red)
  535.             paintutils.drawPixel (37, 13, colors.lightGray)
  536.        end
  537.        term.setBackgroundColor(colors.white)
  538.        term.setTextColor(colors.black)
  539.        term.setCursorPos(22, 15)
  540.     print ("Bottom")
  541.     term.setCursorPos(37, 15)
  542.          if bottom == "0" then
  543.         stavbottom = "No"
  544.         else
  545.         stavbottom = "Yes"
  546.         end
  547.        
  548.         term.setBackgroundColor(colors.lightGray)
  549.         term.setTextColor(colors.white)
  550.     print ("  "..stavbottom.."  ")
  551.         if stavbottom == "Yes" then
  552.             paintutils.drawPixel (37, 15, colors.lime)
  553.         elseif stavbottom == "No" then
  554.             paintutils.drawPixel (43, 15, colors.red)
  555.             paintutils.drawPixel (37, 15, colors.lightGray)
  556.        end
  557.     local myWindow = window.create(term.current(),1,1,16,19)
  558.     myWindow.setBackgroundColor(colors.gray)
  559.     myWindow.clear()
  560.     local myWindow = window.create(term.current(),1,1,15,19)
  561.     myWindow.setBackgroundColor(nastaveni.barva)
  562.     myWindow.clear()
  563.     term.setBackgroundColor (nastaveni.barva)
  564.     term.setTextColor(colors.lime)
  565.     term.setCursorPos(2,3)
  566.     print "< Network"
  567.     term.setTextColor(text.barva)
  568.     term.setCursorPos(2,5)
  569.     print "Modem"
  570.     term.setCursorPos(2,7)
  571.     print "Label"  
  572.    
  573.     while true do
  574.         local event, button, x, y = os.pullEvent("mouse_click")
  575.         xy = x..","..y
  576.  
  577.     if x >= 37 and x <= 43 and y == 7 and button == 1 then
  578.     if back == "1" then
  579.     back = "0"
  580.     rednet.close ("back")
  581.     elseif back == "0" then
  582.     back = "1"
  583.     end
  584.            data = fs.open ("/system/.core/modem", "w")
  585.            data.writeLine (back)
  586.            data.writeLine (left)
  587.            data.writeLine (right)
  588.            data.writeLine (top)
  589.            data.writeLine (bottom)
  590.            data.close ()
  591.         modem ()
  592.     elseif x >= 37 and x <= 43 and y == 9 and button == 1 then
  593.     if left == "1" then
  594.     left = "0"
  595.     rednet.close ("left")
  596.     elseif left == "0" then
  597.     left = "1"
  598.     end
  599.            data = fs.open ("/system/.core/modem", "w")
  600.            data.writeLine (back)
  601.            data.writeLine (left)
  602.            data.writeLine (right)
  603.            data.writeLine (top)
  604.            data.writeLine (bottom)
  605.            data.close ()
  606.         modem ()
  607.     elseif x >= 37 and x <= 43 and y == 11 and button == 1 then
  608.     if right == "1" then
  609.     right = "0"
  610.     rednet.close ("right")
  611.     elseif right == "0" then
  612.     right = "1"
  613.     end
  614.            data = fs.open ("/system/.core/modem", "w")
  615.            data.writeLine (back)
  616.            data.writeLine (left)
  617.            data.writeLine (right)
  618.            data.writeLine (top)
  619.            data.writeLine (bottom)
  620.            data.close ()
  621.         modem ()
  622.     elseif x >= 37 and x <= 43 and y == 13 and button == 1 then
  623.     if top == "1" then
  624.     top = "0"
  625.     rednet.close ("top")
  626.     elseif top == "0" then
  627.     top = "1"
  628.     end
  629.            data = fs.open ("/system/.core/modem", "w")
  630.            data.writeLine (back)
  631.            data.writeLine (left)
  632.            data.writeLine (right)
  633.            data.writeLine (top)
  634.            data.writeLine (bottom)
  635.            data.close ()
  636.         modem ()
  637.     elseif x >= 37 and x <= 43 and y == 15 and button == 1 then
  638.     if bottom == "1" then
  639.     bottom = "0"
  640.     rednet.close ("bottom")
  641.     elseif bottom == "0" then
  642.     bottom = "1"
  643.     end
  644.            data = fs.open ("/system/.core/modem", "w")
  645.            data.writeLine (back)
  646.            data.writeLine (left)
  647.            data.writeLine (right)
  648.            data.writeLine (top)
  649.            data.writeLine (bottom)
  650.            data.close ()
  651.         modem ()
  652.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  653.     setupmenu ()
  654.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  655.     modem ()
  656.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  657.     label ()
  658.     else
  659.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  660.     paintutils.drawPixel (51,1, colors.red)
  661.     term.setTextColor(colors.white)
  662.     term.setCursorPos (51,1)
  663.     print "*"
  664.     paintutils.drawPixel (50,1, colors.lightGray)
  665.     term.setCursorPos (50,1)
  666.     print "<"
  667.     paintutils.drawPixel (49,1, colors.lightGray)
  668.     term.setCursorPos (49,1)
  669.     print "_"
  670.              while true do
  671.         local event, button, x, y = os.pullEvent("mouse_click")
  672.         xy = x..","..y
  673.        
  674.         if x == 51 and y == 1 then
  675.             ukonceni ()
  676.         elseif x == 50 and y == 1 then
  677.             network ()
  678.         elseif x == 49 and y == 1 then
  679.             minimalizace ()
  680.         else
  681.         modem ()
  682.             end
  683.             end
  684. end
  685. end
  686. end
  687.  
  688. local function prc(text, y)
  689.   local w = term.getSize()
  690.   local _, cy = term.getCursorPos()
  691.   term.setCursorPos(math.ceil((w-#text)/2), y or cy)
  692.   write(text)
  693. end
  694.  
  695.  
  696. function info ()
  697. funkce = "info"
  698.         local myWindow = window.create(term.current(),16,1,37,19)
  699.     myWindow.setBackgroundColor(colors.white)
  700.     myWindow.clear()
  701.         local myWindow = window.create(term.current(),1,1,16,19)
  702.     myWindow.setBackgroundColor(colors.gray)
  703.     myWindow.clear()
  704. local myWindow = window.create(term.current(),1,1,15,19)
  705.     myWindow.setBackgroundColor(nastaveni.barva)
  706.     myWindow.clear()
  707.     term.setBackgroundColor (nastaveni.barva)
  708.     term.setTextColor(colors.lime)
  709.     term.setCursorPos(2,3)
  710.     print "< Info"
  711.     term.setTextColor(text.barva)
  712.     term.setCursorPos(2,5)
  713.     print "Credits"
  714.     term.setCursorPos(2,7)
  715.     print "Disk"
  716.    
  717.       while true do
  718.     local event, button, x, y = os.pullEvent("mouse_click")
  719.     xy = x..","..y
  720.      
  721.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  722.     setupmenu ()
  723.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  724.     credits ()
  725.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  726.     disk ()
  727.     else
  728.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  729.     paintutils.drawPixel (51,1, colors.red)
  730.     term.setCursorPos (51,1)
  731.     print "*"
  732.     paintutils.drawPixel (50,1, colors.lightGray)
  733.     term.setCursorPos (50,1)
  734.     print "<"
  735.     paintutils.drawPixel (49,1, colors.lightGray)
  736.         term.setCursorPos (49,1)
  737.         print "_"
  738.  
  739.              while true do
  740.         local event, button, x, y = os.pullEvent("mouse_click")
  741.         xy = x..","..y
  742.        
  743.         if x == 51 and y == 1 then
  744.             ukonceni ()
  745.         elseif x == 50 and y == 1 then
  746.             setupmenu ()
  747.         elseif x == 49 and y == 1 then
  748.             minimalizace ()
  749.         else
  750.         info ()
  751.             end
  752.             end
  753. end
  754. end
  755. end
  756.  
  757. function credits ()
  758. funkce = "credits"
  759.         local myWindow = window.create(term.current(),17,1,37,19)
  760.     myWindow.setBackgroundColor(colors.white)
  761.     myWindow.clear()
  762.     term.setBackgroundColor(nastaveni.barva)
  763.        term.setCursorPos(1,1)
  764.        print "               "
  765.        paintutils.drawPixel(16, 1, colors.gray)
  766.        term.setBackgroundColor(colors.white)
  767.        term.setCursorPos(17,1)
  768.        print "                                   "
  769.        myWindow.setTextColor(colors.lime)
  770.     myWindow.setCursorPos(2, 2)
  771.     print "Pepek@Soft"
  772.     term.setTextColor(colors.black)
  773.     myWindow.setCursorPos(13, 2)
  774.     print "Programs"
  775.     myWindow.setTextColor(colors.blue)
  776.     myWindow.setCursorPos(7, 2)
  777.     print "@"
  778.     myWindow.setTextColor(colors.black)
  779.  
  780.    
  781.         while true do
  782.         local event, button, x, y = os.pullEvent("mouse_click")
  783.         xy = x..","..y
  784.    
  785.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  786.     setupmenu ()
  787.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  788.     credits ()
  789.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  790.     disk ()
  791.     else
  792.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  793.     paintutils.drawPixel (51,1, colors.red)
  794.     term.setTextColor(colors.white)
  795.     term.setCursorPos (51,1)
  796.     print "*"
  797.     paintutils.drawPixel (50,1, colors.lightGray)
  798.     term.setCursorPos (50,1)
  799.     print "<"
  800.     paintutils.drawPixel (49,1, colors.lightGray)
  801.         term.setCursorPos (49,1)
  802.         print "_"
  803.  
  804.              while true do
  805.         local event, button, x, y = os.pullEvent("mouse_click")
  806.         xy = x..","..y
  807.        
  808.         if x == 51 and y == 1 then
  809.             ukonceni ()
  810.         elseif x == 50 and y == 1 then
  811.             info ()
  812.         elseif x == 49 and y == 1 then
  813.             minimalizace ()
  814.         else
  815.         credits ()
  816.             end
  817.             end
  818. end
  819. end
  820. end
  821.  
  822. function disk ()
  823. funkce = "diskinfo"
  824.         local myWindow = window.create(term.current(),17,1,37,19)
  825.     myWindow.setBackgroundColor(colors.white)
  826.     myWindow.clear()
  827.     term.setBackgroundColor(nastaveni.barva)
  828.        term.setCursorPos(1,1)
  829.        print "               "
  830.        paintutils.drawPixel(16, 1, colors.gray)
  831.        term.setBackgroundColor(colors.white)
  832.        term.setCursorPos(17,1)
  833.        print "                                   "
  834.      myWindow.setTextColor(colors.black)
  835.     myWindow.setCursorPos(2, 9)
  836.     print("Free Space: "..fs.getFreeSpace("/").." KB")
  837.         if fs.exists ("disk/") then
  838.             print("Free Space: "..fs.getFreeSpace("disk/").." KB")
  839.             end
  840.  
  841.    
  842.         while true do
  843.         local event, button, x, y = os.pullEvent("mouse_click")
  844.         xy = x..","..y
  845.    
  846.  
  847. if x >= 2 and x <= 16 and y == 3 and button == 1 then
  848.     setupmenu ()
  849.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  850.     credits ()
  851.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  852.     disk ()
  853.     else
  854.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  855.     paintutils.drawPixel (51,1, colors.red)
  856.     term.setTextColor(colors.white)
  857.     term.setCursorPos (51,1)
  858.     print "*"
  859.     paintutils.drawPixel (50,1, colors.lightGray)
  860.     term.setCursorPos (50,1)
  861.     print "<"
  862.     paintutils.drawPixel (49,1, colors.lightGray)
  863.         term.setCursorPos (49,1)
  864.         print "_"
  865.  
  866.              while true do
  867.         local event, button, x, y = os.pullEvent("mouse_click")
  868.         xy = x..","..y
  869.        
  870.         if x == 51 and y == 1 then
  871.             ukonceni ()
  872.         elseif x == 50 and y == 1 then
  873.             info ()
  874.         elseif x == 49 and y == 1 then
  875.             minimalizace ()
  876.         else
  877.         disk ()
  878.             end
  879.             end
  880. end
  881. end
  882. end
  883.  
  884. function theme ()
  885. funkce = "theme"
  886. if funkces == nil then
  887.     local f=fs.open("system/.core/colors","r")
  888. local cnt=f.readAll()
  889. f.close()
  890. local nastaveni=textutils.unserialize(cnt)
  891.      
  892. local f=fs.open("system/.core/textcol","r")
  893. local tnt=f.readAll()
  894. f.close()
  895. local text=textutils.unserialize(tnt)
  896.  
  897. local myWindow = window.create(term.current(),1,1,15,19)
  898.     myWindow.setBackgroundColor(nastaveni.barva)
  899.     myWindow.clear()
  900.     term.setBackgroundColor (nastaveni.barva)
  901.     term.setTextColor(colors.lime)
  902.     term.setCursorPos(2,3)
  903.     print "< Info"
  904.     term.setTextColor(text.barva)
  905.     term.setCursorPos(2,5)
  906.     print "Colors"
  907.     term.setCursorPos(2,7)
  908.     print "Background"
  909.    
  910.     local myWindow = window.create(term.current(),17,1,37,19)
  911.     myWindow.setBackgroundColor(colors.white)
  912.     myWindow.clear()
  913.     term.setBackgroundColor (nastaveni.barva)
  914.     term.setTextColor(colors.lime)
  915.     term.setCursorPos(2,3)
  916.     print "< Theme"
  917.    
  918.         local myWindow = window.create(term.current(),17,1,37,19)
  919.     myWindow.setBackgroundColor(colors.white)
  920.     myWindow.clear()
  921.     term.setBackgroundColor(nastaveni.barva)
  922.        term.setCursorPos(1,1)
  923.        print "               "
  924. end
  925.  
  926.        paintutils.drawPixel(16, 1, colors.gray)
  927.        term.setBackgroundColor(colors.white)
  928.        term.setCursorPos(17,1)
  929.        print "                                   "
  930.        term.setCursorPos(19,6)
  931.        term.setTextColor(colors.black)
  932.        print "Change background color."
  933.        term.setCursorPos(19,13)
  934.        print "Change text color."
  935.        term.setCursorPos(30,8)
  936.        print "W"
  937.        term.setCursorPos(30,15)
  938.        print "W"
  939.        paintutils.drawPixel(20, 8, colors.orange)
  940.        paintutils.drawPixel(22, 8, colors.magenta)
  941.        paintutils.drawPixel(24, 8, colors.yellow)
  942.        paintutils.drawPixel(26, 8, colors.cyan)
  943.        paintutils.drawPixel(28, 8, colors.purple)
  944.        paintutils.drawPixel(20, 10, colors.blue)
  945.        paintutils.drawPixel(22, 10, colors.brown)
  946.        paintutils.drawPixel(24, 10, colors.green)
  947.        paintutils.drawPixel(26, 10, colors.red)
  948.        paintutils.drawPixel(28, 10, colors.black)
  949.        paintutils.drawPixel(30, 10, colors.gray)
  950.        paintutils.drawPixel(20, 15, colors.orange)
  951.        paintutils.drawPixel(22, 15, colors.magenta)
  952.        paintutils.drawPixel(24, 15, colors.yellow)
  953.        paintutils.drawPixel(26, 15, colors.cyan)
  954.        paintutils.drawPixel(28, 15, colors.purple)
  955.        paintutils.drawPixel(20, 17, colors.blue)
  956.        paintutils.drawPixel(22, 17, colors.brown)
  957.        paintutils.drawPixel(24, 17, colors.green)
  958.        paintutils.drawPixel(26, 17, colors.red)
  959.        paintutils.drawPixel(28, 17, colors.black)
  960.        paintutils.drawPixel(30, 17, colors.gray)
  961.        paintutils.drawPixel(35, 8, nastaveni.barva)
  962.        paintutils.drawPixel(36, 8, nastaveni.barva)
  963.        paintutils.drawPixel(37, 8, nastaveni.barva)
  964.        paintutils.drawPixel(35, 9, nastaveni.barva)
  965.        paintutils.drawPixel(36, 9, nastaveni.barva)
  966.        paintutils.drawPixel(37, 9, nastaveni.barva)
  967.        paintutils.drawPixel(35, 10, nastaveni.barva)
  968.        paintutils.drawPixel(36, 10, nastaveni.barva)
  969.        paintutils.drawPixel(37, 10, nastaveni.barva)
  970.        paintutils.drawPixel(38, 8, nastaveni.barva)
  971.        paintutils.drawPixel(38, 9, nastaveni.barva)
  972.        paintutils.drawPixel(38, 10, nastaveni.barva)
  973.        term.setCursorPos (35,9)
  974.        term.setTextColor(text.barva)
  975.        print "Text"
  976.        term.setTextColor(colors.white)
  977.        term.setBackgroundColor(colors.gray)
  978.            term.setCursorPos(44, 16)
  979.     print " Apply "
  980.        
  981.  
  982.    
  983.         while true do
  984.         local event, button, x, y = os.pullEvent("mouse_click")
  985.         xy = x..","..y
  986.    
  987.     if x == 20 and y == 8 and button == 1 then
  988.         local novaBarva= "orange"
  989.     if colors[novaBarva:lower()] then
  990.   nastaveni.barva=colors[novaBarva:lower()]
  991.     end
  992.     funkces = 1
  993.     theme ()
  994.     elseif x == 22 and y == 8 and button == 1 then
  995.     local novaBarva= "magenta"
  996.     if colors[novaBarva:lower()] then
  997.   nastaveni.barva=colors[novaBarva:lower()]
  998.     end
  999.     funkces = 1
  1000.     theme ()
  1001.     elseif x == 30 and y == 8 and button == 1 then
  1002.     local novaBarva= "white"
  1003.     if colors[novaBarva:lower()] then
  1004.   nastaveni.barva=colors[novaBarva:lower()]
  1005.     end
  1006.     funkces = 1
  1007.     theme ()
  1008.     elseif x == 24 and y == 8 and button == 1 then
  1009.     local novaBarva= "yellow"
  1010.     if colors[novaBarva:lower()] then
  1011.   nastaveni.barva=colors[novaBarva:lower()]
  1012.     end
  1013.     funkces = 1
  1014.     theme ()
  1015.     elseif x == 26 and y == 8 and button == 1 then
  1016.     local novaBarva= "cyan"
  1017.     if colors[novaBarva:lower()] then
  1018.   nastaveni.barva=colors[novaBarva:lower()]
  1019.     end
  1020.     funkces = 1
  1021.     theme ()
  1022.     elseif x == 28 and y == 8 and button == 1 then
  1023.     local novaBarva= "purple"
  1024.     if colors[novaBarva:lower()] then
  1025.   nastaveni.barva=colors[novaBarva:lower()]
  1026.     end
  1027.     funkces = 1
  1028.     theme ()
  1029.     elseif x == 20 and y == 10 and button == 1 then
  1030.     local novaBarva= "blue"
  1031.     if colors[novaBarva:lower()] then
  1032.   nastaveni.barva=colors[novaBarva:lower()]
  1033.     end
  1034.     funkces = 1
  1035.     theme ()
  1036.     elseif x == 22 and y == 10 and button == 1 then
  1037.     local novaBarva= "brown"
  1038.     if colors[novaBarva:lower()] then
  1039.   nastaveni.barva=colors[novaBarva:lower()]
  1040.     end
  1041.     funkces = 1
  1042.     theme ()
  1043.     elseif x == 24 and y == 10 and button == 1 then
  1044.     local novaBarva= "green"
  1045.     if colors[novaBarva:lower()] then
  1046.   nastaveni.barva=colors[novaBarva:lower()]
  1047.     end
  1048.     funkces = 1
  1049.     theme ()
  1050.     elseif x == 26 and y == 10 and button == 1 then
  1051.     local novaBarva= "red"
  1052.     if colors[novaBarva:lower()] then
  1053.   nastaveni.barva=colors[novaBarva:lower()]
  1054.     end
  1055.     funkces = 1
  1056.     theme ()
  1057.     elseif x == 28 and y == 10 and button == 1 then
  1058.     local novaBarva= "black"
  1059.     if colors[novaBarva:lower()] then
  1060.   nastaveni.barva=colors[novaBarva:lower()]
  1061.     end
  1062.     funkces = 1
  1063.     theme ()
  1064.     elseif x == 30 and y == 10 and button == 1 then
  1065.     local novaBarva= "gray"
  1066.     if colors[novaBarva:lower()] then
  1067.   nastaveni.barva=colors[novaBarva:lower()]
  1068.     end
  1069.     funkces = 1
  1070.     theme ()
  1071.     elseif x == 20 and y == 15 and button == 1 then
  1072.         local textBarva= "orange"
  1073.     if colors[textBarva:lower()] then
  1074.   text.barva=colors[textBarva:lower()]
  1075.     end
  1076.     funkces = 1
  1077.     theme ()
  1078.     elseif x == 22 and y == 15 and button == 1 then
  1079.     local textBarva= "magenta"
  1080.     if colors[textBarva:lower()] then
  1081.   text.barva=colors[textBarva:lower()]
  1082.     end
  1083.     funkces = 1
  1084.     theme ()
  1085.     elseif x == 24 and y == 15 and button == 1 then
  1086.     local textBarva= "yellow"
  1087.     if colors[textBarva:lower()] then
  1088.   text.barva=colors[textBarva:lower()]
  1089.     end
  1090.     funkces = 1
  1091.     theme ()
  1092.     elseif x == 26 and y == 15 and button == 1 then
  1093.     local textBarva= "cyan"
  1094.     if colors[textBarva:lower()] then
  1095.   text.barva=colors[textBarva:lower()]
  1096.     end
  1097.     funkces = 1
  1098.     theme ()
  1099.     elseif x == 28 and y == 15 and button == 1 then
  1100.     local textBarva= "purple"
  1101.     if colors[textBarva:lower()] then
  1102.   text.barva=colors[textBarva:lower()]
  1103.     end
  1104.     funkces = 1
  1105.     theme ()
  1106.     elseif x == 20 and y == 17 and button == 1 then
  1107.     local textBarva= "blue"
  1108.     if colors[textBarva:lower()] then
  1109.   text.barva=colors[textBarva:lower()]
  1110.     end
  1111.     funkces = 1
  1112.     theme ()
  1113.     elseif x == 22 and y == 17 and button == 1 then
  1114.     local textBarva= "brown"
  1115.     if colors[textBarva:lower()] then
  1116.   text.barva=colors[textBarva:lower()]
  1117.     end
  1118.     funkces = 1
  1119.     theme ()
  1120.     elseif x == 24 and y == 17 and button == 1 then
  1121.     local textBarva= "green"
  1122.     if colors[textBarva:lower()] then
  1123.   text.barva=colors[textBarva:lower()]
  1124.     end
  1125.     funkces = 1
  1126.     theme ()
  1127.     elseif x == 26 and y == 17 and button == 1 then
  1128.     local textBarva= "red"
  1129.     if colors[textBarva:lower()] then
  1130.   text.barva=colors[textBarva:lower()]
  1131.     end
  1132.     funkces = 1
  1133.     theme ()
  1134.     elseif x == 30 and y == 15 and button == 1 then
  1135.     local textBarva= "white"
  1136.     if colors[textBarva:lower()] then
  1137.   text.barva=colors[textBarva:lower()]
  1138.     end
  1139.     funkces = 1
  1140.     theme ()
  1141.     elseif x == 30 and y == 17 and button == 1 then
  1142.     local textBarva= "gray"
  1143.     if colors[textBarva:lower()] then
  1144.   text.barva=colors[textBarva:lower()]
  1145.     end
  1146.     funkces = 1
  1147.     theme ()
  1148.     elseif x == 28 and y == 17 and button == 1 then
  1149.     local textBarva= "black"
  1150.     if colors[textBarva:lower()] then
  1151.   text.barva=colors[textBarva:lower()]
  1152.     end
  1153.     funkces = 1
  1154.     theme ()
  1155.     elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
  1156.         local f=fs.open("system/.core/colors","w") --#otevrit soubor
  1157.         f.write(textutils.serialize(nastaveni)) --#zapsat tabulku jako text a ten ulozit
  1158.         f.close()
  1159.         local nastaveni={barva=colors.blue}
  1160.         local f=fs.open("system/.core/textcol","w") --#otevrit soubor
  1161.         f.write(textutils.serialize(text)) --#zapsat tabulku jako text a ten ulozit
  1162.         f.close()
  1163.         local text={barva=colors.white}
  1164.         funkces = nil
  1165.         theme ()
  1166.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  1167.     funkces = nil
  1168.     setupmenu ()
  1169.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  1170.     funkces = nil
  1171.     theme ()
  1172.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  1173.     funkces = nil
  1174.     tapety ()
  1175.     else
  1176.     funkces = nil
  1177.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1178.     paintutils.drawPixel (51,1, colors.red)
  1179.     term.setTextColor(colors.white)
  1180.     term.setCursorPos (51,1)
  1181.     print "*"
  1182.     paintutils.drawPixel (50,1, colors.lightGray)
  1183.     term.setCursorPos (50,1)
  1184.     print "<"
  1185.     paintutils.drawPixel (49,1, colors.lightGray)
  1186.     term.setCursorPos (49,1)
  1187.     print "_"
  1188.              while true do
  1189.         local event, button, x, y = os.pullEvent("mouse_click")
  1190.         xy = x..","..y
  1191.        
  1192.         if x == 51 and y == 1 then
  1193.             ukonceni ()
  1194.         elseif x == 50 and y == 1 then
  1195.             setupmenu ()
  1196.         elseif x == 49 and y == 1 then
  1197.             minimalizace ()
  1198.         else
  1199.         theme ()
  1200.             end
  1201.             end
  1202. end
  1203. end
  1204. end
  1205.  
  1206. function tapety ()
  1207. funkce = "tapety"
  1208.     o=fs.open ("/system/RAM/setting", "r")
  1209.     user = o.readLine()
  1210.     o.close()
  1211.     local myWindow = window.create(term.current(),1,1,16,19)
  1212.     myWindow.setBackgroundColor(colors.gray)
  1213.     myWindow.clear()
  1214.     local myWindow = window.create(term.current(),1,1,15,19)
  1215.     myWindow.setBackgroundColor(nastaveni.barva)
  1216.     myWindow.clear()
  1217.     term.setBackgroundColor (nastaveni.barva)
  1218.     term.setTextColor(colors.lime)
  1219.     term.setCursorPos(2,3)
  1220.     print "< Info"
  1221.     term.setTextColor(text.barva)
  1222.     term.setCursorPos(2,5)
  1223.     print "Colors"
  1224.     term.setCursorPos(2,7)
  1225.     print "Background"
  1226.     local myWindow = window.create(term.current(),17,1,37,19)
  1227.     myWindow.setBackgroundColor(colors.white)
  1228.     myWindow.clear()
  1229.     term.setBackgroundColor (nastaveni.barva)
  1230.     term.setTextColor(colors.lime)
  1231.     term.setCursorPos(2,3)
  1232.     print "< Theme"
  1233.    
  1234.         local myWindow = window.create(term.current(),17,1,37,19)
  1235.     myWindow.setBackgroundColor(colors.white)
  1236.     myWindow.clear()
  1237.     term.setBackgroundColor(nastaveni.barva)
  1238.        term.setCursorPos(1,1)
  1239.        print "               "
  1240.        paintutils.drawPixel(16, 1, colors.gray)
  1241.        term.setBackgroundColor(colors.white)
  1242.        term.setCursorPos(17,1)
  1243.        print "                                   "
  1244.        myWindow.setCursorPos(2,6)
  1245.        term.setTextColor(colors.black)
  1246.        print "Change background image."
  1247.        myWindow.setCursorPos(2, 8)
  1248.        print "- Background clear"
  1249.        myWindow.setCursorPos(2, 10)
  1250.        print "- Pepdroll"
  1251.        myWindow.setCursorPos(2, 12)
  1252.        print "- Farm"
  1253.        myWindow.setCursorPos(2, 14)
  1254.        print "- Windows XP"
  1255.        
  1256.  
  1257.    
  1258.         while true do
  1259.         local event, button, x, y = os.pullEvent("mouse_click")
  1260.         xy = x..","..y
  1261.    
  1262.  
  1263.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  1264.     setupmenu ()
  1265.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  1266.     theme ()
  1267.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  1268.     theme ()
  1269.     elseif x >= 16 and x <= 35 and y == 8 and button == 1 then
  1270.     myWindow.setCursorPos(2, 16)
  1271.     shell.run(" delete /system/.ucet/"..user.."/bar.nfp")
  1272.     tapety ()
  1273.     elseif x >= 16 and x <= 35 and y == 10 and button == 1 then
  1274.     myWindow.setCursorPos(2, 16)
  1275.     shell.run(" delete /system/.ucet/"..user.."/bar.nfp")
  1276.     shell.run("pastebin get C3MXEfYf /system/.ucet/"..user.."/bar.nfp")
  1277.     tapety ()
  1278.     elseif x >= 16 and x <= 35 and y == 12 and button == 1 then
  1279.     myWindow.setCursorPos(2, 16)
  1280.     shell.run(" delete /system/.ucet/"..user.."/bar.nfp")
  1281.     shell.run("pastebin get K0zXPiKn /system/.ucet/"..user.."/bar.nfp")
  1282.     tapety ()
  1283.     elseif x >= 16 and x <= 35 and y == 14 and button == 1 then
  1284.     myWindow.setCursorPos(2, 16)
  1285.     shell.run(" delete /system/.ucet/"..user.."/bar.nfp")
  1286.     shell.run("pastebin get iy3EcA4Z /system/.ucet/"..user.."/bar.nfp")
  1287.     tapety ()
  1288.     else
  1289.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1290.     paintutils.drawPixel (51,1, colors.red)
  1291.     term.setTextColor(colors.white)
  1292.     term.setCursorPos (51,1)
  1293.     print "*"
  1294.     paintutils.drawPixel (50,1, colors.lightGray)
  1295.     term.setCursorPos (50,1)
  1296.     print "<"
  1297.     paintutils.drawPixel (49,1, colors.lightGray)
  1298.     term.setCursorPos (49,1)
  1299.     print "_"
  1300.              while true do
  1301.         local event, button, x, y = os.pullEvent("mouse_click")
  1302.         xy = x..","..y
  1303.        
  1304.         if x == 51 and y == 1 then
  1305.             ukonceni ()
  1306.         elseif x == 50 and y == 1 then
  1307.             setupmenu ()
  1308.         elseif x == 49 and y == 1 then
  1309.             minimalizace ()
  1310.         else
  1311.         tapety ()
  1312.             end
  1313.             end
  1314.  
  1315. end
  1316. end
  1317. end
  1318.  
  1319.  
  1320. function account ()
  1321. funkce = "account"
  1322.     defuser = user
  1323.         local myWindow = window.create(term.current(),16,1,37,19)
  1324.     myWindow.setBackgroundColor(colors.white)
  1325.     myWindow.clear()
  1326.         local myWindow = window.create(term.current(),1,1,16,19)
  1327.     myWindow.setBackgroundColor(colors.gray)
  1328.     myWindow.clear()
  1329.     local myWindow = window.create(term.current(),1,1,15,19)
  1330.     myWindow.setBackgroundColor(nastaveni.barva)
  1331.     myWindow.clear()
  1332.     term.setBackgroundColor (nastaveni.barva)
  1333.     term.setTextColor(colors.lime)
  1334.     term.setCursorPos(2,3)
  1335.     print "< Accounts"
  1336.     term.setTextColor(text.barva)
  1337.     term.setCursorPos(2,5)
  1338.     print "Password"
  1339.     term.setCursorPos(2,7)
  1340.     print "Login"
  1341.     term.setCursorPos(2,9)
  1342.     print "New user"
  1343.     term.setCursorPos(2,11)
  1344.     print "Delete users"
  1345.     term.setCursorPos(2,13)
  1346.     print "Log out"
  1347.    
  1348.     if fs.exists ("/system/RAM/setdata")then
  1349.      local data = fs.open ("/system/RAM/setdata", "r")
  1350.         funkce = data.readLine ()
  1351.         data.close ()
  1352.         end
  1353.        
  1354.        
  1355.         if funkce == "password" then
  1356.             password ()
  1357.         elseif funkce == logon then
  1358.             login ()
  1359.         elseif funkce == "createuser" then
  1360.             createuser ()
  1361.         elseif funkce == "deleteuser" then
  1362.             deleteuser ()
  1363.         end
  1364.        
  1365.         logon ()
  1366. end
  1367.  
  1368. function deleteuser ()
  1369. funkce = "deleteuser"    
  1370.     function dele ()
  1371.                 term.setCursorPos (20, 13)
  1372.                 term.setTextColor(colors.lime)
  1373.                 print "User is deleted!"
  1374.                 sleep (1)
  1375.                 fs.delete ("/system/.ucet/"..deluser)
  1376.                 deleteusers = 0
  1377.                 deleteuser ()
  1378.                 end
  1379.                         function defuserdel ()
  1380.                            if defuser == deluser then
  1381.                                term.setCursorPos (20, 13)
  1382.                                 term.setTextColor(colors.red)
  1383.                                 print "User is a default!"
  1384.                                 sleep (1)
  1385.                                 local myWindow = window.create(term.current(),19,10,21,5)
  1386.                                 myWindow.setBackgroundColor(colors.gray)
  1387.                                 myWindow.clear()
  1388.                                 local myWindow = window.create(term.current(),18,9,21,5)
  1389.                                 myWindow.setBackgroundColor(colors.yellow)
  1390.                                 myWindow.clear()
  1391.                                 term.setTextColor(colors.black)
  1392.                                 myWindow.setCursorPos (2,2)
  1393.                                 print "Do you want change"
  1394.                                 myWindow.setCursorPos (2,3)
  1395.                                 print "default user now ?"
  1396.                                 myWindow.setCursorPos (2,5)
  1397.                                 print "Yes             No"
  1398.                                
  1399.                         while true do
  1400.                         local event, button, x, y = os.pullEvent("mouse_click")
  1401.                         xy = x..","..y
  1402.                                 if x >= 19 and x <= 21 and y == 13 and button == 1 then
  1403.                                 logon ()
  1404.                                 else
  1405.                                 deleteusers = 1
  1406.                                 deleteuser ()
  1407.                                 end
  1408.                                 end
  1409.                                 else
  1410.                                 dele ()
  1411.                                 end
  1412.                                 end
  1413.                                
  1414.                                 function resetnow ()
  1415.                                  local myWindow = window.create(term.current(),19,10,21,5)
  1416.                                 myWindow.setBackgroundColor(colors.gray)
  1417.                                 myWindow.clear()
  1418.                                 local myWindow = window.create(term.current(),18,9,21,5)
  1419.                                 myWindow.setBackgroundColor(colors.yellow)
  1420.                                 myWindow.clear()
  1421.                                 term.setTextColor(colors.black)
  1422.                                 myWindow.setCursorPos (2,2)
  1423.                                 print "Do you want       "
  1424.                                 myWindow.setCursorPos (2,3)
  1425.                                 print "restart now ?     "
  1426.                                 myWindow.setCursorPos (2,5)
  1427.                                 print "Yes             No"
  1428.                                
  1429.                         while true do
  1430.                         local event, button, x, y = os.pullEvent("mouse_click")
  1431.                         xy = x..","..y
  1432.                                 if x >= 19 and x <= 21 and y == 13 and button == 1 then
  1433.                                 restart ()
  1434.                                 else
  1435.                                 deleteusers = 1
  1436.                                 deleteuser ()
  1437.                                 end
  1438.                                 end
  1439.                                 end  
  1440.                
  1441.         if deleteusers == 0 then
  1442.             deluser = ""
  1443.             end
  1444.            
  1445.     term.setBackgroundColor(nastaveni.barva)
  1446.        term.setCursorPos(1,1)
  1447.        print "               "
  1448.        paintutils.drawPixel(16, 1, colors.gray)
  1449.     local myWindow = window.create(term.current(),17,1,37,19)
  1450.     myWindow.setBackgroundColor(colors.white)
  1451.     myWindow.clear()
  1452.      term.setBackgroundColor(colors.white)
  1453.     term.setTextColor(colors.blue)
  1454.     myWindow.setCursorPos (2,3)
  1455.     print "Delete an account"
  1456.     term.setTextColor(colors.black)
  1457.     myWindow.setCursorPos(2, 5)
  1458.     print "User name:"
  1459.     term.setBackgroundColor(colors.gray)
  1460.     term.setTextColor(colors.white)
  1461.     myWindow.setCursorPos(30, 16)
  1462.     print " Apply "
  1463.     term.setBackgroundColor(colors.lightGray)
  1464.     myWindow.setCursorPos(13, 5)
  1465.     print "              "
  1466.     term.setCursorPos(29, 5)
  1467.     print (deluser)
  1468.     myWindow.setCursorPos(35,9)
  1469.     print "<"
  1470.            
  1471.     while true do
  1472.         local event, button, x, y = os.pullEvent("mouse_click")
  1473.         xy = x..","..y
  1474.  
  1475.     if x >= 29 and x <= 44 and y == 5 and button == 1 then
  1476.             term.setBackgroundColor(colors.gray)
  1477.             term.setCursorPos(29, 5)
  1478.             print "              "
  1479.             term.setCursorPos(29, 5)
  1480.             deluser = read ()
  1481.             deleteusers = 1
  1482.             deleteuser ()
  1483.     elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
  1484.         term.setBackgroundColor(colors.white)
  1485.        
  1486.         if fs.exists ("/system/RAM/"..deluser) then
  1487.             term.setCursorPos (20, 13)
  1488.                         term.setTextColor(colors.red)
  1489.                         print "You must restart computer"
  1490.                         sleep (1)
  1491.                         resetnow ()
  1492.                         end
  1493.                        
  1494.         if fs.exists ("/system/.ucet/"..deluser) then
  1495.              if fs.exists ("/system/.core/defuser") then
  1496.                data = fs.open ("/system/.core/defuser", "r")
  1497.                defuser = data.readLine ()
  1498.                defuserdel ()
  1499.                else
  1500.                dele ()
  1501.                end
  1502.            else
  1503.            term.setCursorPos (20, 13)
  1504.                 term.setTextColor(colors.red)
  1505.                 print "User is not found!"
  1506.                 sleep (1)
  1507.                 deleteusers = 1
  1508.                 deleteuser ()
  1509.                 end
  1510.                
  1511.     elseif x == 51 and y == 9 and button == 1 then              
  1512.         local myWindow = window.create(term.current(),1,17,51,3)
  1513.         myWindow.setBackgroundColor(colors.yellow)
  1514.         myWindow.clear()
  1515.         term.setCursorPos(1,17)
  1516.         shell.run ("ls /system/.ucet/")
  1517.        
  1518.         while true do
  1519.         local event, button, xPos, yPos = os.pullEvent("mouse_click")
  1520.         local myWindow = window.create(term.current(),1,17,15,3)
  1521.         myWindow.setBackgroundColor(nastaveni.barva)
  1522.         myWindow.clear()
  1523.         local myWindow = window.create(term.current(),17,17,40,3)
  1524.         myWindow.setBackgroundColor(colors.white)
  1525.         myWindow.clear()
  1526.         paintutils.drawPixel(16, 17, colors.gray)
  1527.         paintutils.drawPixel(16, 18, colors.gray)
  1528.         paintutils.drawPixel(16, 19, colors.gray)
  1529.         deleteuser ()
  1530.         end
  1531.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  1532.     setupmenu ()
  1533.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  1534.     password ()
  1535.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  1536.     logon ()
  1537.     elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
  1538.     createuser ()
  1539.     elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
  1540.     deleteuser ()
  1541.     elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
  1542.     odhlasit ()
  1543.     else
  1544.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1545.     paintutils.drawPixel (51,1, colors.red)
  1546.     term.setTextColor(colors.white)
  1547.     term.setCursorPos (51,1)
  1548.     print "*"
  1549.     paintutils.drawPixel (50,1, colors.lightGray)
  1550.     term.setCursorPos (50,1)
  1551.     print "<"
  1552.     paintutils.drawPixel (49,1, colors.lightGray)
  1553.     term.setCursorPos (49,1)
  1554.     print "_"
  1555.              while true do
  1556.         local event, button, x, y = os.pullEvent("mouse_click")
  1557.         xy = x..","..y
  1558.        
  1559.         if x == 51 and y == 1 then
  1560.             ukonceni ()
  1561.         elseif x == 50 and y == 1 then
  1562.             account ()
  1563.         elseif x == 49 and y == 1 then
  1564.             minimalizace ()
  1565.         else
  1566.         deleteuser ()
  1567.             end
  1568.             end
  1569. end
  1570. end
  1571. end
  1572.  
  1573. function createuser ()
  1574. funkce = "createuser"
  1575.         if register == 0 then
  1576.             newuser = ""
  1577.             newpass = ""
  1578.             newpas = ""
  1579.             end
  1580.            
  1581.     term.setBackgroundColor(nastaveni.barva)
  1582.        term.setCursorPos(1,1)
  1583.        print "               "
  1584.        paintutils.drawPixel(16, 1, colors.gray)
  1585.     local myWindow = window.create(term.current(),17,1,37,19)
  1586.     myWindow.setBackgroundColor(colors.white)
  1587.    
  1588.     myWindow.clear()
  1589.     myWindow.setCursorPos (2,3)
  1590.     term.setTextColor(colors.blue)
  1591.      term.setBackgroundColor(colors.white)
  1592.     print "Create a new account"
  1593.     term.setTextColor(colors.black)
  1594.     myWindow.setCursorPos(2, 5)
  1595.     print "User name:"
  1596.     myWindow.setCursorPos(2, 7)
  1597.     print " Password:"
  1598.     term.setBackgroundColor(colors.gray)
  1599.     term.setTextColor(colors.white)
  1600.     myWindow.setCursorPos(30, 16)
  1601.     print " Apply "
  1602.     term.setBackgroundColor(colors.lightGray)
  1603.     myWindow.setCursorPos(13, 5)
  1604.     print "              "
  1605.     myWindow.setCursorPos(13, 5)
  1606.     print (newuser)
  1607.     myWindow.setCursorPos(13, 7)
  1608.     print "              "
  1609.     myWindow.setCursorPos(13, 7)
  1610.     print (newpas)
  1611.     myWindow.setCursorPos(35,9)
  1612.     print "<"
  1613.    
  1614.     while true do
  1615.         local event, button, x, y = os.pullEvent("mouse_click")
  1616.         xy = x..","..y
  1617.    
  1618.         if x >= 29 and x <= 44 and y == 5 and button == 1 then
  1619.             term.setBackgroundColor(colors.gray)
  1620.             term.setCursorPos(29, 5)
  1621.             print "              "
  1622.             term.setCursorPos(29, 5)
  1623.             newuser = read ()
  1624.             register = 1
  1625.             createuser ()
  1626.         elseif x >= 29 and x <= 44 and y == 7 and button == 1 then
  1627.             term.setBackgroundColor(colors.gray)
  1628.             term.setCursorPos(29, 7)
  1629.             print "              "
  1630.             term.setCursorPos(29, 7)
  1631.             newpass= read ("@")
  1632.             newpas = "Password"
  1633.             register = 1
  1634.             createuser ()
  1635.     elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
  1636.     term.setBackgroundColor(colors.white)
  1637.                 if not fs.exists ("/system/.ucet/"..newuser) then
  1638.                         file = fs.open ("/system/.ucet/"..newuser.."/.data", "w")
  1639.                         file.writeLine(newuser)
  1640.                         file.writeLine(newpass)
  1641.                         file.close ()
  1642.                         term.setCursorPos(17,13)
  1643.                         shell.run ("pastebin get C3MXEfYf ", ".ucet/"..newuser.."/bar.nfp")
  1644.                         term.setCursorPos(17,13)
  1645.                         shell.run ("pastebin get 2Rg15U0q ", ".ucet/"..newuser.."/user")
  1646.                         local myWindow = window.create(term.current(),17,13,34,3)
  1647.                         myWindow.setBackgroundColor(colors.white)
  1648.                         myWindow.clear ()
  1649.                         term.setCursorPos(20,14)
  1650.                         term.setTextColor(colors.lime)
  1651.                         print "Complete"
  1652.                         register = 0
  1653.                         local myWindow = window.create(term.current(),1,14,15,2)
  1654.                         myWindow.setBackgroundColor(nastaveni.barva)
  1655.                         myWindow.clear()
  1656.                         paintutils.drawPixel(16, 14, colors.gray)
  1657.                         paintutils.drawPixel(16, 15, colors.gray)
  1658.                         sleep (1)
  1659.                         createuser ()
  1660.                         else
  1661.                         term.setCursorPos (20, 13)
  1662.                         term.setTextColor(colors.red)
  1663.                         print "User is exists"
  1664.                         sleep (1)
  1665.                         register = 1
  1666.                         createuser ()
  1667.                     end
  1668.     elseif x == 51 and y == 9 and button == 1 then              
  1669.         local myWindow = window.create(term.current(),1,17,51,3)
  1670.         myWindow.setBackgroundColor(colors.yellow)
  1671.         myWindow.clear()
  1672.         term.setCursorPos(1,17)
  1673.         shell.run ("ls /system/.ucet/")
  1674.        
  1675.         while true do
  1676.         local event, button, xPos, yPos = os.pullEvent("mouse_click")
  1677.         local myWindow = window.create(term.current(),1,17,15,3)
  1678.         myWindow.setBackgroundColor(nastaveni.barva)
  1679.         myWindow.clear()
  1680.         local myWindow = window.create(term.current(),17,17,40,3)
  1681.         myWindow.setBackgroundColor(colors.white)
  1682.         myWindow.clear()
  1683.         paintutils.drawPixel(16, 17, colors.gray)
  1684.         paintutils.drawPixel(16, 18, colors.gray)
  1685.         paintutils.drawPixel(16, 19, colors.gray)
  1686.         createuser ()
  1687.         end
  1688.        
  1689.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  1690.     setupmenu ()
  1691.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  1692.     password ()
  1693.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  1694.     logon ()
  1695.     elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
  1696.     createuser ()
  1697.     elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
  1698.     deleteuser ()
  1699.     elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
  1700.     odhlasit ()
  1701.     else
  1702.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1703.     paintutils.drawPixel (51,1, colors.red)
  1704.     term.setTextColor(colors.white)
  1705.     term.setCursorPos (51,1)
  1706.     print "*"
  1707.     paintutils.drawPixel (50,1, colors.lightGray)
  1708.     term.setCursorPos (50,1)
  1709.     print "<"
  1710.     paintutils.drawPixel (49,1, colors.lightGray)
  1711.     term.setCursorPos (49,1)
  1712.     print "_"
  1713.              while true do
  1714.         local event, button, x, y = os.pullEvent("mouse_click")
  1715.         xy = x..","..y
  1716.        
  1717.         if x == 51 and y == 1 then
  1718.             ukonceni ()
  1719.         elseif x == 50 and y == 1 then
  1720.             account ()
  1721.         elseif x == 49 and y == 1 then
  1722.             minimalizace ()
  1723.         else
  1724.         createuser ()
  1725.             end
  1726.             end
  1727. end
  1728. end
  1729. end
  1730.    function logon ()
  1731.    funkce = "logon"
  1732.     defuser = user
  1733.        function apply ()
  1734.                term.setBackgroundColor(colors.white)
  1735.         data = fs.open("/system/.core/defuser","w")
  1736.         data.writeLine(defuser)
  1737.         data.close()
  1738.         term.setCursorPos (20, 13)
  1739.                 term.setTextColor(colors.lime)
  1740.                 print "Successeful!"
  1741.                 sleep (1)
  1742.         logon ()
  1743.            end
  1744.         local data = fs.open("/system/.core/defuser","r")
  1745.         defuser = data.readLine ()
  1746.         data.close ()  
  1747.         local n=fs.open("/system/.core/logon.cfg","r")
  1748.         preskoclog = n.readLine ()
  1749.         n.close ()
  1750.        term.setBackgroundColor(nastaveni.barva)
  1751.        term.setCursorPos(1,1)
  1752.        print "               "
  1753.        paintutils.drawPixel(16, 1, colors.gray)
  1754.         local myWindow = window.create(term.current(),17,1,37,19)
  1755.     myWindow.setBackgroundColor(colors.white)
  1756.     myWindow.clear()
  1757.     term.setTextColor(colors.blue)
  1758.     term.setBackgroundColor(colors.white)
  1759.     myWindow.setCursorPos (2,3)
  1760.     print "Setting a login"
  1761.  
  1762.     term.setBackgroundColor(colors.white)
  1763.     term.setTextColor(colors.black)
  1764.     term.setCursorPos(22, 9)
  1765.     print ("You must log")
  1766.     term.setCursorPos(20, 16)
  1767.     print ("If you want skip login,")
  1768.     term.setCursorPos(20, 17)
  1769.     print ("default user will ")
  1770.     term.setCursorPos(38, 17)
  1771.     term.setBackgroundColor(colors.lightGray)
  1772.     print (defuser)
  1773.         myWindow.setCursorPos(35,9)
  1774.     print "<"
  1775.     term.setBackgroundColor(colors.lightGray)
  1776.     term.setCursorPos(37,9)  
  1777.     if preskoclog == "1" then
  1778.         stavlog = "No"
  1779.         else
  1780.         stavlog = "Yes"
  1781.         n.close()
  1782.         end
  1783.         term.setTextColor(colors.white)
  1784.     print ("  "..stavlog.."  ")
  1785.         if stavlog == "Yes" then
  1786.             paintutils.drawPixel (37, 9, colors.lime)
  1787.         elseif stavlog == "No" then
  1788.             paintutils.drawPixel (43, 9, colors.red)
  1789.             paintutils.drawPixel (37, 9, colors.lightGray)
  1790.        end
  1791.  
  1792.    
  1793.    
  1794.         while true do
  1795.         local event, button, x, y = os.pullEvent("mouse_click")
  1796.         xy = x..","..y
  1797.    
  1798.     if x >= 37 and x <= 43 and y == 17 and button == 1 then
  1799.         term.setCursorPos(38, 17)
  1800.         term.setBackgroundColor(colors.gray)
  1801.         print "          "
  1802.         term.setCursorPos(38, 17)
  1803.         defus = read ()
  1804.             if fs.exists ("/system/.ucet/"..defus) then
  1805.                 defuser = defus
  1806.                 apply ()
  1807.                 else
  1808.                 term.setBackgroundColor(colors.white)
  1809.                 term.setCursorPos (20, 13)
  1810.                 term.setTextColor(colors.red)
  1811.                 print "User not found!"
  1812.                 sleep (1)
  1813.                 logon ()
  1814.              end
  1815.         end
  1816.        
  1817.    if x >= 37 and x <= 43 and y == 9 and button == 1 then
  1818.  
  1819.     if preskoclog == "1" then
  1820.     preskoclog = "0"
  1821.     elseif preskoclog == "0" then
  1822.     preskoclog = "1"
  1823.     n.close()
  1824.     end
  1825.    
  1826. local n=fs.open("/system/.core/logon.cfg","w")
  1827. n.writeLine(preskoclog)
  1828. n.close()
  1829. logon ()
  1830.        
  1831.     elseif x == 51 and y == 9 and button == 1 then              
  1832.         local myWindow = window.create(term.current(),1,17,51,3)
  1833.         myWindow.setBackgroundColor(colors.yellow)
  1834.         myWindow.clear()
  1835.         term.setCursorPos(1,17)
  1836.         shell.run ("ls /system/.ucet/")
  1837.        
  1838.         while true do
  1839.         local event, button, xPos, yPos = os.pullEvent("mouse_click")
  1840.         local myWindow = window.create(term.current(),1,17,15,3)
  1841.         myWindow.setBackgroundColor(nastaveni.barva)
  1842.         myWindow.clear()
  1843.         local myWindow = window.create(term.current(),17,17,40,3)
  1844.         myWindow.setBackgroundColor(colors.white)
  1845.         myWindow.clear()
  1846.         paintutils.drawPixel(16, 17, colors.gray)
  1847.         paintutils.drawPixel(16, 18, colors.gray)
  1848.         paintutils.drawPixel(16, 19, colors.gray)
  1849.         logon ()
  1850.         end
  1851.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  1852.     setupmenu ()
  1853.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  1854.     password ()
  1855.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  1856.     logon ()
  1857.     elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
  1858.      createuser ()
  1859.     elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
  1860.     deleteuser ()
  1861.     elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
  1862.     odhlasit ()
  1863.     else
  1864.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1865.     paintutils.drawPixel (51,1, colors.red)
  1866.     term.setTextColor(colors.white)
  1867.     term.setCursorPos (51,1)
  1868.     print "*"
  1869.     paintutils.drawPixel (50,1, colors.lightGray)
  1870.     term.setCursorPos (50,1)
  1871.     print "<"
  1872.     paintutils.drawPixel (49,1, colors.lightGray)
  1873.     term.setCursorPos (49,1)
  1874.     print "_"
  1875.  
  1876.              while true do
  1877.         local event, button, x, y = os.pullEvent("mouse_click")
  1878.         xy = x..","..y
  1879.        
  1880.         if x == 51 and y == 1 then
  1881.             ukonceni ()
  1882.         elseif x == 50 and y == 1 then
  1883.             account ()
  1884.         elseif x == 49 and y == 1 then
  1885.             minimalizace ()
  1886.         else
  1887.         logon ()
  1888.             end
  1889.             end
  1890. end
  1891. end
  1892. end
  1893.  
  1894.  function password ()
  1895.  funkce = "password"
  1896.      
  1897.      if login == 1 then
  1898.          else
  1899.         passold = ""
  1900.         passoldp = ""
  1901.         pass1 = ""
  1902.         pass1p = ""
  1903.         pass2 = ""
  1904.         pass2p = ""
  1905.         end
  1906.        
  1907.         local n=fs.open("/system/.core/logon.cfg","r")
  1908.         preskoclog = n.readLine ()
  1909.         n.close ()
  1910.        
  1911.        term.setBackgroundColor(nastaveni.barva)
  1912.        term.setCursorPos(1,1)
  1913.        print "               "
  1914.        paintutils.drawPixel(16, 1, colors.gray)
  1915.         local myWindow = window.create(term.current(),17,1,37,19)
  1916.     myWindow.setBackgroundColor(colors.white)
  1917.     myWindow.clear()
  1918.      term.setBackgroundColor(colors.white)
  1919.     term.setTextColor(colors.blue)
  1920.     myWindow.setCursorPos (2,3)
  1921.     print "Change your password"
  1922.     term.setTextColor(colors.black)
  1923.     myWindow.setCursorPos(2, 5)
  1924.     print "Your old password:"
  1925.     myWindow.setCursorPos(2, 7)
  1926.     print "Your new password:"
  1927.     myWindow.setCursorPos(3, 9)
  1928.     print "Confirm password:"
  1929.     term.setBackgroundColor(colors.gray)
  1930.     term.setTextColor(colors.white)
  1931.     myWindow.setCursorPos(30, 16)
  1932.     print " Apply "
  1933.     term.setBackgroundColor(colors.lightGray)
  1934.     myWindow.setCursorPos(21, 5)
  1935.     print "              "
  1936.     myWindow.setCursorPos(21, 5)
  1937.     print (passoldp)
  1938.     myWindow.setCursorPos(21, 7)
  1939.     print "              "
  1940.     myWindow.setCursorPos(21, 7)
  1941.     print (pass1p)
  1942.     myWindow.setCursorPos(21, 9)
  1943.     print "              "
  1944.     myWindow.setCursorPos(21, 9)
  1945.         if pass2 == pass1 then
  1946.         term.setTextColor(colors.lime)  
  1947.         print "Valid"
  1948.         else
  1949.         term.setTextColor(colors.red)
  1950.         print "Invalid"
  1951.         end
  1952.  
  1953.    
  1954.         while true do
  1955.         local event, button, x, y = os.pullEvent("mouse_click")
  1956.         xy = x..","..y
  1957.     if x >= 37 and x <= 50 and y == 5 and button == 1 then
  1958.     term.setBackgroundColor(colors.gray)
  1959.     term.setCursorPos(37, 5)
  1960.     print "              "
  1961.     term.setCursorPos(37, 5)
  1962.     term.setTextColor(colors.white)
  1963.     passold = read ("@")
  1964.     passoldp = "Old Password"
  1965.     login = 1
  1966.     password ()
  1967.     elseif x >= 37 and x <= 50 and y == 7 and button == 1 then
  1968.     term.setBackgroundColor(colors.gray)
  1969.     term.setCursorPos(37, 7)
  1970.     print "              "
  1971.     term.setCursorPos(37, 7)
  1972.     term.setTextColor(colors.white)
  1973.     pass1 = read ("@")
  1974.     pass1p = "New Password"
  1975.     login = 1
  1976.     password ()
  1977.     elseif x >= 37 and x <= 50 and y == 9 and button == 1 then
  1978.     term.setBackgroundColor(colors.gray)
  1979.     term.setCursorPos(37, 9)
  1980.     print "              "
  1981.     term.setCursorPos(37, 9)
  1982.     term.setTextColor(colors.white)
  1983.     pass2 = read ("@")
  1984.     password ()
  1985.  
  1986.     elseif x >= 44 and x <= 51 and y == 16 and button == 1 then
  1987.    
  1988.     o=fs.open ("/system/.ucet/"..user.."/.data", "r")
  1989.     user=o.readLine()
  1990.     passI=o.readLine()
  1991.     o.close()
  1992.     term.setBackgroundColor(colors.white)
  1993.         if passold == passI then
  1994.             if pass1 == pass2 then
  1995.                 term.setCursorPos (20, 13)
  1996.             term.setTextColor(colors.lime)
  1997.             data = fs.open("/system/.ucet/"..user.."/.data","w")
  1998.             data.writeLine(user)
  1999.             data.writeLine(pass1)
  2000.             data.close()
  2001.             print "Your accound has been changed."
  2002.             login = 0
  2003.             sleep (1)
  2004.             password ()
  2005.             else
  2006.             term.setCursorPos (20, 13)
  2007.             term.setTextColor(colors.red)
  2008.             print "Invalid confirm password!"
  2009.             login = 1
  2010.             sleep (1)
  2011.             password ()
  2012.             end
  2013.     else
  2014.     term.setCursorPos (20, 13)
  2015.     term.setTextColor(colors.red)
  2016.     print "Invalid old password!"
  2017.     sleep (1)
  2018.     login = 1
  2019.     password ()
  2020.     end
  2021.          
  2022.     elseif x >= 2 and x <= 16 and y == 3 and button == 1 then
  2023.     login = 0
  2024.     setupmenu ()
  2025.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  2026.     login = 0
  2027.     password ()
  2028.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  2029.     login = 0
  2030.     logon ()
  2031.     elseif x >= 2 and x <= 16 and y == 9 and button == 1 then
  2032.      createuser ()
  2033.     elseif x >= 2 and x <= 16 and y == 11 and button == 1 then
  2034.     deleteuser ()
  2035.     elseif x >= 2 and x <= 16 and y == 13 and button == 1 then
  2036.     odhlasit ()
  2037.     else
  2038.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  2039.     paintutils.drawPixel (51,1, colors.red)
  2040.     term.setTextColor(colors.white)
  2041.     term.setCursorPos (51,1)
  2042.     print "*"
  2043.     paintutils.drawPixel (50,1, colors.lightGray)
  2044.     term.setCursorPos (50,1)
  2045.     print "<"
  2046.     paintutils.drawPixel (49,1, colors.lightGray)
  2047.     term.setCursorPos (49,1)
  2048.     print "_"
  2049.  
  2050.              while true do
  2051.         local event, button, x, y = os.pullEvent("mouse_click")
  2052.         xy = x..","..y
  2053.        
  2054.         if x == 51 and y == 1 then
  2055.         login = 0
  2056.             ukonceni ()
  2057.         elseif x == 50 and y == 1 then
  2058.         login = 0
  2059.             account ()
  2060.         elseif x == 49 and y == 1 then
  2061.         login = 1
  2062.             minimalizace ()
  2063.         else
  2064.         login = 1
  2065.         password ()
  2066.             end
  2067.             end
  2068. end
  2069. end
  2070. end
  2071.  
  2072. function network ()
  2073. funkce = "network"
  2074.     local myWindow = window.create(term.current(),1,1,16,19)
  2075.     myWindow.setBackgroundColor(colors.gray)
  2076.     myWindow.clear()
  2077.     local myWindow = window.create(term.current(),1,1,15,19)
  2078.     myWindow.setBackgroundColor(nastaveni.barva)
  2079.     myWindow.clear()
  2080.     term.setBackgroundColor (nastaveni.barva)
  2081.     term.setTextColor(colors.lime)
  2082.     term.setCursorPos(2,3)
  2083.     print "< Network"
  2084.     term.setTextColor(text.barva)
  2085.     term.setCursorPos(2,5)
  2086.     print "Modem"
  2087.     term.setCursorPos(2,7)
  2088.     print "Label"
  2089.    
  2090.     if fs.exists ("/system/RAM/setdata")then
  2091.      local data = fs.open ("/system/RAM/setdata", "r")
  2092.         funkce = data.readLine ()
  2093.         data.close ()
  2094.         end
  2095.        
  2096.        
  2097.         if funkce == "modem" then
  2098.             modem ()
  2099.         elseif funkce == "label" then
  2100.             label ()
  2101.         end
  2102.        
  2103.     modem ()
  2104.     end
  2105.  
  2106. function language ()
  2107.     funkce = "language"
  2108.         local myWindow = window.create(term.current(),16,1,37,19)
  2109.     myWindow.setBackgroundColor(colors.white)
  2110.     myWindow.clear()
  2111.         local myWindow = window.create(term.current(),1,1,16,19)
  2112.     myWindow.setBackgroundColor(colors.gray)
  2113.     local myWindow = window.create(term.current(),1,1,15,19)
  2114.     myWindow.setBackgroundColor(nastaveni.barva)
  2115.     myWindow.clear()
  2116.     term.setBackgroundColor (nastaveni.barva)
  2117.     term.setTextColor(colors.lime)
  2118.     term.setCursorPos(2,3)
  2119.     print "< Language"
  2120.     term.setTextColor(text.barva)
  2121.     term.setCursorPos(2,5)
  2122.     print "Account"
  2123.     term.setCursorPos(2,7)
  2124.     print "Primary"
  2125.    
  2126.       while true do
  2127.     local event, button, x, y = os.pullEvent("mouse_click")
  2128.     xy = x..","..y
  2129.      
  2130.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  2131.     setupmenu ()
  2132.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  2133.     fs.delete ("/system/RAM/jazyk1")
  2134.     shell.run ("pastebin get uVRBmFvy /system/RAM/jazyk1")
  2135.     shell.run ("/system/RAM/jazyk1")
  2136.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  2137.     fs.delete ("/system/RAM/jazyk2")
  2138.     shell.run ("pastebin get uVRBmFvy /system/RAM/jazyk2")
  2139.     shell.run ("/system/RAM/jazyk2")
  2140.     else
  2141.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  2142.     paintutils.drawPixel (51,1, colors.red)
  2143.     term.setCursorPos (51,1)
  2144.     print "*"
  2145.     paintutils.drawPixel (50,1, colors.lightGray)
  2146.     term.setCursorPos (50,1)
  2147.     print "<"
  2148.     paintutils.drawPixel (49,1, colors.lightGray)
  2149.     term.setCursorPos (49,1)
  2150.     print "_"
  2151.  
  2152.              while true do
  2153.         local event, button, x, y = os.pullEvent("mouse_click")
  2154.         xy = x..","..y
  2155.        
  2156.         if x == 51 and y == 1 then
  2157.             ukonceni ()
  2158.         elseif x == 50 and y == 1 then
  2159.             setupmenu ()
  2160.         elseif x == 49 and y == 1 then
  2161.             minimalizace ()
  2162.         else
  2163.         language ()
  2164.             end
  2165.             end
  2166. end
  2167. end
  2168.     end
  2169.  
  2170. function updates ()
  2171. funkce = "updates"
  2172.         local myWindow = window.create(term.current(),16,1,37,19)
  2173.     myWindow.setBackgroundColor(colors.white)
  2174.     myWindow.clear()
  2175.         local myWindow = window.create(term.current(),1,1,16,19)
  2176.     myWindow.setBackgroundColor(colors.gray)
  2177.     myWindow.clear()
  2178.     local myWindow = window.create(term.current(),1,1,15,19)
  2179.     myWindow.setBackgroundColor(nastaveni.barva)
  2180.     myWindow.clear()
  2181.     term.setBackgroundColor (nastaveni.barva)
  2182.     term.setTextColor(colors.lime)
  2183.     term.setCursorPos(2,3)
  2184.     print "< Update and"
  2185.     term.setCursorPos(2,4)
  2186.     print "  Recovery"
  2187.     term.setTextColor(text.barva)
  2188.     term.setCursorPos(2,6)
  2189.     print "Update"
  2190.     term.setCursorPos(2,8)
  2191.     print "Recovery"
  2192.        
  2193.       while true do
  2194.     local event, button, x, y = os.pullEvent("mouse_click")
  2195.     xy = x..","..y
  2196.      
  2197.     if x >= 2 and x <= 16 and y >= 3 and y <= 4 and button == 1 then
  2198.     setupmenu ()
  2199.     elseif x >= 2 and x <= 16 and y == 6 and button == 1 then
  2200.     update ()
  2201.     elseif x >= 2 and x <= 16 and y == 8 and button == 1 then
  2202.     term.setBackgroundColor(colors.lime)
  2203.     shell.run ("rename /startup startup1")
  2204.     myWindow.setCursorPos(2,9)
  2205.     shell.run ("pastebin get e7tTfKX3 /startup")
  2206.     restart ()
  2207.     else
  2208.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  2209.     paintutils.drawPixel (51,1, colors.red)
  2210.     term.setCursorPos (51,1)
  2211.     print "*"
  2212.     paintutils.drawPixel (50,1, colors.lightGray)
  2213.     term.setCursorPos (50,1)
  2214.     print "<"
  2215.     paintutils.drawPixel (49,1, colors.lightGray)
  2216.     term.setCursorPos (49,1)
  2217.     print "_"
  2218.  
  2219.              while true do
  2220.         local event, button, x, y = os.pullEvent("mouse_click")
  2221.         xy = x..","..y
  2222.        
  2223.         if x == 51 and y == 1 then
  2224.             ukonceni ()
  2225.         elseif x == 50 and y == 1 then
  2226.             setupmenu ()
  2227.         elseif x == 49 and y == 1 then
  2228.             minimalizace ()
  2229.         else
  2230.         updates ()
  2231.             end
  2232.             end
  2233. end
  2234. end
  2235.     end
  2236.    
  2237. function update ()
  2238. funkce = "updates"
  2239.     term.setBackgroundColor(nastaveni.barva)
  2240.        term.setCursorPos(1,1)
  2241.        print "               "
  2242.        paintutils.drawPixel(16, 1, colors.gray)
  2243.        if not fs.exists ("/system/.core/update") then
  2244.            data = fs.open ("/system/.core/update", "w")
  2245.            data.writeLine ("0")
  2246.            data.close ()
  2247.     local myWindow = window.create(term.current(),17,1,37,19)
  2248.     myWindow.setBackgroundColor(colors.white)
  2249.     myWindow.clear()
  2250.     term.setTextColor(colors.black)
  2251.     myWindow.setCursorPos (2,5)
  2252.     print "Update"
  2253.     while true do
  2254.         local event, button, x, y = os.pullEvent("mouse_click")
  2255.         xy = x..","..y
  2256.  
  2257.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  2258.     setupmenu ()
  2259.     elseif x >= 2 and x <= 16 and y == 6 and button == 1 then
  2260.     update ()
  2261.   elseif x >= 2 and x <= 16 and y == 8 and button == 1 then
  2262.      term.setBackgroundColor(colors.lime)
  2263.     shell.run ("rename /startup startup1")
  2264.     myWindow.setCursorPos(2,9)
  2265.     shell.run ("pastebin get e7tTfKX3 /startup")
  2266.     restart ()
  2267.     else
  2268.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  2269.     paintutils.drawPixel (51,1, colors.red)
  2270.     term.setTextColor(colors.white)
  2271.     term.setCursorPos (51,1)
  2272.     print "*"
  2273.     paintutils.drawPixel (50,1, colors.lightGray)
  2274.     term.setCursorPos (50,1)
  2275.     print "<"
  2276.     paintutils.drawPixel (49,1, colors.lightGray)
  2277.     term.setCursorPos (49,1)
  2278.     print "_"
  2279.  
  2280.              while true do
  2281.         local event, button, x, y = os.pullEvent("mouse_click")
  2282.         xy = x..","..y
  2283.        
  2284.         if x == 51 and y == 1 then
  2285.             ukonceni ()
  2286.         elseif x == 50 and y == 1 then
  2287.             updates ()
  2288.         elseif x == 49 and y == 1 then
  2289.             minimalizace ()
  2290.         else
  2291.         update ()
  2292.             end
  2293.             end
  2294. end
  2295. end
  2296. end
  2297. end
  2298.  
  2299. function apps ()
  2300. funkce = "apps"
  2301.         local myWindow = window.create(term.current(),16,1,37,19)
  2302.     myWindow.setBackgroundColor(colors.white)
  2303.     myWindow.clear()
  2304.         local myWindow = window.create(term.current(),1,1,16,19)
  2305.     myWindow.setBackgroundColor(colors.gray)
  2306.     myWindow.clear()
  2307.     local myWindow = window.create(term.current(),1,1,15,19)
  2308.     myWindow.setBackgroundColor(nastaveni.barva)
  2309.     myWindow.clear()
  2310.     term.setBackgroundColor (nastaveni.barva)
  2311.     term.setTextColor(colors.lime)
  2312.     term.setCursorPos(2,3)
  2313.     print "< Store"
  2314.     term.setTextColor(text.barva)
  2315.     term.setCursorPos(2,5)
  2316.     print "Apps"
  2317.     term.setCursorPos(2,7)
  2318.     print "Menu"
  2319.        
  2320.          if fs.exists ("/system/RAM/setdata")then
  2321.      local data = fs.open ("/system/RAM/setdata", "r")
  2322.         funkce = data.readLine ()
  2323.         data.close ()
  2324.         end
  2325.        
  2326.        
  2327.         if funkce == "downloader" then
  2328.             downloader ()
  2329.         elseif funkce == "setprograms" then
  2330.             setprograms ()
  2331.         end
  2332.        
  2333.     downloader ()
  2334. end
  2335.  
  2336. function setprograms ()
  2337. funkce = "setprograms"
  2338.     function apply ()
  2339.         data = fs.open ("/system/.core/lsprogram", "w")
  2340.         data.writeLine(nmenu1)
  2341.         data.writeLine(npath1)
  2342.         data.writeLine(nmenu2)
  2343.         data.writeLine(npath2)
  2344.         data.writeLine(nmenu3)
  2345.         data.writeLine(npath3)
  2346.         data.writeLine(nmenu4)
  2347.         data.writeLine(npath4)
  2348.         data.writeLine(nmenu5)
  2349.         data.writeLine(npath5)
  2350.         data.writeLine(nmenu6)
  2351.         data.writeLine(npath6)
  2352.         data.writeLine(nmenu7)
  2353.         data.writeLine(npath7)
  2354.         data.close ()
  2355.        
  2356.         term.setCursorPos (20, 17)
  2357.         term.setBackgroundColor(colors.white)
  2358.         term.setTextColor(colors.lime)
  2359.         print "Successfull"
  2360.         sleep (1)
  2361.         setprograms ()
  2362.         end
  2363.  
  2364.             local data = fs.open ("/system/.core/lsprogram", "r")
  2365.         menu1 = data.readLine ()
  2366.         path1 = data.readLine ()
  2367.         menu2 = data.readLine ()
  2368.         path2 = data.readLine ()
  2369.         menu3 = data.readLine ()
  2370.         path3 = data.readLine ()
  2371.         menu4 = data.readLine ()
  2372.         path4 = data.readLine ()
  2373.         menu5 = data.readLine ()
  2374.         path5 = data.readLine ()
  2375.         menu6 = data.readLine ()
  2376.         path6 = data.readLine ()
  2377.         menu7 = data.readLine ()
  2378.         path7 = data.readLine ()
  2379.         nmenu1 = menu1
  2380.         npath1 = path1
  2381.         nmenu2 = menu2
  2382.         npath2 = path2
  2383.         nmenu3 = menu3
  2384.         npath3 = path3
  2385.         nmenu4 = menu4
  2386.         npath4 = path4
  2387.         nmenu5 = menu5
  2388.         npath5 = path5
  2389.         nmenu6 = menu6
  2390.         npath6 = path6
  2391.         nmenu7 = menu7
  2392.         npath7 = path7
  2393.  
  2394.    
  2395.     term.setBackgroundColor(nastaveni.barva)
  2396.        term.setCursorPos(1,1)
  2397.        print "               "
  2398.        paintutils.drawPixel(16, 1, colors.gray)
  2399.     local myWindow = window.create(term.current(),17,1,37,19)
  2400.     myWindow.setBackgroundColor(colors.white)
  2401.     myWindow.clear()
  2402.     term.setTextColor(colors.black)
  2403.     term.setBackgroundColor(colors.white)
  2404.     myWindow.setCursorPos (1,3)
  2405.     print "1.position"
  2406.     myWindow.setCursorPos (1,5)
  2407.     print "2.position"
  2408.     myWindow.setCursorPos (1,7)
  2409.     print "3.position"
  2410.     myWindow.setCursorPos (1,9)
  2411.     print "4.position"
  2412.     myWindow.setCursorPos (1,11)
  2413.     print "5.position"
  2414.     myWindow.setCursorPos (1,13)
  2415.     print "6.position"
  2416.     myWindow.setCursorPos (1,15)
  2417.     print "7.position"
  2418.     term.setTextColor(colors.white)
  2419.     term.setBackgroundColor(colors.lightGray)
  2420.     myWindow.setCursorPos (12,3)
  2421.     print"            "
  2422.     myWindow.setCursorPos (12,5)
  2423.     print"            "
  2424.     myWindow.setCursorPos (12,7)
  2425.     print"            "
  2426.     myWindow.setCursorPos (12,9)
  2427.     print"            "
  2428.     myWindow.setCursorPos (12,11)
  2429.     print"            "
  2430.     myWindow.setCursorPos (12,13)
  2431.     print"            "
  2432.     myWindow.setCursorPos (12,15)
  2433.     print"            "
  2434.     myWindow.setCursorPos (13,3)
  2435.     print(nmenu1)
  2436.     myWindow.setCursorPos (13,5)
  2437.     print(nmenu2)
  2438.     myWindow.setCursorPos (13,7)
  2439.     print(nmenu3)
  2440.     myWindow.setCursorPos (13,9)
  2441.     print(nmenu4)
  2442.     myWindow.setCursorPos (13,11)
  2443.     print(nmenu5)
  2444.     myWindow.setCursorPos (13,13)
  2445.     print(nmenu6)
  2446.     myWindow.setCursorPos (13,15)
  2447.     print(nmenu7)
  2448.     term.setBackgroundColor(colors.red)
  2449.     term.setTextColor(colors.white)
  2450.     myWindow.setCursorPos (26,3)
  2451.     print "*"
  2452.     myWindow.setCursorPos (26,5)
  2453.     print "*"
  2454.     myWindow.setCursorPos (26,7)
  2455.     print "*"
  2456.     myWindow.setCursorPos (26,9)
  2457.     print "*"
  2458.     myWindow.setCursorPos (26,11)
  2459.     print "*"
  2460.     myWindow.setCursorPos (26,13)
  2461.     print "*"
  2462.     myWindow.setCursorPos (26,15)
  2463.     print "*"
  2464.     while true do
  2465.         local event, button, x, y = os.pullEvent("mouse_click")
  2466.         xy = x..","..y
  2467.  
  2468.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  2469.     setupmenu ()
  2470.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  2471.     downloader ()
  2472.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  2473.     setprograms ()
  2474.     elseif x == 42 and y == 3 and button == 1 then
  2475.     nmenu1 = ""
  2476.     npath1 = ""
  2477.    
  2478.     apply ()
  2479.     elseif x == 42 and y == 5 and button == 1 then
  2480.     nmenu2 = ""
  2481.     npath2 = ""
  2482.     apply ()
  2483.     elseif x == 42 and y == 7 and button == 1 then
  2484.     nmenu3 = ""
  2485.     npath3 = ""
  2486.     apply ()
  2487.     elseif x == 42 and y == 9 and button == 1 then
  2488.     nmenu4 = ""
  2489.     npath4 = ""
  2490.     apply ()
  2491.     elseif x == 42 and y == 11 and button == 1 then
  2492.     nmenu5 = ""
  2493.     npath5 = ""
  2494.     apply ()
  2495.     elseif x == 42 and y == 13 and button == 1 then
  2496.     nmenu6 = ""
  2497.     npath6 = ""
  2498.     apply ()
  2499.     elseif x == 42 and y == 15 and button == 1 then
  2500.     nmenu7 = ""
  2501.     npath7 = ""
  2502.     apply ()
  2503.     elseif x >= 29 and x <= 39 and y == 3 and button == 1 then
  2504.     local myWindow = window.create(term.current(),22,7,22,10)
  2505.     myWindow.setBackgroundColor(colors.gray)
  2506.     myWindow.clear()
  2507.     local myWindow = window.create(term.current(),21,6,22,10)
  2508.     myWindow.setBackgroundColor(colors.lime)
  2509.     myWindow.clear()
  2510.     local myWindow = window.create(term.current(),22,7,20,8)
  2511.     myWindow.setBackgroundColor(colors.white)
  2512.     myWindow.clear()
  2513.     paintutils.drawPixel (42,6, colors.red)
  2514.     term.setCursorPos(42,6)
  2515.     print "*"
  2516.     term.setBackgroundColor(colors.white)
  2517.     term.setTextColor(colors.black)
  2518.     myWindow.setCursorPos (6,1)
  2519.     print"1. Posion"
  2520.     myWindow.setCursorPos (2,3)
  2521.     print"Name"
  2522.     myWindow.setCursorPos (2,5)
  2523.     print"Path:"
  2524.     myWindow.setCursorPos (10,8)
  2525.     print"OK"
  2526.     term.setTextColor(colors.white)
  2527.     term.setBackgroundColor(colors.lightGray)
  2528.     myWindow.setCursorPos (2,4)
  2529.     print"            "
  2530.     myWindow.setCursorPos (2,4)
  2531.     print(menu1)
  2532.     myWindow.setCursorPos (2,6)
  2533.     print"                  "
  2534.     myWindow.setCursorPos (2,6)
  2535.     print(path1)
  2536.     term.setBackgroundColor(colors.gray)
  2537.     while true do
  2538.         local event, button, x, y = os.pullEvent("mouse_click")
  2539.         xy = x..","..y
  2540.  
  2541.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2542.             myWindow.setCursorPos (2,4)
  2543.             print"            "
  2544.             myWindow.setCursorPos (2,4)
  2545.             nmenu1 = read ()
  2546.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2547.             myWindow.setCursorPos (2,6)
  2548.             print"                  "
  2549.             myWindow.setCursorPos (2,6)
  2550.             npath1 = read ()
  2551.             elseif x == 42 and y == 6 and button == 1 then
  2552.            
  2553.             setprograms ()
  2554.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2555.            
  2556.             apply ()
  2557.             end
  2558.             end
  2559.     elseif x >= 29 and x <= 39 and y == 5 and button == 1 then
  2560.     local myWindow = window.create(term.current(),22,7,22,10)
  2561.     myWindow.setBackgroundColor(colors.gray)
  2562.     myWindow.clear()
  2563.     local myWindow = window.create(term.current(),21,6,22,10)
  2564.     myWindow.setBackgroundColor(colors.lime)
  2565.     myWindow.clear()
  2566.     local myWindow = window.create(term.current(),22,7,20,8)
  2567.     myWindow.setBackgroundColor(colors.white)
  2568.     myWindow.clear()
  2569.     paintutils.drawPixel (42,6, colors.red)
  2570.     term.setCursorPos(42,6)
  2571.     print "*"
  2572.     term.setBackgroundColor(colors.white)
  2573.     term.setTextColor(colors.black)
  2574.     myWindow.setCursorPos (6,1)
  2575.     print"2. Posion"
  2576.     myWindow.setCursorPos (2,3)
  2577.     print"Name"
  2578.     myWindow.setCursorPos (2,5)
  2579.     print"Path:"
  2580.     myWindow.setCursorPos (10,8)
  2581.     print"OK"
  2582.     term.setTextColor(colors.white)
  2583.     term.setBackgroundColor(colors.lightGray)
  2584.     myWindow.setCursorPos (2,4)
  2585.     print"            "
  2586.     myWindow.setCursorPos (2,4)
  2587.     print(menu2)
  2588.     myWindow.setCursorPos (2,6)
  2589.     print"                  "
  2590.     myWindow.setCursorPos (2,6)
  2591.     print(path2)
  2592.     term.setBackgroundColor(colors.gray)
  2593.     while true do
  2594.         local event, button, x, y = os.pullEvent("mouse_click")
  2595.         xy = x..","..y
  2596.  
  2597.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2598.             myWindow.setCursorPos (2,4)
  2599.             print"            "
  2600.             myWindow.setCursorPos (2,4)
  2601.             nmenu2 = read ()
  2602.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2603.             myWindow.setCursorPos (2,6)
  2604.             print"                  "
  2605.             myWindow.setCursorPos (2,6)
  2606.             npath2 = read ()
  2607.             elseif x == 42 and y == 6 and button == 1 then
  2608.            
  2609.             setprograms ()
  2610.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2611.            
  2612.             apply ()
  2613.             end
  2614.             end
  2615.     elseif x >= 29 and x <= 39 and y == 7 and button == 1 then
  2616.     local myWindow = window.create(term.current(),22,7,22,10)
  2617.     myWindow.setBackgroundColor(colors.gray)
  2618.     myWindow.clear()
  2619.     local myWindow = window.create(term.current(),21,6,22,10)
  2620.     myWindow.setBackgroundColor(colors.lime)
  2621.     myWindow.clear()
  2622.     local myWindow = window.create(term.current(),22,7,20,8)
  2623.     myWindow.setBackgroundColor(colors.white)
  2624.     myWindow.clear()
  2625.     paintutils.drawPixel (42,6, colors.red)
  2626.     term.setCursorPos(42,6)
  2627.     print "*"
  2628.     term.setBackgroundColor(colors.white)
  2629.     term.setTextColor(colors.black)
  2630.     myWindow.setCursorPos (6,1)
  2631.     print"3. Posion"
  2632.     myWindow.setCursorPos (2,3)
  2633.     print"Name"
  2634.     myWindow.setCursorPos (2,5)
  2635.     print"Path:"
  2636.     myWindow.setCursorPos (10,8)
  2637.     print"OK"
  2638.     term.setTextColor(colors.white)
  2639.     term.setBackgroundColor(colors.lightGray)
  2640.     myWindow.setCursorPos (2,4)
  2641.     print"            "
  2642.     myWindow.setCursorPos (2,4)
  2643.     print(menu3)
  2644.     myWindow.setCursorPos (2,6)
  2645.     print"                  "
  2646.     myWindow.setCursorPos (2,6)
  2647.     print(path3)
  2648.     term.setBackgroundColor(colors.gray)
  2649.     while true do
  2650.         local event, button, x, y = os.pullEvent("mouse_click")
  2651.         xy = x..","..y
  2652.  
  2653.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2654.             myWindow.setCursorPos (2,4)
  2655.             print"            "
  2656.             myWindow.setCursorPos (2,4)
  2657.             nmenu3 = read ()
  2658.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2659.             myWindow.setCursorPos (2,6)
  2660.             print"                  "
  2661.             myWindow.setCursorPos (2,6)
  2662.             npath3 = read ()
  2663.             elseif x == 42 and y == 6 and button == 1 then
  2664.            
  2665.             setprograms ()
  2666.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2667.            
  2668.             apply ()
  2669.             end
  2670.             end
  2671.     elseif x >= 29 and x <= 39 and y == 9 and button == 1 then
  2672.     local myWindow = window.create(term.current(),22,7,22,10)
  2673.     myWindow.setBackgroundColor(colors.gray)
  2674.     myWindow.clear()
  2675.     local myWindow = window.create(term.current(),21,6,22,10)
  2676.     myWindow.setBackgroundColor(colors.lime)
  2677.     myWindow.clear()
  2678.     local myWindow = window.create(term.current(),22,7,20,8)
  2679.     myWindow.setBackgroundColor(colors.white)
  2680.     myWindow.clear()
  2681.     paintutils.drawPixel (42,6, colors.red)
  2682.     term.setCursorPos(42,6)
  2683.     print "*"
  2684.     term.setBackgroundColor(colors.white)
  2685.     term.setTextColor(colors.black)
  2686.     myWindow.setCursorPos (6,1)
  2687.     print"4. Posion"
  2688.     myWindow.setCursorPos (2,3)
  2689.     print"Name"
  2690.     myWindow.setCursorPos (2,5)
  2691.     print"Path:"
  2692.     myWindow.setCursorPos (10,8)
  2693.     print"OK"
  2694.     term.setTextColor(colors.white)
  2695.     term.setBackgroundColor(colors.lightGray)
  2696.     myWindow.setCursorPos (2,4)
  2697.     print"            "
  2698.     myWindow.setCursorPos (2,4)
  2699.     print(menu4)
  2700.     myWindow.setCursorPos (2,6)
  2701.     print"                  "
  2702.     myWindow.setCursorPos (2,6)
  2703.     print(path4)
  2704.     term.setBackgroundColor(colors.gray)
  2705.     while true do
  2706.         local event, button, x, y = os.pullEvent("mouse_click")
  2707.         xy = x..","..y
  2708.  
  2709.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2710.             myWindow.setCursorPos (2,4)
  2711.             print"            "
  2712.             myWindow.setCursorPos (2,4)
  2713.             nmenu4 = read ()
  2714.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2715.             myWindow.setCursorPos (2,6)
  2716.             print"                  "
  2717.             myWindow.setCursorPos (2,6)
  2718.             npath4 = read ()
  2719.             elseif x == 42 and y == 6 and button == 1 then
  2720.            
  2721.             setprograms ()
  2722.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2723.            
  2724.             apply ()
  2725.             end
  2726.             end
  2727.     elseif x >= 29 and x <= 39 and y == 11 and button == 1 then
  2728.     local myWindow = window.create(term.current(),22,7,22,10)
  2729.     myWindow.setBackgroundColor(colors.gray)
  2730.     myWindow.clear()
  2731.     local myWindow = window.create(term.current(),21,6,22,10)
  2732.     myWindow.setBackgroundColor(colors.lime)
  2733.     myWindow.clear()
  2734.     local myWindow = window.create(term.current(),22,7,20,8)
  2735.     myWindow.setBackgroundColor(colors.white)
  2736.     myWindow.clear()
  2737.     paintutils.drawPixel (42,6, colors.red)
  2738.     term.setCursorPos(42,6)
  2739.     print "*"
  2740.     term.setBackgroundColor(colors.white)
  2741.     term.setTextColor(colors.black)
  2742.     myWindow.setCursorPos (6,1)
  2743.     print"5. Posion"
  2744.     myWindow.setCursorPos (2,3)
  2745.     print"Name"
  2746.     myWindow.setCursorPos (2,5)
  2747.     print"Path:"
  2748.     myWindow.setCursorPos (10,8)
  2749.     print"OK"
  2750.     term.setTextColor(colors.white)
  2751.     term.setBackgroundColor(colors.lightGray)
  2752.     myWindow.setCursorPos (2,4)
  2753.     print"            "
  2754.     myWindow.setCursorPos (2,4)
  2755.     print(menu5)
  2756.     myWindow.setCursorPos (2,6)
  2757.     print"                  "
  2758.     myWindow.setCursorPos (2,6)
  2759.     print(path5)
  2760.     term.setBackgroundColor(colors.gray)
  2761.     while true do
  2762.         local event, button, x, y = os.pullEvent("mouse_click")
  2763.         xy = x..","..y
  2764.  
  2765.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2766.             myWindow.setCursorPos (2,4)
  2767.             print"            "
  2768.             myWindow.setCursorPos (2,4)
  2769.             nmenu5 = read ()
  2770.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2771.             myWindow.setCursorPos (2,6)
  2772.             print"                  "
  2773.             myWindow.setCursorPos (2,6)
  2774.             npath5 = read ()
  2775.             elseif x == 42 and y == 6 and button == 1 then
  2776.            
  2777.             setprograms ()
  2778.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2779.            
  2780.             apply ()
  2781.             end
  2782.             end    
  2783.     elseif x >= 29 and x <= 39 and y == 13 and button == 1 then
  2784.     local myWindow = window.create(term.current(),22,7,22,10)
  2785.     myWindow.setBackgroundColor(colors.gray)
  2786.     myWindow.clear()
  2787.     local myWindow = window.create(term.current(),21,6,22,10)
  2788.     myWindow.setBackgroundColor(colors.lime)
  2789.     myWindow.clear()
  2790.     local myWindow = window.create(term.current(),22,7,20,8)
  2791.     myWindow.setBackgroundColor(colors.white)
  2792.     myWindow.clear()
  2793.     paintutils.drawPixel (42,6, colors.red)
  2794.     term.setCursorPos(42,6)
  2795.     print "*"
  2796.     term.setBackgroundColor(colors.white)
  2797.     term.setTextColor(colors.black)
  2798.     myWindow.setCursorPos (6,1)
  2799.     print"6. Posion"
  2800.     myWindow.setCursorPos (2,3)
  2801.     print"Name"
  2802.     myWindow.setCursorPos (2,5)
  2803.     print"Path:"
  2804.     myWindow.setCursorPos (10,8)
  2805.     print"OK"
  2806.     term.setTextColor(colors.white)
  2807.     term.setBackgroundColor(colors.lightGray)
  2808.     myWindow.setCursorPos (2,4)
  2809.     print"            "
  2810.     myWindow.setCursorPos (2,4)
  2811.     print(menu6)
  2812.     myWindow.setCursorPos (2,6)
  2813.     print"                  "
  2814.     myWindow.setCursorPos (2,6)
  2815.     print(path6)
  2816.     term.setBackgroundColor(colors.gray)
  2817.     while true do
  2818.         local event, button, x, y = os.pullEvent("mouse_click")
  2819.         xy = x..","..y
  2820.  
  2821.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2822.             myWindow.setCursorPos (2,4)
  2823.             print"            "
  2824.             myWindow.setCursorPos (2,4)
  2825.             nmenu6 = read ()
  2826.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2827.             myWindow.setCursorPos (2,6)
  2828.             print"                  "
  2829.             myWindow.setCursorPos (2,6)
  2830.             npath6 = read ()
  2831.             elseif x == 42 and y == 6 and button == 1 then
  2832.            
  2833.             setprograms ()
  2834.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2835.            
  2836.             apply ()
  2837.             end
  2838.             end
  2839.     elseif x >= 29 and x <= 39 and y == 15 and button == 1 then
  2840.     local myWindow = window.create(term.current(),22,7,22,10)
  2841.     myWindow.setBackgroundColor(colors.gray)
  2842.     myWindow.clear()
  2843.     local myWindow = window.create(term.current(),21,6,22,10)
  2844.     myWindow.setBackgroundColor(colors.lime)
  2845.     myWindow.clear()
  2846.     local myWindow = window.create(term.current(),22,7,20,8)
  2847.     myWindow.setBackgroundColor(colors.white)
  2848.     myWindow.clear()
  2849.     paintutils.drawPixel (42,6, colors.red)
  2850.     term.setCursorPos(42,6)
  2851.     print "*"
  2852.     term.setBackgroundColor(colors.white)
  2853.     term.setTextColor(colors.black)
  2854.     myWindow.setCursorPos (6,1)
  2855.     print"7. Posion"
  2856.     myWindow.setCursorPos (2,3)
  2857.     print"Name"
  2858.     myWindow.setCursorPos (2,5)
  2859.     print"Path:"
  2860.     myWindow.setCursorPos (10,8)
  2861.     print"OK"
  2862.     term.setTextColor(colors.white)
  2863.     term.setBackgroundColor(colors.lightGray)
  2864.     myWindow.setCursorPos (2,4)
  2865.     print"            "
  2866.     myWindow.setCursorPos (2,4)
  2867.     print(menu7)
  2868.     myWindow.setCursorPos (2,6)
  2869.     print"                  "
  2870.     myWindow.setCursorPos (2,6)
  2871.     print(path7)
  2872.     term.setBackgroundColor(colors.gray)
  2873.     while true do
  2874.         local event, button, x, y = os.pullEvent("mouse_click")
  2875.         xy = x..","..y
  2876.  
  2877.             if x >= 23 and x <= 40 and y == 10 and button == 1 then
  2878.             myWindow.setCursorPos (2,4)
  2879.             print"            "
  2880.             myWindow.setCursorPos (2,4)
  2881.             nmenu7 = read ()
  2882.             elseif x >= 23 and x <= 40 and y == 12 and button == 1 then
  2883.             myWindow.setCursorPos (2,6)
  2884.             print"                  "
  2885.             myWindow.setCursorPos (2,6)
  2886.             npath7 = read ()
  2887.             elseif x == 42 and y == 6 and button == 1 then
  2888.            
  2889.             setprograms ()
  2890.             elseif x >= 30 and x <= 32 and y == 14 and button == 1 then
  2891.            
  2892.             apply ()
  2893.             end
  2894.             end
  2895.     else
  2896.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  2897.     paintutils.drawPixel (51,1, colors.red)
  2898.     term.setTextColor(colors.white)
  2899.     term.setCursorPos (51,1)
  2900.     print "*"
  2901.     paintutils.drawPixel (50,1, colors.lightGray)
  2902.     term.setCursorPos (50,1)
  2903.     print "<"
  2904.     paintutils.drawPixel (49,1, colors.lightGray)
  2905.     term.setCursorPos (49,1)
  2906.     print "_"
  2907.  
  2908.              while true do
  2909.         local event, button, x, y = os.pullEvent("mouse_click")
  2910.         xy = x..","..y
  2911.        
  2912.         if x == 51 and y == 1 then
  2913.             ukonceni ()
  2914.         elseif x == 50 and y == 1 then
  2915.             apps ()
  2916.         elseif x == 49 and y == 1 then
  2917.             minimalizace ()
  2918.         else
  2919.         setprograms ()
  2920.             end
  2921.             end
  2922. end
  2923. end
  2924. end
  2925.  
  2926. function downloader ()
  2927. funkce = "downloader"
  2928.     fs.delete ("/system/RAM/store")
  2929.     term.setBackgroundColor(colors.white)
  2930.     term.setTextColor(colors.white)
  2931.     term.setCursorPos(18,9)
  2932.    shell.run ("pastebin get y4Xv9b1Y /system/RAM/store")
  2933.            local myWindow = window.create(term.current(),16,1,37,19)
  2934.     myWindow.setBackgroundColor(colors.white)
  2935.     myWindow.clear()
  2936.         local myWindow = window.create(term.current(),1,1,16,19)
  2937.     myWindow.setBackgroundColor(colors.gray)
  2938.     myWindow.clear()
  2939.     local myWindow = window.create(term.current(),1,1,15,19)
  2940.     myWindow.setBackgroundColor(nastaveni.barva)
  2941.     myWindow.clear()
  2942.     term.setBackgroundColor (nastaveni.barva)
  2943.     term.setTextColor(colors.lime)
  2944.     term.setCursorPos(2,3)
  2945.     print "< Store"
  2946.     term.setTextColor(text.barva)
  2947.     term.setCursorPos(2,5)
  2948.     print "Apps"
  2949.     term.setCursorPos(2,7)
  2950.     print "Menu"
  2951.     if fs.exists ("/system/RAM/store") then
  2952.    shell.run ("/system/RAM/store")
  2953.     else
  2954.     term.setTextColor(colors.red)
  2955.     term.setBackgroundColor(colors.white)
  2956.     term.setCursorPos (23,8)
  2957.     print "No internet connect!"
  2958.     term.setTextColor(colors.white)
  2959.     sleep (1)
  2960.     setprograms ()
  2961.     end
  2962. end
  2963.  
  2964. function odhlasit ()
  2965.     fs.makeDir("/system/RAM/odhlasit")
  2966.         shell.run ("/system/api/modes")
  2967. end
  2968.  
  2969. start ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement