Advertisement
pepeknamornik

program manager app

Jun 20th, 2019 (edited)
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 46.38 KB | None | 0 0
  1. stahovani = nil
  2. pastebincode = nil
  3. kod1 = ""
  4. filename1 = nil
  5. akce = nil
  6.    
  7. local function Barvy()
  8.     if fs.exists ("/C/system/Users/"..user.."/.Registry/colors") then
  9.     local data = fs.open("/C/system/Users/"..user.."/.Registry/colors", "r")
  10.     BarPoz = tonumber(data.readLine())
  11.     BarTxt = tonumber(data.readLine())
  12.     data.close()
  13.     end
  14.     if BarPoz == nil or BarTxt == nil then BarPoz = 2048 BarTxt = 1 end
  15. end
  16.  
  17. local function prc(text, y)
  18.   local w = term.getSize()
  19.   local _, cy = term.getCursorPos()
  20.   term.setCursorPos(math.ceil((w-#text)/2), y or cy)
  21.   write(text)
  22. end
  23.  
  24. local f=fs.open("/C/system/RAM/user","r")
  25. user=f.readLine()
  26. f.close()
  27.    
  28. function minimalizace ()
  29.  
  30.     if not fs.exists ("/C/system/.core/setting/mineditor") then
  31.     shell.run ("pastebin get EiKMubhV /system/.core/setting/mineditor")
  32.     minimalizace()
  33.     end
  34.    
  35.     if fs.exists ("/C/system/RAM/"..user.."/pmanager") then
  36.     fs.delete ("/C/system/RAM/"..user.."/pmanager")
  37.     end
  38.    
  39.     local data = fs.open ("/C/system/RAM/"..user.."/pmanager", "w")
  40.     data.writeLine(funkce)
  41.     data.close ()
  42.     local data = fs.open ("/C/system/RAM/"..user.."/prlists", "w")
  43.         data.writeLine ("Pmanager")
  44.         data.close ()
  45.     shell.run ("/C/system/.core/setting/mineditor")
  46. end
  47.  
  48.  
  49. function ukonceni ()
  50.     fs.delete ("/C/system/RAM/pmanager")
  51.     shell.run("/C/system/api/closeApp")
  52. end
  53.  
  54. function resus ()
  55.     if fs.exists ("/C/system/RAM/pmanager") then
  56.     local data = fs.open ("/C/system/RAM/pmanager", "r")
  57.             local funkce = data.readLine ()
  58.             data.close ()
  59.            
  60.         local myFuncs = {
  61.             ["downinstal"] = function()
  62.             downinstal ()
  63.             end,
  64.            
  65.             ["download"] = function()
  66.             download ()
  67.             end,
  68.            
  69.             ["upload"] = function()
  70.             upload ()
  71.             end,
  72.            
  73.             ["update"] = function()
  74.              update ()
  75.             end,
  76.            
  77.             ["uinstall"] = function()
  78.              uinstall ()
  79.             end,
  80.         }
  81.  
  82.         myFuncs[funkce]()
  83.         menud ()
  84.     end
  85. end
  86.  
  87.  
  88. function start ()
  89.     Barvy()
  90.     resus ()
  91.     term.setBackgroundColor(colors.white)
  92.     term.setTextColor(colors.black)
  93.     term.clear ()
  94.         if not fs.exists ("/C/Programs/PepekSoft/pmanager.nft") then
  95.         shell.run("pastebin get DUNBNhMh /C/Programs/PepekSoft/pmanager.nft")
  96.         end
  97.     local image = paintutils.loadImage("/C/Programs/PepekSoft/pmanager.nft")
  98.     paintutils.drawImage(image, 18, 4)
  99.     prc ("Programs manager", 16)
  100.     sleep (1)
  101.     menud ()
  102. end
  103.  
  104. function update ()
  105.     funkce = "update"
  106.     term.setBackgroundColor(colors.white)
  107.     term.setTextColor(colors.black)
  108.     term.clear ()
  109.     paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
  110.     term.setBackgroundColor(colors.white)
  111.     prc (" Program manager for Pepdroll OS ", 4)
  112.     term.setCursorPos (5,8)
  113.     print "Paste path file for upgrade:"
  114.     term.setBackgroundColor(colors.lightGray)
  115.     term.setCursorPos (5,10)
  116.     print "                                   "
  117.     term.setTextColor(colors.white)
  118.     term.setCursorPos (6,10)
  119.     print (kod2)
  120.     term.setBackgroundColor(colors.gray)
  121.     term.setCursorPos (41,18)
  122.     print " Upgrade "
  123.    
  124.     while true do
  125.        
  126.         local event, button, x, y = os.pullEvent("mouse_click")
  127.         xy = x..","..y
  128.    
  129.     if x >= 5 and x <= 45 and y == 10 and button == 1 then
  130.         term.setBackgroundColor(colors.gray)
  131.         term.setTextColor(colors.white)
  132.         term.setCursorPos (5,10)
  133.         print "                                   "
  134.         term.setCursorPos (6,10)
  135.         kod1 = io.read ()
  136.         upload ()
  137.     elseif x >= 41 and x <= 51 and y == 18 and button == 1 then
  138.     if akce == nil then
  139.     term.setBackgroundColor(colors.white)
  140.         term.setTextColor(colors.red)
  141.         term.setCursorPos(5,18)
  142.         if kod1 == "" then
  143.             prc ("Paste a valid path!")
  144.         elseif kod1 == " " then
  145.             prc ("Paste a valid path!")
  146.         elseif not fs.exists ("/"..kod1) then
  147.             prc ("File is not exists!")
  148.         else
  149.             term.setTextColor(colors.black)
  150.             term.setCursorPos(5,12)
  151.             ---------------------------------------------------------------zapsat------------------------------
  152.             paintutils.drawLine(1, 17, 51, 17, colors.white)
  153.             paintutils.drawLine(1, 18, 41, 18, colors.white)
  154.             term.setTextColor(colors.white)
  155.             term.setBackgroundColor(colors.gray)
  156.             term.setCursorPos (42,18)
  157.             print " Menu  "
  158.             akce = menu
  159.             end
  160.             else
  161.             akce = nil
  162.             menud ()
  163.             end
  164.     else
  165.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  166.     paintutils.drawPixel (51,1, colors.red)
  167.     term.setTextColor(colors.white)
  168.     term.setCursorPos (51,1)
  169.     print "*"
  170.     paintutils.drawPixel (50,1, colors.lightGray)
  171.     term.setCursorPos (50,1)
  172.     print "<"
  173.     paintutils.drawPixel (49,1, colors.lightGray)
  174.     term.setCursorPos (49,1)
  175.     print "_"
  176.              while true do
  177.         local event, button, x, y = os.pullEvent("mouse_click")
  178.         xy = x..","..y
  179.        
  180.         if x == 51 and y == 1 then
  181.             ukonceni ()
  182.         elseif x == 50 and y == 1 then
  183.             menud ()
  184.         elseif x == 49 and y == 1 then
  185.             minimalizace ()
  186.         else
  187.         update ()
  188.             end
  189.             end
  190.     end
  191. end
  192. end
  193.  
  194. function downinstal ()
  195.     funkce = "downinstal"
  196.         if yPos == nil then
  197.         yPos = 8
  198.     end
  199.         if filename1 == nil then
  200.             filename1 = filename
  201.             end
  202.         if yf == nil then
  203.             yf=12
  204.             end
  205.            
  206.     term.setBackgroundColor(colors.white)
  207.     term.setTextColor(colors.black)
  208.     term.clear ()
  209.     paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
  210.     term.setBackgroundColor(colors.white)
  211.     prc (" Program manager for Pepdroll OS ", 4)
  212.     term.setCursorPos(5,12)
  213.     print "Order: "
  214.     term.setCursorPos(5,6)
  215.     print "Include in the menu:"
  216.     term.setCursorPos(5,8)
  217.     print "Auto"
  218.     term.setCursorPos(5,9)
  219.     print "Manual"
  220.     term.setCursorPos(2,yPos)
  221.     print "->"
  222.     term.setCursorPos(20,8)
  223.     print "Name the file menu: "
  224.     term.setBackgroundColor(colors.lightGray)
  225.     term.setCursorPos(40,8)
  226.     print "           "
  227.     term.setTextColor(colors.white)
  228.     term.setCursorPos(40,8)
  229.     print (filename1)
  230.     term.setBackgroundColor(colors.gray)
  231.     term.setCursorPos (42,18)
  232.     print " Download "
  233.     term.setCursorPos (1,18)
  234.     print "   Back   "
  235.     local myWindow = window.create(term.current(),16,11,13,9)
  236.     myWindow.setBackgroundColor(colors.gray)
  237.     myWindow.clear()
  238.        
  239.     if fs.exists ("/C/system/Users/"..user.."/lsprogram") then
  240.         local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "r")
  241.                 menu1 = data.readLine ()
  242.                 path1 = data.readLine ()
  243.                 menu2 = data.readLine ()
  244.                 path2 = data.readLine ()
  245.                 menu3 = data.readLine ()
  246.                 path3 = data.readLine ()
  247.                 menu4 = data.readLine ()
  248.                 path4 = data.readLine ()
  249.                 menu5 = data.readLine ()
  250.                 path5 = data.readLine ()
  251.                 menu6 = data.readLine ()
  252.                 path6 = data.readLine ()
  253.                 menu7 = data.readLine ()
  254.                 path7 = data.readLine ()
  255.             data.close ()
  256.         end
  257.        
  258.     if yPos == 8 then
  259.         term.setTextColor(colors.lightGray)
  260.     else
  261.         term.setTextColor(colors.white)
  262.     end
  263.    
  264.     term.setCursorPos(17,12)
  265.     print (menu1)
  266.     term.setCursorPos(17,13)
  267.     print (menu2)
  268.     term.setCursorPos(17,14)
  269.     print (menu3)
  270.     term.setCursorPos(17,15)
  271.     print (menu4)
  272.     term.setCursorPos(17,16)
  273.     print (menu5)
  274.     term.setCursorPos(17,17)
  275.     print (menu6)
  276.     term.setCursorPos(17,18)
  277.     print (menu7)
  278.    
  279.     if yPos == 9 then
  280.         term.setBackgroundColor(colors.lightBlue)
  281.         term.setCursorPos (17, yf)
  282.         write "           "
  283.         term.setCursorPos (17, yf)
  284.         write (filename1)
  285.     end
  286.    
  287.   while true do
  288.        
  289.         local event, button, x, y = os.pullEvent("mouse_click")
  290.         xy = x..","..y
  291.  
  292.         if x >= 17 and x <= 27 and y == 12 and button == 1 then
  293.             yf = 12
  294.             pozice = "1"
  295.             downinstal ()
  296.         elseif x >= 17 and x <= 27 and y == 13 and button == 1 then
  297.             yf = 13
  298.             pozice = "2"
  299.             downinstal ()
  300.         elseif x >= 17 and x <= 27 and y == 14 and button == 1 then
  301.             yf = 14
  302.             pozice = "3"
  303.             downinstal ()
  304.         elseif x >= 17 and x <= 27 and y == 15 and button == 1 then
  305.             yf = 15
  306.             pozice = "4"
  307.             downinstal ()
  308.         elseif x >= 17 and x <= 27 and y == 16 and button == 1 then
  309.             yf = 16
  310.             pozice = "5"
  311.             downinstal ()
  312.         elseif x >= 17 and x <= 27 and y == 17 and button == 1 then
  313.             yf = 17
  314.             pozice = "6"
  315.             downinstal ()
  316.         elseif x >= 17 and x <= 27 and y == 18 and button == 1 then
  317.             yf = 18
  318.             pozice = "7"
  319.             downinstal ()
  320.         elseif x >= 5 and x <= 15 and y == 8 and button == 1 then
  321.             yPos = 8
  322.             downinstal ()
  323.         elseif x >= 5 and x <= 15 and y == 9 and button == 1 then
  324.             yPos = 9
  325.             downinstal ()
  326.         elseif x >= 40 and x <= 52 and y == 8 and button == 1 then
  327.             term.setBackgroundColor(colors.gray)
  328.             term.setTextColor(colors.white)
  329.             term.setCursorPos (40,8)
  330.             print "           "
  331.             term.setCursorPos (40,8)
  332.             filename1 = io.read ()
  333.             downinstal ()
  334.     elseif x >= 1 and x <= 11 and y == 18 and button == 1 then
  335.     filename1 = nil
  336.     download ()
  337.     elseif x >= 42 and x <= 51 and y == 18 and button == 1 then
  338.     if fs.exists("/C/system/RAM/editmenu") then
  339.         fs.delete ("/C/system/RAM/editmenu")
  340.     end
  341.         shell.run ("pastebin get",pastebincode,ulozit)
  342.         local data = fs.open ("/C/system/RAM/editmenu", "w")
  343.             data.writeLine (filename)
  344.             data.writeLine (ulozit)
  345.             data.writeLine (pastebincode)
  346.             data.writeLine (filename1)
  347.             data.writeLine (pozice)
  348.             data.close ()
  349.            
  350.         if pozice == "1" then
  351.         menu1 = filename1
  352.         path1 = ulozit
  353.         elseif pozice == "2" then
  354.         menu2 = filename1
  355.         path2 = ulozit
  356.         elseif pozice == "3" then
  357.         menu3 = filename1
  358.         path3 = ulozit
  359.         elseif pozice == "4" then
  360.         menu4 = filename1
  361.         path4 = ulozit
  362.         elseif pozice == "5" then
  363.         menu5 = filename1
  364.         path5 = ulozit
  365.         elseif pozice == "6" then
  366.         menu6 = filename1
  367.         path6 = ulozit
  368.         elseif pozice == "7" then
  369.         menu7 = filename1
  370.         path7 = ulozit
  371.         end
  372.                
  373.         local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "w")
  374.         data.writeLine(menu1)
  375.         data.writeLine(path1)
  376.         data.writeLine(menu2)
  377.         data.writeLine(path2)
  378.         data.writeLine(menu3)
  379.         data.writeLine(path3)
  380.         data.writeLine(menu4)
  381.         data.writeLine(path4)
  382.         data.writeLine(menu5)
  383.         data.writeLine(path5)
  384.         data.writeLine(menu6)
  385.         data.writeLine(path6)
  386.         data.writeLine(menu7)
  387.         data.writeLine(path7)
  388.         data.close ()  
  389.         menud ()
  390.     else
  391.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  392.     paintutils.drawPixel (51,1, colors.red)
  393.     term.setTextColor(colors.white)
  394.     term.setCursorPos (51,1)
  395.     print "*"
  396.     paintutils.drawPixel (50,1, colors.lightGray)
  397.     term.setCursorPos (50,1)
  398.     print "<"
  399.     paintutils.drawPixel (49,1, colors.lightGray)
  400.     term.setCursorPos (49,1)
  401.     print "_"
  402.              while true do
  403.         local event, button, x, y = os.pullEvent("mouse_click")
  404.         xy = x..","..y
  405.        
  406.         if x == 51 and y == 1 then
  407.             ukonceni ()
  408.         elseif x == 50 and y == 1 then
  409.             menud ()
  410.         elseif x == 49 and y == 1 then
  411.             minimalizace ()
  412.         else
  413.         downinstal ()
  414.             end
  415.             end
  416.     end
  417. end
  418.  
  419. end
  420.  
  421. function upload ()
  422.     funkce = "upload"
  423.     term.setBackgroundColor(colors.white)
  424.     term.setTextColor(colors.black)
  425.     term.clear ()
  426.     paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
  427.     term.setBackgroundColor(colors.white)
  428.     prc (" Program manager for Pepdroll OS ", 4)
  429.     term.setCursorPos (5,8)
  430.     print "Paste path file for upload:"
  431.     term.setBackgroundColor(colors.lightGray)
  432.     term.setCursorPos (5,10)
  433.     print "                                   "
  434.     term.setTextColor(colors.white)
  435.     term.setCursorPos (6,10)
  436.     print (kod1)
  437.     term.setBackgroundColor(colors.gray)
  438.     term.setCursorPos (42,18)
  439.     print " Upload "
  440.    
  441.     while true do
  442.        
  443.         local event, button, x, y = os.pullEvent("mouse_click")
  444.         xy = x..","..y
  445.    
  446.     if x >= 5 and x <= 45 and y == 10 and button == 1 then
  447.         term.setBackgroundColor(colors.gray)
  448.         term.setTextColor(colors.white)
  449.         term.setCursorPos (5,10)
  450.         print "                                   "
  451.         term.setCursorPos (6,10)
  452.         kod1 = io.read ()
  453.         upload ()
  454.     elseif x >= 42 and x <= 51 and y == 18 and button == 1 then
  455.     if akce == nil then
  456.     term.setBackgroundColor(colors.white)
  457.         term.setTextColor(colors.red)
  458.         term.setCursorPos(5,18)
  459.         if kod1 == "" then
  460.             prc ("Paste a valid path!")
  461.         elseif kod1 == " " then
  462.             prc ("Paste a valid path!")
  463.         elseif not fs.exists ("/"..kod1) then
  464.             prc ("File is not exists!")
  465.         else
  466.             term.setTextColor(colors.black)
  467.             term.setCursorPos(5,12)
  468.             shell.run ("pastebin put "..kod1)
  469.             paintutils.drawLine(1, 17, 51, 17, colors.white)
  470.             paintutils.drawLine(1, 18, 41, 18, colors.white)
  471.             term.setTextColor(colors.white)
  472.             term.setBackgroundColor(colors.gray)
  473.             term.setCursorPos (42,18)
  474.             print " Menu  "
  475.             akce = menu
  476.             end
  477.             else
  478.             akce = nil
  479.             menud ()
  480.             end
  481.     else
  482.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  483.     paintutils.drawPixel (51,1, colors.red)
  484.     term.setTextColor(colors.white)
  485.     term.setCursorPos (51,1)
  486.     print "*"
  487.     paintutils.drawPixel (50,1, colors.lightGray)
  488.     term.setCursorPos (50,1)
  489.     print "<"
  490.     paintutils.drawPixel (49,1, colors.lightGray)
  491.     term.setCursorPos (49,1)
  492.     print "_"
  493.    
  494.              while true do
  495.         local event, button, x, y = os.pullEvent("mouse_click")
  496.         xy = x..","..y
  497.        
  498.         if x == 51 and y == 1 then
  499.             ukonceni ()
  500.         elseif x == 50 and y == 1 then
  501.             menud ()
  502.         elseif x == 49 and y == 1 then
  503.             minimalizace ()
  504.         else
  505.         upload ()
  506.             end
  507.             end
  508.     end
  509. end
  510. end
  511.  
  512. function download  ()
  513.     funkce = "download"
  514.  
  515.     if stahovani == nil then
  516.     defcesta = "/C/Programs"
  517.     filename = "FileName"
  518.     stahovani = 1
  519.     end
  520.    
  521.     if pastebincode == nil then
  522.         pastebincode = "Pastebin"
  523.     end
  524.    
  525.     ulozit = (defcesta.."/"..filename)
  526.     term.setBackgroundColor(colors.white)
  527.     term.setTextColor(colors.black)
  528.     term.clear ()
  529.     paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
  530.     term.setBackgroundColor(colors.white)
  531.     prc (" Program manager for Pepdroll OS ", 4)
  532.     term.setCursorPos (5,8)
  533.     print "Code from pastebin:"
  534.     term.setCursorPos (5,11)
  535.     print "File name:"
  536.     term.setCursorPos (5,15)
  537.     print "Paste a path for download:"
  538.     term.setBackgroundColor(colors.lightGray)
  539.     term.setCursorPos (25,8)
  540.     print "          "
  541.     term.setCursorPos (5,16)
  542.     print "                                    "
  543.     term.setCursorPos (25,11)
  544.     print "          "
  545.     term.setTextColor(colors.black)
  546.     term.setCursorPos (26,8)
  547.     print (pastebincode)
  548.     term.setCursorPos (6,16)
  549.     print (ulozit)
  550.     term.setCursorPos (26,11)
  551.     print (filename)
  552.     term.setBackgroundColor(colors.gray)
  553.     term.setCursorPos (42,18)
  554.     if instalace == nil then
  555.     print " Download "
  556.     else
  557.     print "   Next   "
  558.     end
  559.    
  560.    
  561.     while true do
  562.         local event, button, x, y = os.pullEvent("mouse_click")
  563.         xy = x..","..y
  564.    
  565.     if x >= 25 and x <= 34 and y == 8 and button == 1 then
  566.         term.setBackgroundColor(colors.gray)
  567.         term.setTextColor(colors.white)
  568.         term.setCursorPos (25,8)
  569.         print "          "
  570.         term.setCursorPos (26,8)
  571.         pastebincode = read ()
  572.         download ()
  573.     elseif x >= 5 and x <= 31 and y == 16 and button == 1 then
  574.         term.setBackgroundColor(colors.gray)
  575.         term.setTextColor(colors.white)
  576.         term.setCursorPos (5,16)
  577.         print "                                    "
  578.         term.setCursorPos (6,16)
  579.         defcesta = read ()
  580.         download ()
  581.     elseif x >= 25 and x <= 34 and y == 11 and button == 1 then
  582.         term.setBackgroundColor(colors.gray)
  583.         term.setTextColor(colors.white)
  584.         term.setCursorPos (25,11)
  585.         print "          "
  586.         term.setCursorPos (26,11)
  587.         filename = read ()
  588.         download ()
  589.     elseif x >= 42 and x <= 51 and y == 18 and button == 1 then
  590.    
  591.     term.setBackgroundColor(colors.white)
  592.         term.setTextColor(colors.red)
  593.         term.setCursorPos(5,18)
  594.         if pastebincode == "Pastebin" then
  595.             prc ("Paste a Pastebin code!")
  596.         elseif pastebincode == "" then
  597.             prc ("Paste a Pastebin code!")
  598.         elseif pastebincode == " " then
  599.             prc ("Paste a Pastebin code!")
  600.         elseif fs.exists (ulozit) then
  601.             prc ("File is exists, rename it!")
  602.         else
  603.             if instalace == nil then
  604.             term.setTextColor(colors.green)
  605.             term.setCursorPos(4,17)
  606.                 shell.run ("pastebin get",pastebincode,ulozit)
  607.                 paintutils.drawLine(1, 17, 51, 17, colors.white)
  608.                 paintutils.drawLine(1, 18, 41, 18, colors.white)
  609.             term.setCursorPos(5,18)
  610.                 prc "Succesful!"
  611.                 sleep (0.5)
  612.                 zpet = download
  613.                 spustit ()
  614.                
  615.             else
  616.                 downinstal ()
  617.             end
  618.             end
  619.      
  620.     else
  621.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  622.     paintutils.drawPixel (51,1, colors.red)
  623.     term.setTextColor(colors.white)
  624.     term.setCursorPos (51,1)
  625.     print "*"
  626.     paintutils.drawPixel (50,1, colors.lightGray)
  627.     term.setCursorPos (50,1)
  628.     print "<"
  629.     paintutils.drawPixel (49,1, colors.lightGray)
  630.     term.setCursorPos (49,1)
  631.     print "_"
  632.              while true do
  633.         local event, button, x, y = os.pullEvent("mouse_click")
  634.         xy = x..","..y
  635.        
  636.         if x == 51 and y == 1 then
  637.             ukonceni ()
  638.         elseif x == 50 and y == 1 then
  639.             menud ()
  640.         elseif x == 49 and y == 1 then
  641.             minimalizace ()
  642.         else
  643.         download ()
  644.             end
  645.             end
  646. end
  647. end
  648. end
  649.  
  650. local function zapsat()
  651. end
  652.  
  653. function hledat()
  654.     if fs.exists (cestaProgramu) then
  655.         return
  656.     else
  657.         cestaProgramu1 = cestaProgramu
  658.         cestaProgramu = ("/C/Programs/"..cestaProgramu)
  659.             if fs.exists (cestaProgramu) then
  660.                 return
  661.             else
  662.                 cestaProgramu = ("/C/Programs/pepeksoft/"..cestaProgramu1)
  663.             end
  664.                
  665.             if fs.exists (cestaProgramu) then
  666.                 return
  667.             else
  668.                 term.setBackgroundColor(colors.white)
  669.                 term.setTextColor(colors.red)
  670.                 term.setCursorPos(10,12)
  671.                 write("The program could not be found.")
  672.                 cestaProgramu = ""
  673.                 sleep(0.5)
  674.                 uspech = "f"
  675.             end
  676.     end
  677. end
  678.  
  679. function editmenu()
  680. funkce = "editmenu"
  681.     function apply ()
  682.         data = fs.open ("/C/system/Users/"..user.."/lsprogram", "w")
  683.         data.writeLine(nmenu1)
  684.         data.writeLine(npath1)
  685.         data.writeLine(nmenu2)
  686.         data.writeLine(npath2)
  687.         data.writeLine(nmenu3)
  688.         data.writeLine(npath3)
  689.         data.writeLine(nmenu4)
  690.         data.writeLine(npath4)
  691.         data.writeLine(nmenu5)
  692.         data.writeLine(npath5)
  693.         data.writeLine(nmenu6)
  694.         data.writeLine(npath6)
  695.         data.writeLine(nmenu7)
  696.         data.writeLine(npath7)
  697.         data.close ()
  698.        
  699.         if ok == "0" then
  700.         term.setCursorPos (20, 13)
  701.         term.setBackgroundColor(colors.white)
  702.         term.setTextColor(colors.lime)
  703.         write "Successfull"
  704.         term.setTextColor(colors.white)
  705.         term.setBackgroundColor(colors.lightGray)
  706.         term.setCursorPos (25,14)
  707.         print"OK"
  708.         else
  709.         term.setCursorPos (16, 17)
  710.         term.setBackgroundColor(colors.white)
  711.         term.setTextColor(colors.lime)
  712.         prc ("Successfull", 19)
  713.         ok = "0"
  714.         end
  715.         sleep (0.5)
  716.         editmenu ()
  717.         end
  718.  
  719.         local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "r")
  720.         menu1 = data.readLine ()
  721.         path1 = data.readLine ()
  722.         menu2 = data.readLine ()
  723.         path2 = data.readLine ()
  724.         menu3 = data.readLine ()
  725.         path3 = data.readLine ()
  726.         menu4 = data.readLine ()
  727.         path4 = data.readLine ()
  728.         menu5 = data.readLine ()
  729.         path5 = data.readLine ()
  730.         menu6 = data.readLine ()
  731.         path6 = data.readLine ()
  732.         menu7 = data.readLine ()
  733.         path7 = data.readLine ()
  734.         data.close()
  735.         nmenu1 = menu1
  736.         npath1 = path1
  737.         nmenu2 = menu2
  738.         npath2 = path2
  739.         nmenu3 = menu3
  740.         npath3 = path3
  741.         nmenu4 = menu4
  742.         npath4 = path4
  743.         nmenu5 = menu5
  744.         npath5 = path5
  745.         nmenu6 = menu6
  746.         npath6 = path6
  747.         nmenu7 = menu7
  748.         npath7 = path7
  749.  
  750.     term.setBackgroundColor(colors.white)
  751.     term.clear()
  752.     local myWindow = window.create(term.current(),9,4,37,19)
  753.     myWindow.setBackgroundColor(colors.white)
  754.     myWindow.clear()
  755.     term.setTextColor(colors.black)
  756.     term.setBackgroundColor(colors.white)
  757.     myWindow.setCursorPos (4,3)
  758.     print "1.position"
  759.     myWindow.setCursorPos (4,5)
  760.     print "2.position"
  761.     myWindow.setCursorPos (4,7)
  762.     print "3.position"
  763.     myWindow.setCursorPos (4,9)
  764.     print "4.position"
  765.     myWindow.setCursorPos (4,11)
  766.     print "5.position"
  767.     myWindow.setCursorPos (4,13)
  768.     print "6.position"
  769.     myWindow.setCursorPos (4,15)
  770.     print "7.position"
  771.     term.setTextColor(colors.white)
  772.     term.setBackgroundColor(colors.lightGray)
  773.     myWindow.setCursorPos (16,3)
  774.     print"              "
  775.     myWindow.setCursorPos (16,5)
  776.     print"              "
  777.     myWindow.setCursorPos (16,7)
  778.     print"              "
  779.     myWindow.setCursorPos (16,9)
  780.     print"              "
  781.     myWindow.setCursorPos (16,11)
  782.     print"              "
  783.     myWindow.setCursorPos (16,13)
  784.     print"              "
  785.     myWindow.setCursorPos (16,15)
  786.     print"              "
  787.     myWindow.setCursorPos (17,3)
  788.     print(nmenu1)
  789.     myWindow.setCursorPos (17,5)
  790.     print(nmenu2)
  791.     myWindow.setCursorPos (17,7)
  792.     print(nmenu3)
  793.     myWindow.setCursorPos (17,9)
  794.     print(nmenu4)
  795.     myWindow.setCursorPos (17,11)
  796.     print(nmenu5)
  797.     myWindow.setCursorPos (17,13)
  798.     print(nmenu6)
  799.     myWindow.setCursorPos (17,15)
  800.     print(nmenu7)
  801.     term.setBackgroundColor(colors.red)
  802.     term.setTextColor(colors.white)
  803.     myWindow.setCursorPos (30,3)
  804.     print "*"
  805.     myWindow.setCursorPos (30,5)
  806.     print "*"
  807.     myWindow.setCursorPos (30,7)
  808.     print "*"
  809.     myWindow.setCursorPos (30,9)
  810.     print "*"
  811.     myWindow.setCursorPos (30,11)
  812.     print "*"
  813.     myWindow.setCursorPos (30,13)
  814.     print "*"
  815.     myWindow.setCursorPos (30,15)
  816.     print "*"
  817.    
  818.     paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
  819.     term.setBackgroundColor(colors.white)
  820.     term.setTextColor(colors.black)
  821.     prc (" Program manager for Pepdroll OS ", 4)
  822.    
  823.     while true do
  824.         local event, button, x, y = os.pullEvent("mouse_click")
  825.         xy = x..","..y
  826.  
  827.     if x == 38 and y == 6 and button == 1 then
  828.     nmenu1 = ""
  829.     npath1 = ""
  830.     ok = "1"
  831.     apply ()
  832.     elseif x == 38 and y == 8 and button == 1 then
  833.     nmenu2 = ""
  834.     npath2 = ""
  835.     ok = "1"
  836.     apply ()
  837.     elseif x == 38 and y == 10 and button == 1 then
  838.     nmenu3 = ""
  839.     npath3 = ""
  840.     ok = "1"
  841.     apply ()
  842.     elseif x == 38 and y == 12 and button == 1 then
  843.     nmenu4 = ""
  844.     npath4 = ""
  845.     ok = "1"
  846.     apply ()
  847.     elseif x == 38 and y == 14 and button == 1 then
  848.     nmenu5 = ""
  849.     npath5 = ""
  850.     ok = "1"
  851.     apply ()
  852.     elseif x == 38 and y == 16 and button == 1 then
  853.     nmenu6 = ""
  854.     npath6 = ""
  855.     ok = "1"
  856.     apply ()
  857.     elseif x == 38 and y == 18 and button == 1 then
  858.     nmenu7 = ""
  859.     npath7 = ""
  860.     ok = "1"
  861.     apply ()
  862. -------------------------------------------------------------------------------------------
  863.     elseif x >= 24 and x <= 37 and y == 6 and button == 1 then
  864.     term.setBackgroundColor(colors.gray)
  865.     term.setTextColor(colors.white)
  866.     term.setCursorPos (24,6)
  867.     print"              "
  868.     term.setCursorPos (25,6)
  869.     print(nmenu1)
  870.     sleep(0.1)
  871.     local myWindow = window.create(term.current(),10,7,33,10)
  872.     myWindow.setBackgroundColor(colors.gray)
  873.     myWindow.clear()
  874.     local myWindow = window.create(term.current(),9,6,33,10)
  875.     myWindow.setBackgroundColor(nastaveni.barva)
  876.     myWindow.clear()
  877.     local myWindow = window.create(term.current(),10,7,31,8)
  878.     myWindow.setBackgroundColor(colors.white)
  879.     myWindow.clear()
  880.     paintutils.drawPixel (41,6, colors.red)
  881.     term.setCursorPos(41,6)
  882.     print "*"
  883.     term.setBackgroundColor(colors.white)
  884.     term.setTextColor(colors.black)
  885.     myWindow.setCursorPos (11,1)
  886.     print"1. Position"
  887.     myWindow.setCursorPos (2,2)
  888.     print"Name"
  889.     myWindow.setCursorPos (2,5)
  890.     print"Path:"
  891.     myWindow.setCursorPos (16,8)
  892.     print"OK"
  893.     term.setTextColor(colors.black)
  894.     term.setBackgroundColor(colors.lightGray)
  895.     myWindow.setCursorPos (2,3)
  896.     print"              "
  897.     myWindow.setCursorPos (2,3)
  898.     print(menu1)
  899.     myWindow.setCursorPos (2,6)
  900.     print"                             "
  901.     myWindow.setCursorPos (2,6)
  902.     print(path1)
  903.     term.setBackgroundColor(colors.gray)
  904.    
  905.     while true do
  906.         local event, button, x, y = os.pullEvent("mouse_click")
  907.         xy = x..","..y
  908.  
  909.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  910.             term.setBackgroundColor(colors.gray)
  911.             myWindow.setCursorPos (2,3)
  912.             print"              "
  913.             myWindow.setCursorPos (2,3)
  914.             nmenu1 = read()
  915.             term.setBackgroundColor(colors.lightGray)
  916.             myWindow.setCursorPos (2,3)
  917.             print"              "
  918.             myWindow.setCursorPos (2,3)
  919.             write(nmenu1)
  920.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  921.             term.setBackgroundColor(colors.gray)
  922.             myWindow.setCursorPos (2,6)
  923.             print"                             "
  924.             myWindow.setCursorPos (2,6)
  925.             cestaProgramu = read ()
  926.             hledat()
  927.             if uspech == "f" then
  928.             uspech = "t"
  929.             term.setBackgroundColor(colors.white)
  930.             myWindow.setCursorPos (1,6)
  931.             print"                               "
  932.             term.setBackgroundColor(colors.lightGray)
  933.             term.setTextColor(colors.black)
  934.             myWindow.setCursorPos (2,6)
  935.             print"                             "
  936.             myWindow.setCursorPos (2,6)
  937.             print(path1)
  938.             npath1 = path1
  939.             else
  940.             myWindow.setCursorPos (2,6)
  941.             npath1 = cestaProgramu
  942.             write(cestaProgramu)
  943.             end
  944.             elseif x == 41 and y == 6 and button == 1 then
  945.             editmenu ()
  946.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  947.             apply ()
  948.             end
  949.             end
  950.     elseif x >= 24 and x <= 37 and y == 8 and button == 1 then
  951.     term.setBackgroundColor(colors.gray)
  952.     term.setTextColor(colors.white)
  953.     term.setCursorPos (24,8)
  954.     print"              "
  955.     term.setCursorPos (25,8)
  956.     print(nmenu2)
  957.     sleep(0.1)
  958.     local myWindow = window.create(term.current(),10,7,33,10)
  959.     myWindow.setBackgroundColor(colors.gray)
  960.     myWindow.clear()
  961.     local myWindow = window.create(term.current(),9,6,33,10)
  962.     myWindow.setBackgroundColor(nastaveni.barva)
  963.     myWindow.clear()
  964.     local myWindow = window.create(term.current(),10,7,31,8)
  965.     myWindow.setBackgroundColor(colors.white)
  966.     myWindow.clear()
  967.     paintutils.drawPixel (41,6, colors.red)
  968.     term.setCursorPos(41,6)
  969.     print "*"
  970.     term.setBackgroundColor(colors.white)
  971.     term.setTextColor(colors.black)
  972.     myWindow.setCursorPos (11,1)
  973.     print"2. Position"
  974.     myWindow.setCursorPos (2,2)
  975.     print"Name"
  976.     myWindow.setCursorPos (2,5)
  977.     print"Path:"
  978.     myWindow.setCursorPos (16,8)
  979.     print"OK"
  980.     term.setTextColor(colors.black)
  981.     term.setBackgroundColor(colors.lightGray)
  982.     myWindow.setCursorPos (2,3)
  983.     print"              "
  984.     myWindow.setCursorPos (2,3)
  985.     print(menu2)
  986.     myWindow.setCursorPos (2,6)
  987.     print"                             "
  988.     myWindow.setCursorPos (2,6)
  989.     print(path2)
  990.     term.setBackgroundColor(colors.gray)
  991.    
  992.     while true do
  993.         local event, button, x, y = os.pullEvent("mouse_click")
  994.         xy = x..","..y
  995.  
  996.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  997.             term.setBackgroundColor(colors.gray)
  998.             myWindow.setCursorPos (2,3)
  999.             print"              "
  1000.             myWindow.setCursorPos (2,3)
  1001.             nmenu2 = read()
  1002.             term.setBackgroundColor(colors.lightGray)
  1003.             myWindow.setCursorPos (2,3)
  1004.             print"              "
  1005.             myWindow.setCursorPos (2,3)
  1006.             write(nmenu2)
  1007.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  1008.             term.setBackgroundColor(colors.gray)
  1009.             myWindow.setCursorPos (2,6)
  1010.             print"                             "
  1011.             myWindow.setCursorPos (2,6)
  1012.             cestaProgramu = read ()
  1013.             hledat()
  1014.             if uspech == "f" then
  1015.             uspech = "t"
  1016.             term.setBackgroundColor(colors.white)
  1017.             myWindow.setCursorPos (1,6)
  1018.             print"                               "
  1019.             term.setBackgroundColor(colors.lightGray)
  1020.             term.setTextColor(colors.black)
  1021.             myWindow.setCursorPos (2,6)
  1022.             print"                             "
  1023.             myWindow.setCursorPos (2,6)
  1024.             print(path2)
  1025.             npath2 = path2
  1026.             else
  1027.             myWindow.setCursorPos (2,6)
  1028.             npath2 = cestaProgramu
  1029.             write(cestaProgramu)
  1030.             end
  1031.             elseif x == 41 and y == 6 and button == 1 then
  1032.             editmenu ()
  1033.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  1034.             apply ()
  1035.             end
  1036.             end
  1037.         elseif x >= 24 and x <= 37 and y == 10 and button == 1 then
  1038.     term.setBackgroundColor(colors.gray)
  1039.     term.setTextColor(colors.white)
  1040.     term.setCursorPos (24,10)
  1041.     print"              "
  1042.     term.setCursorPos (25,10)
  1043.     print(nmenu3)
  1044.     sleep(0.1)
  1045.     local myWindow = window.create(term.current(),10,7,33,10)
  1046.     myWindow.setBackgroundColor(colors.gray)
  1047.     myWindow.clear()
  1048.     local myWindow = window.create(term.current(),9,6,33,10)
  1049.     myWindow.setBackgroundColor(nastaveni.barva)
  1050.     myWindow.clear()
  1051.     local myWindow = window.create(term.current(),10,7,31,8)
  1052.     myWindow.setBackgroundColor(colors.white)
  1053.     myWindow.clear()
  1054.     paintutils.drawPixel (41,6, colors.red)
  1055.     term.setCursorPos(41,6)
  1056.     print "*"
  1057.     term.setBackgroundColor(colors.white)
  1058.     term.setTextColor(colors.black)
  1059.     myWindow.setCursorPos (11,1)
  1060.     print"3. Position"
  1061.     myWindow.setCursorPos (2,2)
  1062.     print"Name"
  1063.     myWindow.setCursorPos (2,5)
  1064.     print"Path:"
  1065.     myWindow.setCursorPos (16,8)
  1066.     print"OK"
  1067.     term.setTextColor(colors.black)
  1068.     term.setBackgroundColor(colors.lightGray)
  1069.     myWindow.setCursorPos (2,3)
  1070.     print"              "
  1071.     myWindow.setCursorPos (2,3)
  1072.     print(menu3)
  1073.     myWindow.setCursorPos (2,6)
  1074.     print"                             "
  1075.     myWindow.setCursorPos (2,6)
  1076.     print(path3)
  1077.     term.setBackgroundColor(colors.gray)
  1078.    
  1079.     while true do
  1080.         local event, button, x, y = os.pullEvent("mouse_click")
  1081.         xy = x..","..y
  1082.  
  1083.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  1084.             term.setBackgroundColor(colors.gray)
  1085.             myWindow.setCursorPos (2,3)
  1086.             print"              "
  1087.             myWindow.setCursorPos (2,3)
  1088.             nmenu3 = read()
  1089.             term.setBackgroundColor(colors.lightGray)
  1090.             myWindow.setCursorPos (2,3)
  1091.             print"              "
  1092.             myWindow.setCursorPos (2,3)
  1093.             write(nmenu3)
  1094.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  1095.             term.setBackgroundColor(colors.gray)
  1096.             myWindow.setCursorPos (2,6)
  1097.             print"                             "
  1098.             myWindow.setCursorPos (2,6)
  1099.             cestaProgramu = read ()
  1100.             hledat()
  1101.             if uspech == "f" then
  1102.             uspech = "t"
  1103.             term.setBackgroundColor(colors.white)
  1104.             myWindow.setCursorPos (1,6)
  1105.             print"                               "
  1106.             term.setBackgroundColor(colors.lightGray)
  1107.             term.setTextColor(colors.black)
  1108.             myWindow.setCursorPos (2,6)
  1109.             print"                             "
  1110.             myWindow.setCursorPos (2,6)
  1111.             print(path3)
  1112.             npath3 = path3
  1113.             else
  1114.             myWindow.setCursorPos (2,6)
  1115.             npath3 = cestaProgramu
  1116.             write(cestaProgramu)
  1117.             end
  1118.             elseif x == 41 and y == 6 and button == 1 then
  1119.             editmenu ()
  1120.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  1121.             apply ()
  1122.             end
  1123.             end
  1124.         elseif x >= 24 and x <= 37 and y == 12 and button == 1 then
  1125.     term.setBackgroundColor(colors.gray)
  1126.     term.setTextColor(colors.white)
  1127.     term.setCursorPos (24,12)
  1128.     print"              "
  1129.     term.setCursorPos (25,12)
  1130.     print(nmenu4)
  1131.     sleep(0.1)
  1132.     local myWindow = window.create(term.current(),10,7,33,10)
  1133.     myWindow.setBackgroundColor(colors.gray)
  1134.     myWindow.clear()
  1135.     local myWindow = window.create(term.current(),9,6,33,10)
  1136.     myWindow.setBackgroundColor(nastaveni.barva)
  1137.     myWindow.clear()
  1138.     local myWindow = window.create(term.current(),10,7,31,8)
  1139.     myWindow.setBackgroundColor(colors.white)
  1140.     myWindow.clear()
  1141.     paintutils.drawPixel (41,6, colors.red)
  1142.     term.setCursorPos(41,6)
  1143.     print "*"
  1144.     term.setBackgroundColor(colors.white)
  1145.     term.setTextColor(colors.black)
  1146.     myWindow.setCursorPos (11,1)
  1147.     print"4. Position"
  1148.     myWindow.setCursorPos (2,2)
  1149.     print"Name"
  1150.     myWindow.setCursorPos (2,5)
  1151.     print"Path:"
  1152.     myWindow.setCursorPos (16,8)
  1153.     print"OK"
  1154.     term.setTextColor(colors.black)
  1155.     term.setBackgroundColor(colors.lightGray)
  1156.     myWindow.setCursorPos (2,3)
  1157.     print"              "
  1158.     myWindow.setCursorPos (2,3)
  1159.     print(menu4)
  1160.     myWindow.setCursorPos (2,6)
  1161.     print"                             "
  1162.     myWindow.setCursorPos (2,6)
  1163.     print(path4)
  1164.     term.setBackgroundColor(colors.gray)
  1165.    
  1166.     while true do
  1167.         local event, button, x, y = os.pullEvent("mouse_click")
  1168.         xy = x..","..y
  1169.  
  1170.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  1171.             term.setBackgroundColor(colors.gray)
  1172.             myWindow.setCursorPos (2,3)
  1173.             print"              "
  1174.             myWindow.setCursorPos (2,3)
  1175.             nmenu4 = read()
  1176.             term.setBackgroundColor(colors.lightGray)
  1177.             myWindow.setCursorPos (2,3)
  1178.             print"              "
  1179.             myWindow.setCursorPos (2,3)
  1180.             write(nmenu4)
  1181.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  1182.             term.setBackgroundColor(colors.gray)
  1183.             myWindow.setCursorPos (2,6)
  1184.             print"                             "
  1185.             myWindow.setCursorPos (2,6)
  1186.             cestaProgramu = read ()
  1187.             hledat()
  1188.             if uspech == "f" then
  1189.             uspech = "t"
  1190.             term.setBackgroundColor(colors.white)
  1191.             myWindow.setCursorPos (1,6)
  1192.             print"                               "
  1193.             term.setBackgroundColor(colors.lightGray)
  1194.             term.setTextColor(colors.black)
  1195.             myWindow.setCursorPos (2,6)
  1196.             print"                             "
  1197.             myWindow.setCursorPos (2,6)
  1198.             print(path4)
  1199.             npath4 = path4
  1200.             else
  1201.             myWindow.setCursorPos (2,6)
  1202.             npath4 = cestaProgramu
  1203.             write(cestaProgramu)
  1204.             end
  1205.             elseif x == 41 and y == 6 and button == 1 then
  1206.             editmenu ()
  1207.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  1208.             apply ()
  1209.             end
  1210.             end
  1211.     elseif x >= 24 and x <= 37 and y == 14 and button == 1 then
  1212.     term.setBackgroundColor(colors.gray)
  1213.     term.setTextColor(colors.white)
  1214.     term.setCursorPos (24,14)
  1215.     print"              "
  1216.     term.setCursorPos (25,14)
  1217.     print(nmenu5)
  1218.     sleep(0.1)
  1219.     local myWindow = window.create(term.current(),10,7,33,10)
  1220.     myWindow.setBackgroundColor(colors.gray)
  1221.     myWindow.clear()
  1222.     local myWindow = window.create(term.current(),9,6,33,10)
  1223.     myWindow.setBackgroundColor(nastaveni.barva)
  1224.     myWindow.clear()
  1225.     local myWindow = window.create(term.current(),10,7,31,8)
  1226.     myWindow.setBackgroundColor(colors.white)
  1227.     myWindow.clear()
  1228.     paintutils.drawPixel (41,6, colors.red)
  1229.     term.setCursorPos(41,6)
  1230.     print "*"
  1231.     term.setBackgroundColor(colors.white)
  1232.     term.setTextColor(colors.black)
  1233.     myWindow.setCursorPos (11,1)
  1234.     print"5. Position"
  1235.     myWindow.setCursorPos (2,2)
  1236.     print"Name"
  1237.     myWindow.setCursorPos (2,5)
  1238.     print"Path:"
  1239.     myWindow.setCursorPos (16,8)
  1240.     print"OK"
  1241.     term.setTextColor(colors.black)
  1242.     term.setBackgroundColor(colors.lightGray)
  1243.     myWindow.setCursorPos (2,3)
  1244.     print"              "
  1245.     myWindow.setCursorPos (2,3)
  1246.     print(menu5)
  1247.     myWindow.setCursorPos (2,6)
  1248.     print"                             "
  1249.     myWindow.setCursorPos (2,6)
  1250.     print(path5)
  1251.     term.setBackgroundColor(colors.gray)
  1252.    
  1253.     while true do
  1254.         local event, button, x, y = os.pullEvent("mouse_click")
  1255.         xy = x..","..y
  1256.  
  1257.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  1258.             term.setBackgroundColor(colors.gray)
  1259.             myWindow.setCursorPos (2,3)
  1260.             print"              "
  1261.             myWindow.setCursorPos (2,3)
  1262.             nmenu5 = read()
  1263.             term.setBackgroundColor(colors.lightGray)
  1264.             myWindow.setCursorPos (2,3)
  1265.             print"              "
  1266.             myWindow.setCursorPos (2,3)
  1267.             write(nmenu5)
  1268.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  1269.             term.setBackgroundColor(colors.gray)
  1270.             myWindow.setCursorPos (2,6)
  1271.             print"                             "
  1272.             myWindow.setCursorPos (2,6)
  1273.             cestaProgramu = read ()
  1274.             hledat()
  1275.             if uspech == "f" then
  1276.             uspech = "t"
  1277.             term.setBackgroundColor(colors.white)
  1278.             myWindow.setCursorPos (1,6)
  1279.             print"                               "
  1280.             term.setBackgroundColor(colors.lightGray)
  1281.             term.setTextColor(colors.black)
  1282.             myWindow.setCursorPos (2,6)
  1283.             print"                             "
  1284.             myWindow.setCursorPos (2,6)
  1285.             print(path5)
  1286.             npath5 = path5
  1287.             else
  1288.             myWindow.setCursorPos (2,6)
  1289.             npath5 = cestaProgramu
  1290.             write(cestaProgramu)
  1291.             end
  1292.             elseif x == 41 and y == 6 and button == 1 then
  1293.             editmenu ()
  1294.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  1295.             apply ()
  1296.             end
  1297.             end
  1298.     elseif x >= 24 and x <= 37 and y == 16 and button == 1 then
  1299.     term.setBackgroundColor(colors.gray)
  1300.     term.setTextColor(colors.white)
  1301.     term.setCursorPos (24,16)
  1302.     print"              "
  1303.     term.setCursorPos (25,16)
  1304.     print(nmenu6)
  1305.     sleep(0.1)
  1306.     local myWindow = window.create(term.current(),10,7,33,10)
  1307.     myWindow.setBackgroundColor(colors.gray)
  1308.     myWindow.clear()
  1309.     local myWindow = window.create(term.current(),9,6,33,10)
  1310.     myWindow.setBackgroundColor(nastaveni.barva)
  1311.     myWindow.clear()
  1312.     local myWindow = window.create(term.current(),10,7,31,8)
  1313.     myWindow.setBackgroundColor(colors.white)
  1314.     myWindow.clear()
  1315.     paintutils.drawPixel (41,6, colors.red)
  1316.     term.setCursorPos(41,6)
  1317.     print "*"
  1318.     term.setBackgroundColor(colors.white)
  1319.     term.setTextColor(colors.black)
  1320.     myWindow.setCursorPos (11,1)
  1321.     print"6. Position"
  1322.     myWindow.setCursorPos (2,2)
  1323.     print"Name"
  1324.     myWindow.setCursorPos (2,5)
  1325.     print"Path:"
  1326.     myWindow.setCursorPos (16,8)
  1327.     print"OK"
  1328.     term.setTextColor(colors.black)
  1329.     term.setBackgroundColor(colors.lightGray)
  1330.     myWindow.setCursorPos (2,3)
  1331.     print"              "
  1332.     myWindow.setCursorPos (2,3)
  1333.     print(menu6)
  1334.     myWindow.setCursorPos (2,6)
  1335.     print"                             "
  1336.     myWindow.setCursorPos (2,6)
  1337.     print(path6)
  1338.     term.setBackgroundColor(colors.gray)
  1339.    
  1340.     while true do
  1341.         local event, button, x, y = os.pullEvent("mouse_click")
  1342.         xy = x..","..y
  1343.  
  1344.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  1345.             term.setBackgroundColor(colors.gray)
  1346.             myWindow.setCursorPos (2,3)
  1347.             print"              "
  1348.             myWindow.setCursorPos (2,3)
  1349.             nmenu6 = read()
  1350.             term.setBackgroundColor(colors.lightGray)
  1351.             myWindow.setCursorPos (2,3)
  1352.             print"              "
  1353.             myWindow.setCursorPos (2,3)
  1354.             write(nmenu6)
  1355.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  1356.             term.setBackgroundColor(colors.gray)
  1357.             myWindow.setCursorPos (2,6)
  1358.             print"                             "
  1359.             myWindow.setCursorPos (2,6)
  1360.             cestaProgramu = read ()
  1361.             hledat()
  1362.             if uspech == "f" then
  1363.             uspech = "t"
  1364.             term.setBackgroundColor(colors.white)
  1365.             myWindow.setCursorPos (1,6)
  1366.             print"                               "
  1367.             term.setBackgroundColor(colors.lightGray)
  1368.             term.setTextColor(colors.black)
  1369.             myWindow.setCursorPos (2,6)
  1370.             print"                             "
  1371.             myWindow.setCursorPos (2,6)
  1372.             print(path6)
  1373.             npath6 = path6
  1374.             else
  1375.             myWindow.setCursorPos (2,6)
  1376.             npath6 = cestaProgramu
  1377.             write(cestaProgramu)
  1378.             end
  1379.             elseif x == 41 and y == 6 and button == 1 then
  1380.             editmenu ()
  1381.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  1382.             apply ()
  1383.             end
  1384.             end
  1385.     elseif x >= 24 and x <= 37 and y == 18 and button == 1 then
  1386.     term.setBackgroundColor(colors.gray)
  1387.     term.setTextColor(colors.white)
  1388.     term.setCursorPos (24,18)
  1389.     print"              "
  1390.     term.setCursorPos (25,18)
  1391.     print(nmenu7)
  1392.     sleep(0.1)
  1393.     local myWindow = window.create(term.current(),10,7,33,10)
  1394.     myWindow.setBackgroundColor(colors.gray)
  1395.     myWindow.clear()
  1396.     local myWindow = window.create(term.current(),9,6,33,10)
  1397.     myWindow.setBackgroundColor(nastaveni.barva)
  1398.     myWindow.clear()
  1399.     local myWindow = window.create(term.current(),10,7,31,8)
  1400.     myWindow.setBackgroundColor(colors.white)
  1401.     myWindow.clear()
  1402.     paintutils.drawPixel (41,6, colors.red)
  1403.     term.setCursorPos(41,6)
  1404.     print "*"
  1405.     term.setBackgroundColor(colors.white)
  1406.     term.setTextColor(colors.black)
  1407.     myWindow.setCursorPos (11,1)
  1408.     print"6. Position"
  1409.     myWindow.setCursorPos (2,2)
  1410.     print"Name"
  1411.     myWindow.setCursorPos (2,5)
  1412.     print"Path:"
  1413.     myWindow.setCursorPos (16,8)
  1414.     print"OK"
  1415.     term.setTextColor(colors.black)
  1416.     term.setBackgroundColor(colors.lightGray)
  1417.     myWindow.setCursorPos (2,3)
  1418.     print"              "
  1419.     myWindow.setCursorPos (2,3)
  1420.     print(menu7)
  1421.     myWindow.setCursorPos (2,6)
  1422.     print"                             "
  1423.     myWindow.setCursorPos (2,6)
  1424.     print(path7)
  1425.     term.setBackgroundColor(colors.gray)
  1426.    
  1427.     while true do
  1428.         local event, button, x, y = os.pullEvent("mouse_click")
  1429.         xy = x..","..y
  1430.  
  1431.             if x >= 11 and x <= 24 and y == 9 and button == 1 then
  1432.             term.setBackgroundColor(colors.gray)
  1433.             myWindow.setCursorPos (2,3)
  1434.             print"              "
  1435.             myWindow.setCursorPos (2,3)
  1436.             nmenu7 = read()
  1437.             term.setBackgroundColor(colors.lightGray)
  1438.             myWindow.setCursorPos (2,3)
  1439.             print"              "
  1440.             myWindow.setCursorPos (2,3)
  1441.             write(nmenu7)
  1442.             elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
  1443.             term.setBackgroundColor(colors.gray)
  1444.             myWindow.setCursorPos (2,6)
  1445.             print"                             "
  1446.             myWindow.setCursorPos (2,6)
  1447.             cestaProgramu = read ()
  1448.             hledat()
  1449.             if uspech == "f" then
  1450.             uspech = "t"
  1451.             term.setBackgroundColor(colors.white)
  1452.             myWindow.setCursorPos (1,6)
  1453.             print"                               "
  1454.             term.setBackgroundColor(colors.lightGray)
  1455.             term.setTextColor(colors.black)
  1456.             myWindow.setCursorPos (2,6)
  1457.             print"                             "
  1458.             myWindow.setCursorPos (2,6)
  1459.             print(path7)
  1460.             npath7 = path7
  1461.             else
  1462.             myWindow.setCursorPos (2,6)
  1463.             npath7 = cestaProgramu
  1464.             write(cestaProgramu)
  1465.             end
  1466.             elseif x == 41 and y == 6 and button == 1 then
  1467.             editmenu ()
  1468.             elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
  1469.             apply ()
  1470.             end
  1471.             end
  1472. ----------------------------------------------------------------------------------    
  1473.     else
  1474.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1475.     paintutils.drawPixel (51,1, colors.red)
  1476.     term.setTextColor(colors.white)
  1477.     term.setCursorPos (51,1)
  1478.     print "*"
  1479.     paintutils.drawPixel (50,1, colors.lightGray)
  1480.     term.setCursorPos (50,1)
  1481.     print "<"
  1482.     paintutils.drawPixel (49,1, colors.lightGray)
  1483.     term.setCursorPos (49,1)
  1484.     print "_"
  1485.  
  1486.              while true do
  1487.         local event, button, x, y = os.pullEvent("mouse_click")
  1488.         xy = x..","..y
  1489.        
  1490.         if x == 51 and y == 1 then
  1491.             ukonceni ()
  1492.         elseif x == 50 and y == 1 then
  1493.             menud ()
  1494.         elseif x == 49 and y == 1 then
  1495.             minimalizace ()
  1496.         else
  1497.         editmenu ()
  1498.             end
  1499.             end
  1500. end
  1501. end
  1502. end
  1503.  
  1504. function menud()
  1505. term.setBackgroundColor(colors.white)
  1506.     term.setTextColor(colors.black)
  1507.     term.clear ()
  1508.     paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
  1509.     term.setBackgroundColor(colors.white)
  1510.     prc (" Program manager for Pepdroll OS ", 4)
  1511.     term.setBackgroundColor(colors.lightGray)
  1512.      term.setCursorPos(5,7)
  1513.      print "-> Download and install "
  1514.      term.setCursorPos(5,9)
  1515.      print "-> Download "
  1516.      term.setCursorPos(5,11)
  1517.      print "-> Upload "
  1518.      term.setCursorPos(5,13)
  1519.      print "-> Edit menu "
  1520.      term.setCursorPos(5,15)
  1521.      print "-> Update "
  1522.      term.setCursorPos(5,17)
  1523.      print "-> Uinstall "
  1524.      term.setBackgroundColor(colors.white)
  1525. term.setTextColor(colors.blue)
  1526. term.setCursorPos(20,19)
  1527. write"  Pepek"
  1528. term.setCursorPos(28,19)
  1529. write"Soft  "
  1530. term.setCursorPos(27,19)
  1531. term.setTextColor(colors.lime)
  1532. write"@"
  1533.      while true do
  1534.     local event, button, x, y = os.pullEvent("mouse_click")
  1535.     xy = x..","..y
  1536.      
  1537.     if x >= 5 and x <= 28 and y == 7 and button == 1 then
  1538.     instalace = 1
  1539.     download ()
  1540.     elseif x >= 5 and x <= 30 and y == 9 and button == 1 then
  1541.     instalace = nil
  1542.     download ()
  1543.     elseif x >= 5 and x <= 30 and y == 11 and button == 1 then
  1544.     upload ()
  1545.     elseif x >= 5 and x <= 30 and y == 13 and button == 1 then
  1546.     editmenu()
  1547.     elseif x >= 5 and x <= 30 and y == 15 and button == 1 then
  1548.     update ()
  1549.     elseif x >= 5 and x <= 30 and y == 17 and button == 1 then
  1550.     term.setBackgroundColor(colors.white)
  1551.     term.setTextColor(colors.black)
  1552.     term.clear ()
  1553.     paintutils.drawLine(1, 9, 51, 9, nastaveni.barva)
  1554.     term.setBackgroundColor(colors.white)
  1555.     prc (" In progresing ", 9)
  1556.     else
  1557.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  1558.     paintutils.drawPixel (51,1, colors.red)
  1559.     term.setCursorPos (51,1)
  1560.         term.setTextColor(text.barva)
  1561.     print "*"
  1562.              while true do
  1563.         local event, button, x, y = os.pullEvent("mouse_click")
  1564.         xy = x..","..y
  1565.        
  1566.         if x == 51 and y == 1 then
  1567.             ukonceni ()
  1568.         else
  1569.         menud ()
  1570.             end
  1571.             end
  1572.     break
  1573.     end
  1574.     end
  1575. end
  1576. start ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement