Advertisement
pepeknamornik

Store

May 7th, 2015
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.86 KB | None | 0 0
  1. local nastaveni={barva=colors.blue}
  2. local f=fs.open("system/.core/colors","r")
  3. local cnt=f.readAll()
  4. f.close()
  5. local nastaveni=textutils.unserialize(cnt)
  6.      
  7. local f=fs.open("system/.core/textcol","r")
  8. local tnt=f.readAll()
  9. f.close()
  10. local text=textutils.unserialize(tnt)
  11. local propojeni = ""
  12.  
  13.  
  14.  
  15. local function prc(text, y)
  16.   local w = term.getSize()
  17.   local _, cy = term.getCursorPos()
  18.   term.setCursorPos(math.ceil((w-#text)/2), y or cy)
  19.   write(text)
  20. end
  21.  
  22. function start ()
  23.     term.setBackgroundColor(colors.magenta)
  24.     term.setTextColor(colors.white)
  25.     term.clear ()
  26.     local image = paintutils.loadImage("/system/programs/setdata/Ikon.nft")
  27.     paintutils.drawImage(image, 18, 4)
  28.     prc ("Setting", 16)
  29.     o=fs.open ("/system/RAM/setting", "r")
  30.     user=o.readLine()
  31.     passI=o.readLine()
  32.     o.close()
  33.     sleep (1)
  34. setupmenu ()
  35. end
  36.  
  37. function store ()
  38. funkce = "apps"
  39.     term.setBackgroundColor(nastaveni.barva)
  40.        term.setCursorPos(1,1)
  41.        print "               "
  42.        paintutils.drawPixel(16, 1, colors.gray)
  43.     local myWindow = window.create(term.current(),17,1,37,19)
  44.     myWindow.setBackgroundColor(colors.white)
  45.     myWindow.clear()
  46.     term.setTextColor(colors.black)
  47.     term.setBackgroundColor(colors.lightBlue)
  48.     myWindow.setCursorPos (9,2)
  49.     print " App Store Pepdroll "
  50.     term.setBackgroundColor(colors.green)
  51.     myWindow.setCursorPos (4,4)
  52.     print " - Downloader "
  53.     myWindow.setCursorPos (4,6)
  54.     print " - Program manager -Alpha "
  55.    
  56.     while true do
  57.         local event, button, x, y = os.pullEvent("mouse_click")
  58.         xy = x..","..y
  59.  
  60.     if x >= 2 and x <= 16 and y == 3 and button == 1 then
  61.     setupmenu ()
  62.     elseif x >= 17 and x <= 30 and y == 4 and button == 1 then
  63.     shell.run ("pastebin get WV3VRjQZ /system/programs/downloader")
  64.     shell.run ("/system/programs/downloader")
  65.     store ()
  66.     elseif x >= 17 and x <= 40 and y == 6 and button == 1 then
  67.     shell.run ("pastebin get GUtPPTV3 /system/programs/pmanager")
  68.     shell.run ("/system/programs/pmanager")
  69.     store ()
  70.     elseif x >= 2 and x <= 16 and y == 5 and button == 1 then
  71.     downloader ()
  72.     elseif x >= 2 and x <= 16 and y == 7 and button == 1 then
  73.     setprograms ()
  74.     else
  75.     paintutils.drawLine(1, 1, 51, 1, colors.black)
  76.     paintutils.drawPixel (51,1, colors.red)
  77.     term.setTextColor(colors.white)
  78.     term.setCursorPos (51,1)
  79.     print "*"
  80.     paintutils.drawPixel (50,1, colors.lightGray)
  81.     term.setCursorPos (50,1)
  82.     print "<"
  83.     paintutils.drawPixel (49,1, colors.lightGray)
  84.     term.setCursorPos (49,1)
  85.     print "_"
  86.              while true do
  87.         local event, button, x, y = os.pullEvent("mouse_click")
  88.         xy = x..","..y
  89.        
  90.         if x == 51 and y == 1 then
  91.             plocha ()
  92.         elseif x == 50 and y == 1 then
  93.             apps ()
  94.         elseif x == 49 and y == 1 then
  95.             minimalizace ()
  96.         else
  97.         store ()
  98.             end
  99.             end
  100. end
  101. end
  102. end
  103.  
  104. store ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement