Advertisement
Guest User

gui

a guest
Jul 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.14 KB | None | 0 0
  1. --GyorsMenü
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. print("[PulseBook]")
  5. term.setCursorPos(13,1)
  6. print("[Terminal]")
  7. term.setCursorPos(24,1)
  8. print("[Worm]")
  9. term.setCursorPos(31,1)
  10. print("[AntiVirus]")
  11. menu = false
  12. ----Ikonok
  13.   Icons = function()
  14.     local p = paintutils.drawPixel
  15.     local c = colors
  16.     --Files
  17.       --sor 1
  18.        p(14, 3, c.yellow)
  19.        p(15, 3, c.black)
  20.        p(16, 3, c.gray)
  21.        p(17, 3, c.gray)
  22.        p(18, 3, c.gray)
  23.       --sor 2
  24.        p(14, 4, c.yellow)
  25.        p(15, 4, c.yellow)
  26.        p(16, 4, c.yellow)
  27.        p(17, 4, c.yellow)
  28.        p(18, 4, c.gray)
  29.       --sor 3
  30.        p(14, 5, c.yellow)
  31.        p(15, 5, c.yellow)
  32.        p(16, 5, c.yellow)
  33.        p(17, 5, c.yellow)
  34.        p(18, 5, c.gray)
  35.       --sor 4
  36.        p(14, 6, c.gray)
  37.        p(15, 6, c.gray)
  38.        p(16, 6, c.gray)
  39.        p(17, 6, c.gray)
  40.        p(18, 6, c.gray)
  41.       --sor 5
  42.        term.setBackgroundColor(c.black)
  43.        term.setCursorPos(14,7)
  44.        print("Files")
  45.     --Worm
  46.      --sor 1
  47.       p(2,3, c.gray)
  48.       p(3,3, c.green)
  49.       p(4,3, c.gray)
  50.       p(5,3, c.gray)
  51.       p(6,3, c.green)
  52.      --sor 2
  53.       p(2,4, c.green)
  54.       p(3,4, c.green)
  55.       p(4,4, c.gray)
  56.       p(5,4, c.gray)
  57.       p(6,4, c.green)
  58.      --sor 3
  59.       p(2,5, c.green)
  60.       p(3,5, c.gray)
  61.       p(4,5, c.gray)
  62.       p(5,5, c.gray)
  63.       p(6,5, c.green)
  64.      --sor 4
  65.       p(2,6, c.green)
  66.       p(3,6, c.green)
  67.       p(4,6, c.green)
  68.       p(5,6, c.green)
  69.       p(6,6, c.green)
  70.      --sor 5
  71.       term.setBackgroundColor(c.black)
  72.       term.setCursorPos(2,7)
  73.       print("Worm")
  74.     --AntiVirus
  75.      --sor 1
  76.       p(8, 3, c.gray)
  77.       p(9, 3, c.gray)
  78.       p(10, 3, c.blue)
  79.       p(11, 3, c.gray)
  80.       p(12, 3, c.gray)
  81.      --sor 2
  82.       p(8, 4, c.gray)
  83.       p(9, 4, c.blue)
  84.       p(10, 4, c.blue)
  85.       p(11, 4, c.blue)
  86.       p(12, 4, c.gray)
  87.      --sor 3
  88.       p(8, 5, c.blue)
  89.       p(9, 5, c.blue)
  90.       p(10, 5, c.blue)
  91.       p(11, 5, c.blue)
  92.       p(12, 5, c.blue)
  93.      --sor 4
  94.       p(8, 6, c.gray)
  95.       p(9, 6, c.gray)
  96.       p(10, 6, c.blue)
  97.       p(11, 6, c.gray)
  98.       p(12, 6, c.gray)
  99.      --sor 5
  100.       term.setCursorPos(8, 7)
  101.       term.setBackgroundColor(c.black)
  102.       print("AntiV")
  103.   end
  104. ----Ikonok end
  105. Icons()
  106. while true do
  107.   local event, vmi, cx, cy = os.pullEvent()
  108.   if event == "mouse_click" then
  109.    --Ikonok
  110.     if cx >= 8 and cx <= 12 and cy >= 3 and cy <= 7 then
  111.       term.clear()
  112.       term.setCursorPos(1,1)
  113.       shell.run("Pulse/apps/antivirus")
  114.     end
  115.     if cx >= 2 and cx <=6 and cy >= 3 and cy <= 7 then
  116.       shell.run("worm")
  117.     end
  118.     if cx >= 14 and cx <= 18 and cy >= 3 and cy <= 7 then
  119.       term.clear()
  120.       term.setCursorPos(1,1)
  121.       print("Directory:")
  122.       menu = true
  123.      while menu do
  124.       local b = "Pulse/"
  125.       local g = b..read()
  126.      if fs.exists(g) then
  127.       local FileList = fs.list(g)
  128.       print("Files:")
  129.       print("----------------")
  130.       for _, file in ipairs(FileList) do
  131.         print(file)
  132.       end
  133.       print("----------------")
  134.       print("Directory:")
  135.      elseif g == b.."exit" then
  136.        shell.run("Pulse/startup/gui")
  137.      else
  138.        print("Not a directory!")
  139.        print("Directory:")
  140.      end
  141.      end
  142.     end
  143.    --GyorsMenü
  144.     if cx >= 1 and cx <= 11 and cy == 1 then
  145.       term.clear()
  146.       term.setCursorPos(1,5)
  147.       print("1> Shutdown")
  148.       term.setCursorPos(1,6)
  149.       print("2> Reboot")
  150.       term.setCursorPos(1,7)
  151.       print("3> <- Back")
  152.       local event, key = os.pullEvent("key")
  153.       if key == keys.one then
  154.         os.shutdown()
  155.       elseif key == keys.two then
  156.         os.reboot()
  157.       elseif key == keys.three then
  158.         shell.run("Pulse/startup/gui")
  159.       end
  160.     end
  161.     if cx >= 13 and cx <= 22 and cy == 1 then
  162.       term.clear()
  163.       term.setCursorPos(1,1)
  164.       break
  165.     end
  166.     if cx >= 24 and cx <= 29 and cy == 1 then
  167.       term.clear()
  168.       term.setCursorPos(1,1)
  169.       shell.run("worm")
  170.     end
  171.     if cx >= 31 and cx <= 41 and cy == 1 then
  172.       term.clear()
  173.       shell.run("Pulse/apps/antivirus")
  174.     end
  175.   end
  176. end
  177. --GyorsMenü end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement