Advertisement
pepeknamornik

Setting App

Jun 19th, 2019 (edited)
10,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 58.01 KB | None | 0 0
  1. verze = "22.0222.R3"
  2. local tArgs = { ... }
  3. local anim = 0.1
  4. local RamCesta = ("/C/system/RAM/setting")
  5. local w, h = term.getSize()
  6. local idPC = os.getComputerID()
  7. local ADC = false
  8. local adMode = false
  9. local ModemPos=""
  10. local adPass=""
  11. local disAD = false
  12. local prepisAD = false
  13. local sound = false
  14. ----------------------------------------------------
  15. local f=fs.open("/C/system/RAM/user","r")
  16. user=f.readLine()
  17. f.close()
  18.  
  19. local userRegistry = "/C/system/Users/"..user.."/.Registry/"
  20. local systemRegistry = "/C/system/.core/.Registry/"
  21. dofile("/C/system/api/decrypt.lua")
  22. function readuser()
  23. user=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 1)
  24. pass=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 2)
  25. Fname=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 3)
  26. Lname=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 4)
  27. isAdmin=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 5)
  28. mistni=readEncryptedFile("/C/system/Users/"..user.."/.data.pcr", tostring(idPC), 6)
  29.  
  30. if (Fname == nil) then Fname="" end
  31. if (Lname == nil) then Lname="" end
  32. if (isAdmin == nil) then isAdmin="t" end
  33. if (mistni == nil) then mistni="f" end
  34.  
  35. if (isAdmin == "t") then Amode = true end
  36.  
  37.     if not prepisAD then
  38.         adUser = user
  39.         adPass = pass
  40.     end
  41.  
  42. end
  43. ----------------------------------------------------
  44.     if fs.exists("/C/system/RAM/devices/speaker.tmp") and not fs.exists(userRegistry..".disableSound") then
  45.     sound = true
  46.     end
  47.    
  48. function song(type)
  49.     if sound and not fs.exists(userRegistry..".disableSound") then shell.run("/C/system/api/sound.api "..type) end
  50. end
  51.  
  52. function ukonceni ()
  53.     fs.delete (RamCesta)
  54.     error("ukonceno")
  55. end
  56. ----------------------------------------------------
  57. if fs.exists("/C/system/.core/system") then
  58.     local data = fs.open ("/C/system/.core/system", "r")
  59.     edice = data.readLine()
  60.     data.close()
  61. else
  62.     edice = "Standard"
  63. end
  64. ----------------------------------------------------    
  65. if (edice == "Server") then
  66.     ServerMode = true
  67. end
  68. ----------------------------------------------------
  69.     if fs.exists("/C/system/.core/defmodem") then
  70.         local data = fs.open ("/C/system/.core/defmodem","r")
  71.         modemPos = data.readLine()
  72.         data.close()
  73.         if not modemPos then
  74.         fs.delete("/C/system/.core/defmodem")
  75.         modemPos = "offline"
  76.         end
  77.     else
  78.         modemPos = "offline"
  79.     end
  80.    
  81.     if fs.exists ("/C/system/.core/AD") then
  82.         local f=fs.open("/C/system/.core/AD","r")
  83.         ADServer=f.readLine()
  84.         f.close()
  85.         adMode = true
  86.     end
  87. -----------------------------------------------------
  88.  
  89. local function downloading(dkod, cestaP)
  90.     shell.run("/C/system/api/stahni.api get "..dkod.." "..cestaP)
  91. end
  92. ------------------------------------------------------------
  93. function cbarva()
  94. lista.setTextColor(colors.black)
  95. lista.setBackgroundColor(colors.gray)
  96. end
  97.  
  98. function bbarva()
  99. txc(colors.black)
  100. bgc(colors.lightBlue)
  101. end
  102.  
  103. local function bgc(barvaP) term.setBackgroundColor(barvaP) end
  104. local function txc(barvaP) term.setTextColor(barvaP) end
  105. local function curs(xi,yi) term.setCursorPos(xi,yi) end
  106. local function pbgc(barvaP) pozadi.setBackgroundColor(barvaP) end
  107. local function ptxc(barvaP) pozadi.setTextColor(barvaP) end
  108. local function pcurs(xi,yi) pozadi.setCursorPos(xi,yi) end
  109. local function Barvy()
  110.     if fs.exists (userRegistry.."colors") then
  111.     local data = fs.open(userRegistry.."colors", "r")
  112.     BarPoz = tonumber(data.readLine())
  113.     BarTxt = tonumber(data.readLine())
  114.     data.close()
  115.     end
  116.     if BarPoz == nil or BarTxt == nil then BarPoz = 2048 BarTxt = 1 end
  117. end
  118.  
  119. function defaultvalue()
  120.  
  121. readuser()
  122. Nuser = " "
  123. Npass = ""
  124. NFname = " "
  125. NLname = " "
  126. IsAdmin = "f"
  127. end
  128.  --------------------------
  129.  function zapsat()
  130.     local f=fs.open("/C/system/Users/"..user.."/.data","w")
  131.     f.writeLine(user)
  132.     f.writeLine(pass)
  133.     f.writeLine(Fname)
  134.     f.writeLine(Lname)
  135.     f.writeLine(isAdmin)
  136.     f.writeLine(mistni)
  137.     f.close()
  138.     ADsend()
  139. end
  140.            
  141. function start()
  142. defaultvalue()
  143. Barvy()
  144. local StartWin = window.create(term.current(),w/2-11,h/2-5,25,9)
  145. StartWin.setBackgroundColor(BarPoz)
  146. StartWin.setTextColor(BarTxt)
  147. StartWin.clear()
  148. StartWin.setCursorPos (7, 5)
  149. StartWin.write"System Setting"
  150. StartWin.setCursorPos (1, 9)
  151. StartWin.write(verze)
  152. StartWin.setCursorPos (1, 1)
  153. StartWin.write"Pepek@Soft"
  154. StartWin.setCursorPos (22, 9)
  155. StartWin.write"2020"
  156. sleep(0.5)
  157. menu()
  158. end
  159.  
  160. function flista(n1, n2, n3, n4, n5, n6, n7)
  161. lista = window.create(term.current(),1,3,12,h-2)
  162. lista.setBackgroundColor(BarPoz)
  163. lista.setTextColor(BarTxt)
  164. lista.clear()
  165. lista.setCursorPos(2,3)
  166. lista.write(n1)
  167. lista.setCursorPos(2,5)
  168. lista.write(n2)
  169. lista.setCursorPos(2,7)
  170. lista.write(n3)
  171. lista.setCursorPos(2,9)
  172. lista.write(n4)
  173. lista.setCursorPos(2,11)
  174. lista.write(n5)
  175. lista.setCursorPos(2,13)
  176. lista.write(n6)
  177. lista.setCursorPos(2,15)
  178. lista.write(n7)
  179. lista.setCursorPos(2,h-2)
  180. lista.setTextColor(colors.white)
  181. lista.write("Pepek@Soft")
  182. end
  183.  
  184. function plocha()
  185. w, h = term.getSize()
  186. paintutils.drawLine(1, 1, w-1, 1, BarPoz)
  187. paintutils.drawPixel (w,1, colors.red)
  188. curs (w,1)
  189. txc(1)
  190. write "×"
  191. barW = window.create(term.current(),1,2,w,1)
  192. barW.setBackgroundColor(colors.gray)
  193. barW.clear()
  194. barW.setTextColor(colors.white)
  195. barW.setCursorPos(2,1)
  196. barW.write"Setting >"
  197. pozadi = window.create(term.current(),13,3,w,h-2)
  198. pbgc(colors.white)
  199. ptxc(colors.black)
  200. pozadi.clear()
  201. bgc(colors.lightGray)
  202. end
  203. -----------------------------------------------------------------------------
  204. if #tArgs > 0 then
  205. page = tArgs[1]
  206. else
  207. page = "main"
  208. end
  209.    
  210. function main()
  211. barW.setCursorPos(12,1)
  212. barW.write"Dashboard"
  213. pcurs(2,2)
  214. bgc(colors.white)
  215. txc(colors.black)
  216. ----------------------------------------------------
  217. write  ("Pepdroll Seven "..edice)
  218.     pcurs(2, 6)
  219.     write  "                                  "
  220.     pcurs(2, 6)
  221.     write  ("Free disk space: "..(tonumber(fs.getFreeSpace("/")/1000)).." kB")
  222.     pcurs(2, 7)
  223.     write  ("Use  disk space: "..(1000-tonumber(fs.getFreeSpace("/")/1000)).." kB")
  224.     vypMis = math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10
  225.     vypMis = math.ceil(vypMis/100*33)
  226.     misto = ""
  227.     bgc(colors.lightBlue)
  228.     pcurs(2, 8)
  229.     term.write "                                 " --33
  230.  
  231.     if (vypMis <24) then
  232.     pcurs(((33-vypMis)/2)+vypMis-2, 8)
  233.     term.write((100-(math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10)).."% Free")
  234.     elseif (vypMis <30) then
  235.     pcurs(((33-vypMis)/2)+vypMis, 8)
  236.     write "Free"
  237.     end
  238.    
  239.     for i=1,vypMis do
  240.     misto = misto.." "
  241.     end
  242.     bgc(colors.blue)
  243.     pcurs(2, 8)
  244.     term.write(misto)
  245.     ptxc(colors.black)
  246.     if (vypMis > 7) then
  247.         pcurs(((vypMis)/2)-2, 8)
  248.         term.write((math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10).."% Used")
  249.     elseif (vypMis > 2) then
  250.         pcurs(((vypMis)/2)+1, 8)
  251.         term.write((math.ceil(1000 - (tonumber(fs.getFreeSpace("/")/1000)))/10).."%")
  252.     end
  253.  
  254.     ptxc(colors.black)
  255.     bgc(colors.white)
  256.     internetcon = ""
  257.     internetsrv = ""
  258.     if fs.exists ("/C/system/RAM/online") then
  259.     ptxc(colors.black)
  260.     internetcon = "Internet access"
  261.     local data = fs.open("/C/system/RAM/online", "r") internetsrv = data.readLine() data.close()
  262.     else
  263.     ptxc(colors.red)
  264.     internetcon = "No internet access"
  265.     end
  266.     pcurs(12, 11)
  267.     write  (internetcon)
  268.     ptxc(colors.black)
  269.     pcurs(2, 11)
  270.     write  ("Network : ")
  271.     pcurs(2, 12)
  272.     write  ("Server  : "..internetsrv)
  273.    
  274.     pcurs(2, 14)
  275.     if os.getComputerLabel() == nil or os.getComputerLabel() == "" then
  276.         write  ("Label   : None")
  277.         else
  278.     write  ("Label   : "..(os.getComputerLabel()))
  279.     end
  280.     pcurs(2, 15)
  281.     write  ("Comp. ID: "..(os.getComputerID()))
  282.    
  283.     pcurs(2, 13)
  284.     pozadi.write  ("Update  :")
  285.     pcurs(12, 13)
  286.     if not fs.exists (systemRegistry..".disableUpdate") then
  287.         pozadi.write("Enable")
  288.     else
  289.         ptxc(colors.red) pozadi.write("Disabled")
  290.     end
  291. end
  292. ------------------------------------------------------------------------------------------------------------------ ucty
  293. function ADsend()
  294.     if adMode then
  295.         modem = peripheral.wrap(modemPos)
  296.         modem.open(idPC)
  297.         modem.transmit(tonumber(ADServer),554,idPC)
  298.         modem.transmit(tonumber(ADServer),555,user)
  299.         prijmout()
  300.        
  301.         if ADC then
  302.             local f=fs.open("/C/system/Users/"..user.."/.data","r")
  303.             Docuser = f.readAll()
  304.             f.close()
  305.             modem.transmit(tonumber(ADServer),557,Docuser)
  306.         end
  307.     end
  308. end
  309.  
  310. function account()
  311.     stavlog = " No"
  312.     if fs.exists("/C/system/.core/logon") then
  313.         local f = fs.open("/C/system/.core/logon", "r")
  314.         local Auser=f.readLine()
  315.         f.close()
  316.         if Auser == user then stavlog = "Yes" end
  317.     end
  318.    
  319.     barW.setCursorPos(12,1)
  320.     barW.write"Accounts"
  321.     pcurs(2,2)
  322.     txc(colors.black)
  323.     ----------------------------------------------------
  324.     bgc(colors.white)
  325.     write  ("Your info")
  326.  
  327.     bgc(colors.lightGray)
  328.     pcurs(14,5)
  329.     write  ("          ")
  330.     pcurs(15,5)
  331.     write(Fname)
  332.     pcurs(14,6)
  333.     write  ("          ")
  334.     pcurs(15,6)
  335.     write(Lname)
  336.     pcurs(2,13)
  337.     write  (" Password ")
  338.     pcurs(2,15)
  339.     write  (" Other Users ")
  340.     pcurs(19,11)
  341.     write  ("     ")
  342.     pcurs(20,11)
  343.     write(stavlog)
  344.     if stavlog=="Yes" then paintutils.drawPixel(35,13, colors.green) else paintutils.drawPixel(31,13, colors.red) end
  345.    
  346.    
  347.     bgc(colors.white)
  348.     pcurs(2,4)
  349.     write  ("Username:    "..user)
  350.     pcurs(2,5)
  351.     write  ("First name:")
  352.     pcurs(2,6)
  353.     write  ("Last name:  ")
  354.     pcurs(2,8)
  355.    
  356.     if (mistni == "t") then write("Local user") else write("Domain user") end
  357.     pcurs(2,9)
  358.     if (isAdmin == "t") then write("Administrator") else write("Limited account") end
  359.     pcurs(2,11)
  360.     write  ("Automatic login:")
  361.    
  362.            
  363.     bgc(colors.lightBlue)
  364. end
  365.  
  366. function passWin()
  367.     oPass = ""
  368.     nPass1 = ""
  369.     nPass2 = ""
  370.    
  371.     local function check()
  372.         eComp.setCursorPos (11, 6)
  373.         eComp.write"              "
  374.         if (nPass1 == nPass2) then
  375.             eComp.setTextColor(colors.lime)
  376.             eComp.setCursorPos (12, 6)
  377.             eComp.write("Same")
  378.             txc(colors.white)
  379.         else
  380.             eComp.setTextColor(colors.red)
  381.             eComp.setCursorPos (12, 6)
  382.             eComp.write("Different")
  383.             txc(colors.white)
  384.         end
  385.     end
  386.    
  387.     eComp = window.create(term.current(),w/2-5,h/2-4,25,9)
  388.     eComp.setBackgroundColor(colors.gray)
  389.     eComp.clear()
  390.     eComp.setBackgroundColor(colors.red)
  391.     eComp.setCursorPos (25, 1)
  392.     eComp.write"×"
  393.     eComp.setBackgroundColor(colors.gray)
  394.     eComp.setTextColor(colors.white)
  395.     eComp.setCursorPos (2, 1)
  396.     eComp.write"Change your password"
  397.     eComp.setCursorPos (2, 4)
  398.     eComp.write"Old: "
  399.     eComp.setCursorPos (2, 5)
  400.     eComp.write"New: "
  401.     eComp.setCursorPos (2, 6)
  402.     eComp.write"Confirm: "
  403.     eComp.setBackgroundColor(colors.lightGray)
  404.     eComp.setCursorPos (11, 4)
  405.     eComp.write"              "
  406.     eComp.setCursorPos (11, 5)
  407.     eComp.write"              "
  408.     check()
  409.     eComp.setTextColor(colors.white)
  410.     eComp.setCursorPos (10, 8)
  411.     eComp.write" Apply "
  412.    
  413.     while true do
  414.         local event, button, x, y = os.pullEvent("mouse_click")
  415.         xy = x..","..y
  416.         if event == "mouse_click" and x == 44 and y == 5 then
  417.             menu()
  418.         elseif event == "mouse_click" and x >= 30 and x <= 43 and y == 8 then
  419.             bgc(colors.lightBlue)
  420.             eComp.setCursorPos (11, 4)
  421.             write"              "
  422.             eComp.setCursorPos (12, 4)
  423.             oPass = read(string.char(7))
  424.             bgc(colors.lightGray)
  425.             eComp.setCursorPos (11, 4)
  426.             write"              "
  427.             eComp.setCursorPos (12, 4)
  428.                 for i=1,#oPass do
  429.                   write(string.char(7))
  430.                 end
  431.         elseif event == "mouse_click" and x >= 30 and x <= 43 and y == 9 then
  432.             bgc(colors.lightBlue)
  433.             eComp.setCursorPos (11, 5)
  434.             write"              "
  435.             eComp.setCursorPos (12, 5)
  436.             nPass1 = read(string.char(7))
  437.             check()
  438.             bgc(colors.lightGray)
  439.             eComp.setCursorPos (11, 5)
  440.             write"              "
  441.             eComp.setCursorPos (12, 5)
  442.                 for i=1,#nPass1 do
  443.                   write(string.char(7))
  444.                 end
  445.         elseif event == "mouse_click" and x >= 30 and x <= 43 and y == 10 then
  446.             bgc(colors.lightBlue)
  447.             eComp.setCursorPos (11, 6)
  448.             write"              "
  449.             eComp.setCursorPos (12, 6)
  450.             nPass2 = read(string.char(7))
  451.             check()
  452.         elseif event == "mouse_click" and x >= 29 and x <= 35 and y == 12 then
  453.         eComp.setTextColor(colors.white)
  454.         eComp.setBackgroundColor(colors.gray)
  455.         eComp.setCursorPos (10, 8)
  456.         eComp.write" Apply "
  457.         sleep(anim)
  458.             if (oPass == pass) then
  459.                 pass = nPass1
  460.                 if stavlog == "Yes" then
  461.                     local f = fs.open("/C/system/.core/logon","w")
  462.                     f.writeLine(user)
  463.                     f.writeLine(pass)
  464.                     f.close()
  465.                 end
  466.                 return
  467.             else
  468.             eComp.setCursorPos (2, 3)
  469.             eComp.write"Incorrect old password!"
  470.             eComp.setBackgroundColor(colors.lightGray)
  471.             eComp.setCursorPos (10, 8)
  472.             eComp.write" Apply "
  473.             song("error")
  474.             end
  475.         end
  476.         end
  477.     end
  478.  
  479. function CreateWindow()
  480.     DialWin = window.create(term.current(),14,4,25,14)
  481.     DialWin.setBackgroundColor(colors.gray)
  482.     DialWin.clear()
  483.     ww, wh = DialWin.getSize()
  484.     DialWin.setTextColor(colors.white)
  485.     DialWin.setBackgroundColor(colors.red)
  486.     DialWin.setCursorPos (25,1)
  487.     DialWin.write "×"
  488.     DialWin.setBackgroundColor(colors.lightGray)
  489.     DialWin.setCursorPos (10,13)
  490.     DialWin.write " Apply "
  491.     DialWin.setBackgroundColor(colors.gray)
  492.     DialWin.setTextColor(colors.white)
  493. end
  494.  
  495. function UserWin(SUser)
  496. defaultvalue()
  497.     if not (SUser == "") then
  498.     local f=fs.open("/C/system/Users/"..SUser.."/.data","r")
  499.     Cuser=f.readLine()
  500.     Cpass=f.readLine()
  501.     Fname=f.readLine()
  502.     Lname=f.readLine()
  503.     IsAdmin=f.readLine()
  504.     f.close()
  505.     end
  506.    
  507.     CreateWindow()
  508.     DialWin.setCursorPos (3,2)
  509.     DialWin.write "UserName:"
  510.     DialWin.setCursorPos (3,5)
  511.     DialWin.write "Password:"
  512.     DialWin.setCursorPos (3,7)
  513.     DialWin.write "F Name:"
  514.     DialWin.setCursorPos (3,9)
  515.     DialWin.write "L Name:"
  516.     DialWin.setCursorPos (3,11)
  517.     DialWin.write "Permissions:"
  518.     DialWin.setBackgroundColor(colors.lightGray)
  519.     DialWin.setCursorPos (3,3)
  520.     DialWin.write "                     "
  521.     DialWin.setCursorPos (13,5)
  522.     DialWin.write "           "
  523.     DialWin.setCursorPos (13,7)
  524.     DialWin.write "           "
  525.     DialWin.setCursorPos (13,9)
  526.     DialWin.write "           "
  527.     DialWin.setCursorPos (16,11)
  528.     DialWin.write "        "
  529.    
  530.     if (SUser == "") then
  531.        
  532.     else
  533.         DialWin.setCursorPos (4,3)
  534.         if (Nuser == " " or Nuser == nil) then
  535.         DialWin.write (tostring(Cuser))
  536.         else
  537.         DialWin.write (tostring(Nuser))
  538.         end
  539.         DialWin.setCursorPos (14,5)
  540.         DialWin.write "Password"
  541.         if Fname == nil then Fname = "" end
  542.         DialWin.setCursorPos (14,7)
  543.         DialWin.write (Fname)
  544.         if Lname == nil then Lname = "" end
  545.         DialWin.setCursorPos (14,9)
  546.         DialWin.write (Lname)
  547.         if (IsAdmin == "t") then
  548.         DialWin.setCursorPos (16,11)
  549.         DialWin.write " Admin  "
  550.         else
  551.         DialWin.setCursorPos (16,11)
  552.         DialWin.write " User   "
  553.         end
  554.     end
  555. while true do
  556.         local event, button, x, y = os.pullEvent("mouse_click")
  557.         xy = x..","..y
  558.        
  559.         curs(1,1)
  560.         write(x..","..y)
  561.        
  562.         if x >= 23 and x <= 29 and y == 16 and button == 1 then
  563.             DialWin.setCursorPos (10,13)
  564.             DialWin.write " Apply "
  565.             sleep(anim)
  566.             if Amode or SUser==user then
  567.                 if (SUser == "") then
  568.                     if not fs.exists ("/C/system/Users/"..Nuser.."/.data") and not (Nuser == "") and not (Nuser == nil)then
  569.                         local f=fs.open("/C/system/Users/"..Nuser.."/.data","w")
  570.                         f.writeLine(Nuser)
  571.                         f.writeLine(Npass)
  572.                         f.writeLine(NFname)
  573.                         f.writeLine(NLname)
  574.                         f.writeLine(IsAdmin)
  575.                         f.close()
  576.                     end
  577.                 else
  578.                     local f=fs.open("/C/system/Users/"..SUser.."/.data","w")
  579.                     f.writeLine(SUser)
  580.                     if not (Npass == " ") then f.writeLine(Npass) else f.writeLine("") end
  581.                     if not (NFname == " ") then f.writeLine(NFname) else f.writeLine("") end
  582.                     if not (NLname == " ") then f.writeLine(NLname) else f.writeLine("") end
  583.                     f.writeLine(IsAdmin)
  584.                     f.close()
  585.                 end
  586.             else
  587.             DialWin.setBackgroundColor(colors.gray)
  588.             DialWin.setCursorPos (5,14)
  589.             DialWin.write "You are not Admin!"
  590.             sleep(1)
  591.             end
  592.             defaultvalue()
  593.             menu()
  594.         elseif x >= 16 and x <= 36 and y == 6 and button == 1 then
  595.             bbarva()
  596.             DialWin.setBackgroundColor(colors.lightBlue)
  597.             DialWin.setCursorPos (3,3)
  598.             DialWin.write "                     "
  599.             DialWin.setCursorPos (4,3)
  600.             Nuser = read()
  601.         elseif x >= 26 and x <= 36 and y == 8 and button == 1 then
  602.             bbarva()
  603.             DialWin.setBackgroundColor(colors.lightBlue)
  604.             DialWin.setCursorPos (13,5)
  605.             DialWin.write "           "
  606.             DialWin.setCursorPos (14,5)
  607.             Npass = read(string.char(7))
  608.         elseif x >= 26 and x <= 36 and y == 10 and button == 1 then
  609.             bbarva()
  610.             DialWin.setBackgroundColor(colors.lightBlue)
  611.             DialWin.setCursorPos (13,7)
  612.             DialWin.write "           "
  613.             DialWin.setCursorPos (14,7)
  614.             NFname = read()
  615.         elseif x >= 26 and x <= 36 and y == 12 and button == 1 then
  616.             bbarva()
  617.             DialWin.setBackgroundColor(colors.lightBlue)
  618.             DialWin.setCursorPos (13,9)
  619.             DialWin.write "           "
  620.             DialWin.setCursorPos (14,9)
  621.             NLname = read()
  622.         elseif x >= 26 and x <= 36 and y == 14 and button == 1 then
  623.             DialWin.setCursorPos (16,11)
  624.            
  625.             if (IsAdmin == "t") then
  626.             IsAdmin = "f"
  627.             DialWin.write " User   "
  628.             else
  629.             DialWin.write " Admin  "
  630.             IsAdmin = "t"
  631.             end
  632.         elseif x == 38 and y == 4 and button == 1 then
  633.             defaultvalue()
  634.             menu()        
  635.         end
  636.     end
  637.  
  638. end
  639.    
  640. function Oaccount()
  641.     barW.setCursorPos(12,1)
  642.     barW.write"Accounts > Other Accounts"
  643.     pcurs(2,2)
  644.     txc(colors.black)
  645.     ----------------------------------------------------
  646.     bgc(colors.white)
  647.     write  ("Other users, loged user: "..user)
  648.    
  649.     UsrT = window.create(term.current(),14,6,w-14,h-3)
  650.     UsrT.setBackgroundColor(colors.lightBlue)
  651.     UsrT.setTextColor(colors.black)
  652.     UsrT.clear()
  653.  
  654.     cUsr = fs.list("/C/system/Users/")
  655.     local a=1
  656.     for i = 1, #cUsr do
  657.         local name = tostring(cUsr[i])
  658.         UsrT.setBackgroundColor(colors.lightBlue)
  659.         UsrT.setCursorPos(2,a)
  660.         UsrT.write(cUsr[i])
  661.         a = a+1        
  662.     end
  663.    
  664. end
  665.  
  666. function update()
  667.     barW.setCursorPos(12,1)
  668.     barW.write"Update > Update service"
  669.     pcurs(2,2)
  670.     txc(colors.black)
  671.        
  672.     if not fs.exists (systemRegistry..".disableUpdate") then Eupdate = "Yes" else Eupdate = " No" end
  673.     pcurs(2,4)
  674.     write(" Update now ")
  675.    
  676.     pcurs(2, 2)
  677.     pozadi.write  "Enable automatic update: "
  678.     pcurs(30, 2)
  679.     write  ("     ")
  680.     pcurs(31,2)
  681.     write(Eupdate)
  682.     if Eupdate=="Yes" then paintutils.drawPixel(46,4, colors.green) else paintutils.drawPixel(42,4, colors.red) end
  683.    
  684.     if fs.exists ("/C/system/RAM/UpdateList.tmp") then
  685.             local data = fs.open("/C/system/RAM/UpdateList.tmp", "r")
  686.             pcurs(2,7) pozadi.write(data.readLine())
  687.             pcurs(2,8) pozadi.write(data.readLine())
  688.             pcurs(2,9) pozadi.write(data.readLine())           
  689.             data.close()
  690.     end
  691.    
  692. end
  693. ------------------------------------------------------------------------------------------------------------------ network
  694. function prijmout()
  695. local odpoved = false
  696. timerRX = os.startTimer(2)
  697.     while true do
  698.     local event,p1,p2,p3,p4 = os.pullEvent()
  699.       if event == ("modem_message") then
  700.           if (p3 == 552) then
  701.             odpoved = true
  702.                 if (p4 == "true") then
  703.                     ptxc(colors.green)
  704.                     if not disAD then
  705.                     local c = fs.open ("/C/system/.core/AD", "w")
  706.                     c.writeLine(tostring(adID))
  707.                     c.close()
  708.                     pcurs(2,16)
  709.                     pozadi.write"Successfully connected!"
  710.                     else
  711.                     fs.delete("/C/system/.core/AD")
  712.                     pcurs(2,16)
  713.                     pozadi.write"Successfully disconnected!"
  714.                     mistni = "t"
  715.                     adMode = false
  716.                     zapsat()
  717.                     end
  718.                     sleep(0.5)
  719.                     os.reboot()
  720.                 else
  721.                 pcurs(2,16)
  722.                 ptxc(colors.red)
  723.                 pozadi.write"Error, invalid login!"
  724.                
  725.                 if sound then song("login") sleep (0.5)
  726.                 else sleep(1) end
  727.                
  728.                
  729.                 end
  730.             elseif (p3 == 1) then
  731.                 if (p4 == user) then
  732.                 ADC = true
  733.                 else
  734.                 ADC = false
  735.                 end
  736.                 return
  737.             end
  738.       elseif event == "timer" then
  739.         if p1 >= timerRX then
  740.         pcurs(2,16)
  741.         ptxc(colors.red)
  742.         ADC = false
  743.         if not odpoved then pozadi.write"Error, server not found!" sleep(1) end
  744.         menu()
  745.         end
  746.       end
  747.     end
  748. end
  749.  
  750. function defmodem(size)
  751. local dm = fs.open("/C/system/.core/defmodem","w")
  752. dm.writeLine(size)
  753. dm.close()
  754. end
  755.  
  756. function dotaz()
  757.     if not (adID == nil) then
  758.     modemC.open(idPC)
  759.     modemC.transmit(tonumber(adID),550,idPC)
  760.     if disAD then modemC.transmit(tonumber(adID),553,"DisConnect") end
  761.     modemC.transmit(tonumber(adID),551,adUser)
  762.     modemC.transmit(tonumber(adID),552,adPass)
  763.     prijmout()
  764.     end
  765. end
  766.  
  767. function network()
  768.     barW.setCursorPos(12,1)
  769.     barW.write"Network"
  770.     pcurs(2,2)
  771.     txc(colors.black)
  772.     pbgc(colors.white)
  773.    
  774.     if fs.exists("/C/system/.core/defmodem") then
  775.         s = fs.open("/C/system/.core/defmodem","r")
  776.         modemPos = s.readLine()
  777.         s.close()
  778.         AD = true
  779.         modemE = peripheral.wrap(modemPos)
  780.         if not modemE then
  781.             fs.delete("/C/system/.core/defmodem")
  782.             network()
  783.         end
  784.     else
  785.         modemPos = "offline"
  786.         AD = false
  787.     end
  788.    
  789.     ptxc(colors.black)
  790.     pcurs(2,1)
  791.     pozadi.write"Primary modem"
  792.     pcurs(2,10)
  793.     pozadi.write"Set Label:"
  794.     pbgc(colors.lightGray)
  795.     pcurs(14,10)
  796.     pozadi.write"               "
  797.  
  798.     if not os.getComputerLabel() == nil or not os.getComputerLabel() == "" then
  799.     pcurs(15,10)
  800.     write  (os.getComputerLabel())
  801.     end
  802.     if not (modemPos == "offline") then
  803.     pbgc(colors.white)
  804.             pcurs(2,14)
  805.             pozadi.write"Admin user:"
  806.             pcurs(2,15)
  807.             pozadi.write"Admin pass:"
  808.         if not adMode then
  809.             pcurs(2,13)
  810.             pozadi.write"Server  ID:"
  811.             pcurs(2,12)
  812.             pozadi.write"Connect to AD server:"
  813.             pbgc(colors.lightGray)
  814.             pcurs(14,13)
  815.             pozadi.write"               "
  816.             if not (adID == nil) then pcurs(15,13) pozadi.write(tostring(adID)) end
  817.             pcurs(14,14)
  818.             pozadi.write"               "
  819.             if not (adUser == "" or adUser == nil) then pcurs(15,14) pozadi.write(adUser) end
  820.             pcurs(14,15)
  821.             pozadi.write"               "
  822.             if not (adPass == ""or adPass == nil) then
  823.             pcurs(15,15)
  824.                 for i=1,#adPass do
  825.                 pozadi.write(string.char(7))
  826.                 end
  827.             end
  828.             pbgc(colors.lightGray)
  829.             ww = w-12
  830.             pcurs(ww/2+1,h-2)
  831.             pozadi.write" Connect "
  832.         else
  833.             pcurs(2,12)
  834.             pozadi.write("Your AD server ID: "..ADServer)
  835.             pbgc(colors.lightGray)
  836.             pcurs(14,14)
  837.             pozadi.write"               "
  838.             adID = ADServer
  839.             if not (adUser == "" or adUser == nil) then pcurs(15,14) pozadi.write(adUser) end
  840.             pcurs(14,15)
  841.             pozadi.write"               "
  842.             if not (adPass == ""or adPass == nil) then
  843.             pcurs(15,15)
  844.                 for i=1,#adPass do
  845.                 pozadi.write(string.char(7))
  846.                 end
  847.             end
  848.             pbgc(colors.lightGray)
  849.             ww = w-12
  850.             pcurs(ww/2+1,h-2)
  851.             pozadi.write" Disconnect "
  852.         end
  853.     end
  854.    
  855.     ptxc(colors.black)
  856.     pbgc(colors.lightGray)
  857.     pcurs(8,3)
  858.     if (modemPos == "top") then pbgc(colors.gray) else pbgc(colors.lightGray) end
  859.     pozadi.write" TOP     "
  860.     pcurs(8,5)
  861.     if (modemPos == "left") then pbgc(colors.gray) else pbgc(colors.lightGray) end
  862.     pozadi.write" LEFT    "
  863.     pcurs(8,7)
  864.     if (modemPos == "right") then pbgc(colors.gray) else pbgc(colors.lightGray) end
  865.     pozadi.write" RIGHT   "
  866.     pcurs(20,3)
  867.     if (modemPos == "back") then pbgc(colors.gray) else pbgc(colors.lightGray) end
  868.     pozadi.write" BACK    "
  869.     pcurs(20,5)
  870.     if (modemPos == "bottom") then pbgc(colors.gray) else pbgc(colors.lightGray) end
  871.     pozadi.write" BOTTOM  "
  872.     pcurs(20,7)
  873.     if (modemPos == "offline") then pbgc(colors.gray) else pbgc(colors.lightGray) end
  874.     pozadi.write" OFFLINE "
  875. end
  876. ------------------------------------------------------------------------------------------------------------------ System
  877. function sounds()
  878.  
  879. if fs.exists("/C/system/RAM/devices/speaker.tmp") and not fs.exists(userRegistry..".disableSound") then
  880.     sound = true
  881. else
  882.     sound = false
  883.     end
  884.    
  885.     barW.setCursorPos(12,1)
  886.     barW.write"Sounds"
  887.     pcurs(2,2)
  888.     txc(colors.black)
  889.     pbgc(colors.white)
  890.    
  891.     if not fs.exists (userRegistry..".disableSound") then Esound = "Yes" else Esound = " No" end
  892.  
  893.     pcurs(2, 2)
  894.     pozadi.write  "Enable sound notifications: "
  895.     pcurs(30, 2)
  896.     write  ("     ")
  897.     pcurs(31,2)
  898.     write(Esound)
  899.     if Esound=="Yes" then paintutils.drawPixel(46,4, colors.green) else paintutils.drawPixel(42,4, colors.red) end
  900. end
  901.  
  902. function system()
  903.     barW.setCursorPos(12,1)
  904.     barW.write"Display"
  905.     pcurs(2,2)
  906.     txc(colors.black)
  907.     pbgc(colors.white)
  908.  
  909.     pcurs(2, 2)
  910.     pozadi.write  "Connecting the monitor"
  911.     pcurs(2, 12)
  912.     pozadi.write"No monitor:"
  913.     pcurs(2, 10)
  914.     pozadi.write"User define: "
  915.     pcurs(2, 16)
  916.     pozadi.write"Show hidden items: "
  917.     pcurs(2, 14)
  918.     pozadi.write"Show real time: "
  919.     pbgc(colors.lightGray)
  920.     pcurs(7,5)
  921.     pozadi.write" Left "
  922.     pcurs(14,5)
  923.     pozadi.write" Right  "
  924.     pcurs(23,5)
  925.     pozadi.write" Back "
  926.     pcurs(7, 7)
  927.     pozadi.write " Top  "
  928.     pcurs(14, 7)
  929.     pozadi.write " Bottom "
  930.     pcurs(23,7)
  931.     pozadi.write" Find "
  932.     pcurs(15, 10)
  933.     pozadi.write"            "
  934.     pcurs(15, 12)
  935.     pozadi.write " Disconect "
  936.     if not fs.exists (userRegistry..".showItem") then sItem = " No" else sItem = "Yes" end
  937.     pcurs(30, 16)
  938.     pozadi.write  ("     ")
  939.     pcurs(31,16)
  940.     pozadi.write(sItem)
  941.     if sItem=="Yes" then paintutils.drawPixel(46,18, colors.green) else paintutils.drawPixel(42,18, colors.red) end
  942.    
  943.     if fs.exists (userRegistry..".realTime") then Ertime = "Yes" else Ertime = " No" end
  944.     pcurs(30, 14)
  945.     pozadi.write  ("     ")
  946.     pcurs(31,14)
  947.     pozadi.write(Ertime)
  948.     if Ertime=="Yes" then paintutils.drawPixel(46,16, colors.green) else paintutils.drawPixel(42,16, colors.red) end
  949.    
  950.     pbgc(colors.gray)
  951.  
  952.  
  953. end
  954.  
  955. function recovery()
  956.     barW.setCursorPos(12,1)
  957.     barW.write"Recovery"
  958.     pcurs(2,2)
  959.     txc(colors.black)
  960.     pbgc(colors.white)
  961.    
  962.     pcurs(2, 2)
  963.     pozadi.write "Select what to recover:"
  964.    
  965.     bgc(colors.lightGray)
  966.     pcurs(2, 6)
  967.     term.write " Users and Settings  "
  968.     pcurs(2, 8)
  969.     term.write " Reinstall System    "
  970.    -- pcurs(2, 10)
  971.     --term.write " Partially reinstall "
  972.     --pbgc(colors.gray)
  973.  
  974. end
  975. ------------------------------------------------------------------------------------------------------------------ vzhled
  976. function appearance()
  977. Barvy()
  978.  
  979. if fs.exists (userRegistry..".menuColor") then CCM = "Yes" else CCM = " No" end
  980.     barW.setCursorPos(12,1)
  981.     barW.write"Appearance"
  982.     pcurs(2,2)
  983.     ptxc(colors.black)
  984.     pbgc(colors.white)
  985.     pcurs(2,4)
  986.     pozadi.write"Text color:"
  987.     pcurs(2,6)
  988.     pozadi.write"Rear color:"
  989.     pcurs(2,8)
  990.     pozadi.write"Menu has theme color:"
  991.     pcurs(24,8)
  992.     write  ("     ")
  993.     pcurs(25,8)
  994.     write(CCM)
  995.     if CCM=="Yes" then paintutils.drawPixel(40,10, colors.green) else paintutils.drawPixel(36,10, colors.red) end
  996.    
  997.     if not fs.exists (userRegistry..".disableAnim") then Eanim = "Yes" else Eanim = " No" end
  998.     bgc(colors.lightGray)
  999.     pcurs(2, 2)
  1000.     pozadi.write  "Enable animations:  "
  1001.     pcurs(24, 2)
  1002.     write  ("     ")
  1003.     pcurs(25,2)
  1004.     write(Eanim)
  1005.     if Eanim =="Yes" then paintutils.drawPixel(40,4, colors.green) else paintutils.drawPixel(36,4, colors.red) end
  1006.    
  1007.     pcurs(2,10)
  1008.     pozadi.write"Change Backgrounds"
  1009.     pbgc(colors.lightGray)
  1010.     pcurs(14,4)
  1011.     pozadi.write"                V"
  1012.     pcurs(14,6)
  1013.     pozadi.write"                V"
  1014.     pcurs(2,12)
  1015.     pozadi.write" Solid Color "
  1016.     pcurs(2,14)
  1017.     pozadi.write" Castle      "
  1018.     pcurs(2,16)
  1019.     pozadi.write" Windows XP  "
  1020.     pcurs(18,12)
  1021.     pozadi.write" Pepdroll 7  "
  1022.     pcurs(18,14)
  1023.     pozadi.write" Farm        "
  1024.     pcurs(18,16)
  1025.     pozadi.write" Pastebin    "
  1026.  
  1027.     local nb = BarTxt
  1028.     local t
  1029.     pcurs(15,4)
  1030.     if (nb==1) then t="White" elseif (nb==32768) then t="Black" elseif (nb==16384) then t="Red" elseif (nb==8192) then t="Green" elseif (nb==32) then t="Lime" elseif (nb==16) then t="Yellow" elseif (nb==8) then t="Light Blue" elseif (nb==2048) then t="Blue" elseif (nb==256) then t="Light Gray" elseif (nb==128) then t="Gray" else t="Other" end
  1031.     pozadi.write(t)
  1032.     nb = BarPoz
  1033.     pcurs(15,6)
  1034.     if (nb==1) then t="White" elseif (nb==32768) then t="Black" elseif (nb==16384) then t="Red" elseif (nb==8192) then t="Green" elseif (nb==32) then t="Lime" elseif (nb==16) then t="Yellow" elseif (nb==8) then t="Light Blue" elseif (nb==2048) then t="Blue" elseif (nb==256) then t="Light Gray" elseif (nb==128) then t="Gray" else t="Other" end
  1035.     pozadi.write(t)
  1036.     pbgc(colors.gray)
  1037.    
  1038. end
  1039.  
  1040. function textBarva()
  1041.     local textW = window.create(term.current(),26,6,17,10)
  1042.     textW.setBackgroundColor(BarPoz)
  1043.     textW.clear()
  1044.     textW.setCursorPos(2,1)
  1045.     textW.setTextColor(1)
  1046.     textW.write("White")
  1047.     textW.setCursorPos(2,2)
  1048.     textW.setTextColor(32768)
  1049.     textW.write("Black")
  1050.     textW.setCursorPos(2,3)
  1051.     textW.setTextColor(16384)
  1052.     textW.write("Red")
  1053.     textW.setCursorPos(2,4)
  1054.     textW.setTextColor(8192)
  1055.     textW.write("Green")
  1056.     textW.setCursorPos(2,5)
  1057.     textW.setTextColor(32)
  1058.     textW.write("Lime")
  1059.     textW.setCursorPos(2,6)
  1060.     textW.setTextColor(16)
  1061.     textW.write("Yellow")
  1062.     textW.setCursorPos(2,7)
  1063.     textW.setTextColor(8)
  1064.     textW.write("Light Blue")
  1065.     textW.setCursorPos(2,8)
  1066.     textW.setTextColor(2048)
  1067.     textW.write("Blue")
  1068.     textW.setCursorPos(2,9)
  1069.     textW.setTextColor(256)
  1070.     textW.write("Light Gray")
  1071.     textW.setCursorPos(2,10)
  1072.     textW.setTextColor(128)
  1073.     textW.write("Gray")
  1074.    
  1075.     while true do
  1076.         local event, button, x, y = os.pullEvent("mouse_click")
  1077.         xy = x..","..y
  1078.        
  1079.         if event == "mouse_click" and x >= 26 and x <= 42 then
  1080.             if y == 6 then
  1081.             text=1
  1082.             elseif y == 7 then
  1083.             text=32768
  1084.             elseif y == 8 then
  1085.             text=16384
  1086.             elseif y == 9 then
  1087.             text=8192
  1088.             elseif y == 10 then
  1089.             text=32
  1090.             elseif y == 11 then
  1091.             text=16
  1092.             elseif y == 12 then
  1093.             text=8
  1094.             elseif y == 13 then
  1095.             text=2048
  1096.             elseif y == 14 then
  1097.             text=256
  1098.             elseif y == 15 then
  1099.             text=128
  1100.             end
  1101.            
  1102.             if adMode then sync() end
  1103.             local f=fs.open(userRegistry.."colors","w") --#otevrit soubor
  1104.             f.writeLine(BarPoz)
  1105.             f.writeLine(text)
  1106.             f.close()
  1107.             Barvy()
  1108.             menu()
  1109.         else
  1110.             menu()
  1111.         end
  1112.     end
  1113. end
  1114.  
  1115. function backBarva()
  1116. local textW = window.create(term.current(),26,8,17,10)
  1117. textW.setTextColor(BarTxt)
  1118. textW.setCursorPos(1,1)
  1119. textW.setBackgroundColor(1)
  1120. textW.write(" White           ")
  1121. textW.setCursorPos(1,2)
  1122. textW.setBackgroundColor(32768)
  1123. textW.write(" Black           ")
  1124. textW.setCursorPos(1,3)
  1125. textW.setBackgroundColor(16384)
  1126. textW.write(" Red             ")
  1127. textW.setCursorPos(1,4)
  1128. textW.setBackgroundColor(8192)
  1129. textW.write(" Green           ")
  1130. textW.setCursorPos(1,5)
  1131. textW.setBackgroundColor(32)
  1132. textW.write(" Lime            ")
  1133. textW.setCursorPos(1,6)
  1134. textW.setBackgroundColor(16)
  1135. textW.write(" Yellow          ")
  1136. textW.setCursorPos(1,7)
  1137. textW.setBackgroundColor(8)
  1138. textW.write(" Light Blue      ")
  1139. textW.setCursorPos(1,8)
  1140. textW.setBackgroundColor(2048)
  1141. textW.write(" Blue            ")
  1142. textW.setCursorPos(1,9)
  1143. textW.setBackgroundColor(256)
  1144. textW.write(" Light Gray      ")
  1145. textW.setCursorPos(1,10)
  1146. textW.setBackgroundColor(128)
  1147. textW.write(" Gray            ")
  1148.  
  1149. while true do
  1150.         local event, button, x, y = os.pullEvent("mouse_click")
  1151.         xy = x..","..y
  1152.        
  1153.         if event == "mouse_click" and x >= 26 and x <= 42 then
  1154.             if y == 8 then
  1155.             nastaveni=1
  1156.             elseif y == 9 then
  1157.             nastaveni=32768
  1158.             elseif y == 10 then
  1159.             nastaveni=16384
  1160.             elseif y == 11 then
  1161.             nastaveni=8192
  1162.             elseif y == 12 then
  1163.             nastaveni=32
  1164.             elseif y == 13 then
  1165.             nastaveni=16
  1166.             elseif y == 14 then
  1167.             nastaveni=8
  1168.             elseif y == 15 then
  1169.             nastaveni=2048
  1170.             elseif y == 16 then
  1171.             nastaveni=256
  1172.             elseif y == 17 then
  1173.             nastaveni=128
  1174.             end
  1175.            
  1176.             if adMode then sync() end
  1177.             local f=fs.open(userRegistry.."colors","w")
  1178.             f.writeLine(nastaveni)
  1179.             f.writeLine(BarTxt)
  1180.             f.close()
  1181.             Barvy()
  1182.             menu()
  1183.         else
  1184.             menu()
  1185.         end
  1186.     end
  1187.    
  1188. end
  1189.  
  1190. function sync()
  1191.  
  1192.         function zabalit(Zabal)
  1193.         local f=fs.open(Zabal,"r")
  1194.         sync_object=f.readAll()
  1195.         f.close()
  1196.         end
  1197.        
  1198.     if not (modemPos == "offline") then
  1199.         modem = peripheral.wrap(modemPos)
  1200.         modem.open(idPC)
  1201.         modem.transmit(tonumber(ADServer),554, idPC)
  1202.         modem.transmit(tonumber(ADServer),555, user) --sync plocha
  1203.        
  1204.         if fs.exists(userRegistry.."bar.nfp") then
  1205.         zabalit(userRegistry.."bar.nfp","r")
  1206.         modem.transmit(tonumber(ADServer),560, sync_object) --sync plocha
  1207.         end
  1208.        
  1209.         if fs.exists(userRegistry.."colors") then
  1210.         zabalit(userRegistry.."colors","r")
  1211.         modem.transmit(tonumber(ADServer),561, sync_object) --sync barva pozadi
  1212.         end
  1213.    
  1214.         else
  1215.     end
  1216. end
  1217.  
  1218. function RegistrySync(Reg, Regstatus)
  1219.     if not (modemPos == "offline") then
  1220.         modem = peripheral.wrap(modemPos)
  1221.         modem.open(idPC)
  1222.         modem.transmit(tonumber(ADServer),554, idPC)
  1223.         modem.transmit(tonumber(ADServer),555, user)
  1224.         modem.transmit(tonumber(ADServer),563, Reg)
  1225.         modem.transmit(tonumber(ADServer),564, Regstatus)
  1226.     end
  1227. end
  1228.  
  1229. function SolidCol()
  1230.     barW.setCursorPos(12,1)
  1231.     barW.write"Background Color"
  1232.     pcurs(2,2)
  1233.     txc(colors.black)
  1234.     pbgc(colors.white)
  1235.    
  1236.     pcurs(2, 2)
  1237.     pozadi.write "Choose the color of your background:"
  1238.    
  1239.     pbgc(colors.lightGray)
  1240.     pcurs(2, 4)
  1241.     pozadi.write "    Black   "
  1242.    
  1243.     pcurs(2, 6)
  1244.     pozadi.write "    Brown   "
  1245.    
  1246.     pcurs(2, 8)
  1247.     pozadi.write " Light gray "
  1248.    
  1249.     pcurs(2, 10)
  1250.     pozadi.write " Light blue "
  1251.    
  1252.     pcurs(2, 12)
  1253.     pozadi.write "    Cyan    "
  1254.     pbgc(colors.gray)
  1255. end
  1256. ------------------------------------------------------------------------------------------------------------------ menu
  1257. function menu()
  1258.     readuser()
  1259.     plocha()
  1260.    
  1261.     if (page == "main") then
  1262.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1263.         main()
  1264.     elseif (page == "account") then
  1265.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1266.         account()
  1267.     elseif (page == "Oaccount") then
  1268.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1269.         Oaccount()
  1270.     elseif (page == "network") then
  1271.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1272.         network()
  1273.     elseif (page == "system") then
  1274.         flista("< System", "Display", "Sounds", "Recovery", "", "","")
  1275.         system()
  1276.     elseif (page == "Sounds") then
  1277.         flista("< System", "Display", "Sounds", "Recovery", "", "","")
  1278.         sounds()
  1279.     elseif (page == "recovery") then
  1280.         flista("< System", "Display", "Sounds", "Recovery", "", "","")
  1281.         recovery()
  1282.     elseif (page == "appearance") then
  1283.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1284.         appearance()
  1285.     elseif (page == "SolidCol") then
  1286.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1287.         SolidCol()
  1288.     elseif (page == "update") then
  1289.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1290.         update()
  1291.     else
  1292.         flista("Dashboard", "Accounts", "Network", "System", "Appearance", "Update","")
  1293.         pcurs(2,2)
  1294.         ptxc(colors.red)
  1295.         pbgc(colors.white)
  1296.         pozadi.write("Page not found")
  1297.     end
  1298.  
  1299.     while true do
  1300.         local event, button, x, y = os.pullEvent("mouse_click")
  1301.         xy = x..","..y
  1302.        
  1303.                 if x == w and y == 1 then
  1304.             ukonceni ()
  1305.         else
  1306.        
  1307.         if (page == "appearance") then
  1308.             local function smazat()
  1309.                 if fs.exists(userRegistry.."bar.nfp") then fs.delete(userRegistry.."bar.nfp") end
  1310.                 if fs.exists(userRegistry..".BackgroundColor") then fs.delete(userRegistry..".BackgroundColor") end
  1311.             end
  1312.            
  1313.             if event == "mouse_click" and x >= 26 and x <= 42 and y == 6 then
  1314.             textBarva()
  1315.             if adMode then sync() end
  1316.             elseif event == "mouse_click" and x >= 35 and x <= 40 and y == 10 then
  1317.                 if CCM == " No" then
  1318.                 local f = fs.open(userRegistry..".menuColor","w")
  1319.                 f.close()
  1320.                 else
  1321.                 fs.delete (userRegistry..".menuColor")
  1322.                 end
  1323.                 if adMode then if fs.exists(userRegistry..".menuColor") then RegistrySync(".menuColor", "true") else RegistrySync(".menuColor", "false") end end
  1324.                 appearance()
  1325.             elseif event == "mouse_click" and x >= 35 and x <= 40 and y == 4 then
  1326.                 if Eanim == "Yes" then
  1327.                     local k = fs.open(userRegistry..".disableAnim","w")
  1328.                     k.close()
  1329.                     else
  1330.                     fs.delete (userRegistry..".disableAnim")
  1331.                 end
  1332.                 appearance()
  1333.             elseif event == "mouse_click" and x >= 26 and x <= 42 and y == 8 then
  1334.             backBarva()
  1335.             if adMode then sync() end
  1336.             elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 14 then
  1337.                 pcurs(2,12)
  1338.                 pozadi.write" Solid Color "
  1339.                 sleep(anim)
  1340.                 smazat()
  1341.                 page = "SolidCol"
  1342.             elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 16 then
  1343.                 pcurs(2,14)
  1344.                 pozadi.write" Castle      "
  1345.                 sleep(anim)
  1346.                 smazat()
  1347.                 downloading("C3MXEfYf", userRegistry.."bar.nfp")
  1348.                 if adMode then sync() end
  1349.             elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 18 then
  1350.                 pcurs(2,16)
  1351.                 pozadi.write" Windows XP  "
  1352.                 sleep(anim)
  1353.                 smazat()
  1354.                 downloading("iy3EcA4Z", userRegistry.."bar.nfp")
  1355.                 if adMode then sync() end
  1356.             elseif event == "mouse_click" and x >= 30 and x <= 42 and y == 14 then
  1357.                 pcurs(18,12)
  1358.                 pozadi.write" Pepdroll 7  "
  1359.                 sleep(anim)
  1360.                 smazat()
  1361.                 downloading("ZQ8BBcVQ", userRegistry.."bar.nfp")
  1362.                 if adMode then sync() end
  1363.             elseif event == "mouse_click" and x >= 30 and x <= 42 and y == 16 then
  1364.                 pcurs(18,14)
  1365.                 pozadi.write" Farm        "
  1366.                 sleep(anim)
  1367.                 smazat()
  1368.                 downloading("K0zXPiKn", userRegistry.."bar.nfp")
  1369.                 if adMode then sync() end
  1370.             elseif event == "mouse_click" and x >= 30 and x <= 42 and y == 18 then
  1371.                 pcurs(18,16)
  1372.                 pbgc(colors.lightBlue)
  1373.                 bgc(colors.lightBlue)
  1374.                 pozadi.write"             "
  1375.                 pcurs(19,16)
  1376.                 local kodB = read()
  1377.                 sleep(anim)
  1378.                 if not (kodB == "") then
  1379.                 smazat()
  1380.                 downloading(kodB, "/C/system/Users/"..user.."bar.nfp")
  1381.                 if adMode then sync() end
  1382.                 end
  1383.             end
  1384.        
  1385.         elseif (page == "SolidCol") then
  1386.             local function zapis(barva)
  1387.                 local data = fs.open(userRegistry..".BackgroundColor", "w")
  1388.                 data.writeLine(barva)
  1389.                 data.close()   
  1390.             end
  1391.    
  1392.             if event == "mouse_click" and x >= 14 and x <= 24 then
  1393.                     if y == 6 then
  1394.                     zapis("32768")
  1395.                     pcurs(2, 4)
  1396.                     pozadi.write "    Black   "
  1397.                     elseif y == 8 then
  1398.                     zapis("4096")
  1399.                     pcurs(2, 6)
  1400.                     pozadi.write "    Brown   "
  1401.                     elseif y == 10 then
  1402.                     zapis("256")
  1403.                     pcurs(2, 8)
  1404.                     pozadi.write " Light gray "
  1405.                     elseif y == 12 then
  1406.                     zapis("8")
  1407.                     pcurs(2, 10)
  1408.                     pozadi.write " Light blue "
  1409.                     elseif y == 14 then
  1410.                     zapis("512")
  1411.                     pcurs(2, 12)
  1412.                     pozadi.write "    Cyan    "
  1413.                     end
  1414.                 sleep(anim)
  1415.                 page = "appearance"
  1416.                 menu()
  1417.             end
  1418.         elseif (page == "account") then
  1419.            
  1420.             if event == "mouse_click" and x >= 26 and x <= 35 and y == 7 then
  1421.             pcurs(14,5)
  1422.             write  ("          ")
  1423.             pcurs(15,5)
  1424.             Fname = read()
  1425.             zapsat()
  1426.             menu()
  1427.             elseif event == "mouse_click" and x >= 26 and x <= 35 and y == 8 then
  1428.             pcurs(14,6)
  1429.             write  ("          ")
  1430.             pcurs(15,6)
  1431.             Lname = read()
  1432.             zapsat()
  1433.             menu()
  1434.             elseif event == "mouse_click" and x >= 31 and x <= 35 and y == 13 then
  1435.             pcurs(19,11)
  1436.             bgc(colors.gray)
  1437.                 if stavlog == "Yes" then
  1438.                     fs.delete("/C/system/.core/logon")
  1439.                 else
  1440.                     local f = fs.open("/C/system/.core/logon","w")
  1441.                     f.writeLine(user)
  1442.                     f.writeLine(pass)
  1443.                     f.close()
  1444.                 end
  1445.             menu()
  1446.             elseif event == "mouse_click" and x >= 14 and x <= 23 and y == 15 then
  1447.             bgc(colors.gray)
  1448.             pcurs(2,13)
  1449.             write  (" Password ")
  1450.             sleep(anim)
  1451.             passWin()
  1452.             zapsat()
  1453.             menu()
  1454.             elseif event == "mouse_click" and x >= 14 and x <= 26 and y == 17 then
  1455.             bgc(colors.gray)
  1456.             pcurs(2,15)
  1457.             write  (" Other Users ")
  1458.             sleep(anim)
  1459.             page = "Oaccount"
  1460.             end
  1461.         elseif (page == "Oaccount") then
  1462.             if event == "mouse_click" and x >= 11 and x <= 20 and y == 2 then
  1463.                 page = "account"
  1464.             elseif event == "mouse_click" and x >= 14 and x<= w-1 and y >= 6 and button == 1 then
  1465.                 i = y-5
  1466.                 if not (cUsr[i] == nil) then
  1467.                 paintutils.drawLine(14, y, w-1, y, colors.lightGray)
  1468.                 curs(15,y)
  1469.                 write(cUsr[i])
  1470.                 sleep(anim)
  1471.                 UserWin(cUsr[i])
  1472.                 end
  1473.             end
  1474.         elseif (page == "network") then
  1475.             if event == "mouse_click" and x >= 20 and x<= 28 and y == 5 and button == 1 then
  1476.             defmodem("top")
  1477.             network()
  1478.             elseif event == "mouse_click" and x >= 32 and x<= 40 and y == 5 and button == 1 then
  1479.             defmodem("back")
  1480.             network()
  1481.             elseif event == "mouse_click" and x >= 20 and x<= 28 and y == 7 and button == 1 then
  1482.             defmodem("left")
  1483.             network()
  1484.             elseif event == "mouse_click" and x >= 32 and x<= 40 and y == 7 and button == 1 then
  1485.             defmodem("bottom")
  1486.             network()
  1487.             elseif event == "mouse_click" and x >= 20 and x<= 28 and y == 9 and button == 1 then
  1488.             defmodem("right")
  1489.             network()
  1490.             elseif event == "mouse_click" and x >= 32 and x<= 40 and y == 9 and button == 1 then
  1491.                 if fs.exists("/C/system/.core/defmodem") then
  1492.                     fs.delete("/C/system/.core/defmodem")
  1493.                 end
  1494.             network()
  1495.             elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 12 and button == 1 then
  1496.             bgc(colors.lightBlue)
  1497.             pbgc(colors.lightBlue)
  1498.             pcurs(14,10)
  1499.             pozadi.write"               "
  1500.             pcurs(15,10)
  1501.             local propojeni = read()
  1502.             os.setComputerLabel(propojeni)
  1503.             network()
  1504.             elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 15 and AD and button == 1 then
  1505.             bgc(colors.lightBlue)
  1506.             pbgc(colors.lightBlue)
  1507.             pcurs(14,13)
  1508.             pozadi.write"               "
  1509.             pcurs(15,13)
  1510.             adID = read()
  1511.             network()
  1512.             elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 16 and AD and button == 1 then
  1513.             bgc(colors.lightBlue)
  1514.             pbgc(colors.lightBlue)
  1515.             pcurs(14,14)
  1516.             pozadi.write"               "
  1517.             pcurs(15,14)
  1518.             prepisAD = true
  1519.             adUser = read()
  1520.             network()
  1521.             elseif event == "mouse_click" and x >= 26 and x<= 40 and y == 17 and AD and button == 1 then
  1522.             bgc(colors.lightBlue)
  1523.             pbgc(colors.lightBlue)
  1524.             pcurs(14,15)
  1525.             pozadi.write"               "
  1526.             pcurs(15,15)
  1527.             prepisAD = true
  1528.             adPass = read(string.char(7))
  1529.             network()
  1530.             elseif event == "mouse_click" and x >= 32 and x<= 40 and y == h and button == 1 and not adMode and not (adUser == "" or adUser == nil) then
  1531.                 pbgc(colors.gray)
  1532.                 pcurs(ww/2+1,h-2)
  1533.                 pozadi.write" Connect "
  1534.                 sleep(0.1)
  1535.                 pbgc(colors.white)
  1536.                 if AD then
  1537.                     modemC = peripheral.wrap(modemPos)
  1538.                     dotaz()
  1539.                 end
  1540.                 adPass = ""
  1541.                 network()
  1542.             elseif event == "mouse_click" and x >= 32 and x<= 43 and y == h and button == 1 and adMode and not (adUser == "" or adUser == nil) then
  1543.                 pbgc(colors.gray)
  1544.                 pcurs(ww/2+1,h-2)
  1545.                 pozadi.write" Disconnect "
  1546.                 disAD = true
  1547.                 sleep(0.1)
  1548.                 pbgc(colors.white)
  1549.                 if AD then
  1550.                     modemC = peripheral.wrap(modemPos)
  1551.                     dotaz()
  1552.                 end
  1553.                 adPass = ""
  1554.                 network()
  1555.             end
  1556.         elseif (page == "system") then
  1557.        
  1558.         local function setmonitor()
  1559.  
  1560.             if fs.exists("/C/system/.core/display") then
  1561.             fs.delete("/C/system/.core/display")    
  1562.             end
  1563.             local f=fs.open("/C/system/.core/display","w")
  1564.             f.writeLine(monitor)
  1565.             f.close()
  1566.             sleep(0.1)
  1567.             local data = fs.open ("/C/system/RAM/displayreboot", "w")
  1568.             data.close ()
  1569.             bgc(colors.black)
  1570.             term.clear()
  1571.             song("hwin")
  1572.             os.reboot()
  1573.         end
  1574.             if event == "mouse_click" and x >= 42 and x <= 46 and y == 18 then
  1575.                 if sItem == " No" then
  1576.                 local f = fs.open(userRegistry..".showItem","w")
  1577.                 f.close()
  1578.                 else
  1579.                 fs.delete (userRegistry..".showItem")
  1580.                 end
  1581.                 system()
  1582.             elseif event == "mouse_click" and x >= 42 and x <= 46 and y == 16 then
  1583.                 if Ertime == " No" then
  1584.                 local f = fs.open(userRegistry..".realTime","w")
  1585.                 f.close()
  1586.                 else
  1587.                 fs.delete (userRegistry..".realTime")
  1588.                 end
  1589.                 system()
  1590.             elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
  1591.             cbarva()
  1592.             lista.setCursorPos(1,3)--
  1593.             lista.write" < System  "
  1594.             sleep(anim)
  1595.             page = "main"
  1596.             menu()
  1597.             elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 7 then
  1598.             cbarva()
  1599.             lista.setCursorPos(1,5)--
  1600.             lista.write" Display    "
  1601.             sleep(anim)
  1602.             page = "system"
  1603.             menu()
  1604.             elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 9 then
  1605.             cbarva()
  1606.             lista.setCursorPos(1,7)--
  1607.             lista.write" Sounds      "
  1608.             sleep(anim)
  1609.             page = "Sounds"
  1610.             menu()
  1611.             elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 11 then
  1612.             cbarva()
  1613.             lista.setCursorPos(1,9)--
  1614.             lista.write" Recovery    "
  1615.             sleep(anim)
  1616.             page = "recovery"
  1617.             menu()
  1618.             end
  1619.            
  1620.             if event == "mouse_click" and x >= 19 and x <= 24 and y == 7 then
  1621.             pcurs(7,5)
  1622.             pozadi.write" Left "
  1623.             monitor = "left"
  1624.             sleep(anim)
  1625.             setmonitor()
  1626.             elseif x >= 26 and x <= 33 and y == 7 and button == 1 then
  1627.             pcurs(14,5)
  1628.             pozadi.write" Right  "
  1629.             monitor = "right"
  1630.             sleep(anim)
  1631.             setmonitor()
  1632.             elseif x >= 34 and x <= 40 and y == 7 and button == 1 then
  1633.             pcurs(23,5)
  1634.             pozadi.write" Back "
  1635.             monitor = "back"
  1636.             sleep(anim)
  1637.             setmonitor()
  1638.             elseif event == "mouse_click" and x >= 19 and x <= 24 and y == 9 then
  1639.             pcurs(7,7)
  1640.             pozadi.write" Top  "
  1641.             monitor = "top"
  1642.             sleep(anim)
  1643.             setmonitor()
  1644.             elseif x >= 26 and x <= 33 and y == 9 and button == 1 then
  1645.             pcurs(14,7)
  1646.             pozadi.write" Bottom "
  1647.             monitor = "bottom"
  1648.             sleep(anim)
  1649.             setmonitor()
  1650.             elseif x >= 34 and x <= 40 and y == 9 and button == 1 then
  1651.             pcurs(23,7)
  1652.             pozadi.write" Find "
  1653.            
  1654.             local names = {}
  1655.  
  1656.             local function filter(name)
  1657.               table.insert(names, name)
  1658.                 monitor = name
  1659.                 pbgc(colors.white)
  1660.                 pcurs(7,9)
  1661.                 pozadi.write("System finded: "..tostring(name))
  1662.                 sleep(1)
  1663.                 setmonitor()
  1664.               return true
  1665.             end
  1666.  
  1667.             peripheral.find("monitor", filter)
  1668.             elseif x >= 27 and x <= 38 and y == 12 and button == 1 then
  1669.             pcurs(15, 10)
  1670.             pbgc(colors.lightBlue)
  1671.             bgc(colors.lightBlue)
  1672.             pozadi.write"            "
  1673.             pcurs(16, 10)
  1674.             monitor = read()
  1675.             setmonitor()
  1676.             elseif x >= 27 and x <= 38 and y == 14 and button == 1 then
  1677.             local data = fs.open ("/C/system/RAM/displayreboot", "w")
  1678.             data.close ()
  1679.             pcurs(15, 12)
  1680.             pozadi.write " Disconect "
  1681.             sleep(anim)
  1682.             if fs.exists("/C/system/.core/display") then
  1683.             fs.delete("/C/system/.core/display")
  1684.             end
  1685.             bgc(colors.black)
  1686.             term.clear()
  1687.             os.reboot()
  1688.             end
  1689.         elseif (page == "update") then
  1690.             if event == "mouse_click" and x >= 42 and x <= 46 and y == 4 then
  1691.                 if Eupdate == "Yes" then
  1692.                 local f = fs.open(systemRegistry..".disableUpdate","w")
  1693.                 f.close()
  1694.                 else
  1695.                 fs.delete (systemRegistry..".disableUpdate")
  1696.                 end
  1697.                 update()
  1698.             elseif event == "mouse_click" and x >= 12 and x <= 46 and y == 6 then
  1699.                 pcurs(2,4)
  1700.                 pbgc(colors.gray)
  1701.                 pozadi.write(" Update now ")
  1702.                 sleep(anim)
  1703.                 shell.run("/C/system/api/update.lua setting")
  1704.                 update()
  1705.             end
  1706.         elseif (page == "Sounds") then
  1707.             if event == "mouse_click" and x >= 42 and x <= 46 and y == 4 then
  1708.                 if Esound == "Yes" then
  1709.                 local f = fs.open(userRegistry..".disableSound","w")
  1710.                 f.close()
  1711.                 else
  1712.                 fs.delete (userRegistry..".disableSound")
  1713.                 end
  1714.                 sounds()
  1715.             end
  1716.         elseif (page == "recovery") then
  1717.             if event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
  1718.             cbarva()
  1719.             lista.setCursorPos(1,3)--
  1720.             lista.write" < System  "
  1721.             sleep(anim)
  1722.             page = "main"
  1723.             menu()
  1724.             elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 7 then
  1725.             cbarva()
  1726.             lista.setCursorPos(1,5)--
  1727.             lista.write" Display    "
  1728.             sleep(anim)
  1729.             page = "system"
  1730.             menu()
  1731.             elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 9 then
  1732.             cbarva()
  1733.             lista.setCursorPos(1,7)--
  1734.             lista.write" Recovery    "
  1735.             sleep(anim)
  1736.             page = "recovery"
  1737.             menu()
  1738.             end
  1739.            
  1740.             if event == "mouse_click" and x >= 14 and x <= 34 and y == 8 then
  1741.             pcurs(2, 6)
  1742.             pozadi.write " Users and Settings  "
  1743.             sleep(anim)
  1744.             fs.delete("/Users")
  1745.             fs.delete("/C/system/Users")
  1746.             fs.delete("/C/system/.core/ucet")
  1747.             if fs.exists ("/C/system/.core/defuser") then
  1748.                 fs.delete("/C/system/.core/defuser")
  1749.             end
  1750.             os.reboot()
  1751.             elseif event == "mouse_click" and x >= 14 and x <= 34 and y == 10 then
  1752.             pcurs(2, 8)
  1753.             pozadi.write " Reinstall System    "
  1754.             sleep(anim)
  1755.             if fs.exists("./setting") then
  1756.             fs.delete("./setting")
  1757.             end
  1758.             fs.delete("/C")
  1759.             os.reboot()
  1760.             --elseif event == "mouse_click" and x >= 14 and x <= 34 and y == 12 then
  1761.             --pcurs(2, 10)
  1762.             --pozadi.write " Partially reinstall "
  1763.             --sleep(anim)
  1764.             end
  1765.    
  1766.         end
  1767.        
  1768.         if event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
  1769.         cbarva()
  1770.         lista.setCursorPos(1,3)--
  1771.         lista.write" Dashboard  "
  1772.         sleep(anim)
  1773.         page = "main"
  1774.         menu()
  1775.         elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 7 then
  1776.         cbarva()
  1777.         lista.setCursorPos(1,5)--
  1778.         lista.write" Accounts   "
  1779.         sleep(anim)
  1780.         page = "account"
  1781.         menu()
  1782.         elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 9 then
  1783.         cbarva()
  1784.         lista.setCursorPos(1,7)--
  1785.         lista.write" Network    "
  1786.         sleep(anim)
  1787.         page = "network"
  1788.         menu()
  1789.         elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 11 then
  1790.         cbarva()
  1791.         lista.setCursorPos(1,9)--
  1792.         lista.write" System     "
  1793.         sleep(anim)
  1794.         page = "system"
  1795.         menu()
  1796.         elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 13 then
  1797.             if page ~= "Sounds" and  page ~= "system" and page ~= "recovery" then
  1798.                 cbarva()
  1799.                 lista.setCursorPos(1,11)--
  1800.                 lista.write" Appearance  "
  1801.                 sleep(anim)
  1802.                 page = "appearance"
  1803.                 menu()
  1804.             end
  1805.         elseif event == "mouse_click" and x >= 2 and x <= 12 and y == 15 then
  1806.             if page ~= "Sounds" and  page ~= "system" and page ~= "recovery" then
  1807.                 cbarva()
  1808.                 lista.setCursorPos(1,13)--
  1809.                 lista.write" Update     "
  1810.                 sleep(anim)
  1811.                 page = "update"
  1812.                 menu()
  1813.             end
  1814.         end
  1815.        
  1816.        
  1817.             menu() -------- stejne jako nazev funkce
  1818.         end
  1819.     end
  1820. end
  1821.  
  1822. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement