Night_Wolf17

mezzoforteMP3-EGP

Apr 3rd, 2022 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.32 KB | None | 0 0
  1. @name mezzoforteMP3-EGP
  2. @inputs W:wirelink
  3. @outputs
  4. @persist [ArtName SongName DLPlay]:table
  5. @trigger
  6.  
  7.     E = entity()
  8.     W = E:isWeldedTo():wirelink()
  9.    
  10.     Cmd = owner():lastSaid():explode("#"):string(2)
  11.     if(chatClk(owner()))
  12.     {
  13.         switch(owner():lastSaid())
  14.         {
  15.             case"#"+Cmd,
  16.                 hideChat(1)
  17.                 httpRequest("https://mezzoforte.ru/search.php?q="+Cmd)
  18.                 W:egpSetText(106,Cmd)
  19.             break
  20.            
  21.             case"-s",
  22.                 hideChat(1)
  23.                 soundPlay("rustop",0,"ui/buttonclick.wav")
  24.                 soundURLpause("rumus")
  25.             break
  26.            
  27.             case"-p",
  28.                 hideChat(1)
  29.                 soundPlay("ruplay",0,"ui/buttonclick.wav")
  30.                 soundURLplay("rumus")
  31.             break
  32.         }
  33.     }
  34.     if(httpClk())
  35.     {
  36.         Data = httpData()
  37.  
  38.         ArtName = Data:gmatch("class%=\"artist_link\" title%=''>(.-)%<")  
  39.         SongName = Data:gmatch("html';\">(.-)%<%/")
  40.         DLPlay = Data:gmatch("<span class%=\"song_text_link\" onclick%=\"document.location.href = '(.-)%.h")
  41.        
  42.         for(I=1,12) {
  43.             local A = ArtName[I,array]
  44.             local B = SongName[I,array]
  45.             local DL = DLPlay[I,array]
  46.            
  47.             W:egpSetText(30+I,A:string(1)+" - "+httpUrlDecode(B:string(1):sub(0,30)))
  48.             W:egpColor(I,vec(25))
  49.         }
  50.     }
  51.    
  52.     if(first())
  53.     {
  54.         soundURLdelete("rumus")
  55.         soundURLPurge()
  56.        
  57.         E:setAlpha(0)
  58.        
  59.         W:egpClear()
  60.        
  61.         W:egpBox(99,vec2(256,256),vec2(512,512))
  62.         W:egpColor(99,vec4(236,242,246,200))
  63.        
  64.         W:egpBox(100,vec2(256,24),vec2(512,49))
  65.         W:egpColor(100,vec4(44,44,44,240))
  66.                
  67.         W:egpBox(101,vec2(256,24),vec2(512,49))
  68.         W:egpColor(101,vec4(34,34,35,255))
  69.         W:egpMaterial(101,"vgui/gradient-u")        
  70.    
  71.         W:egpText(102,"MEZZOFORTE",vec2(38,13))
  72.         W:egpFont(102,"Courier New",24)
  73.         W:egpColor(102,vec(118,206,253))
  74.  
  75.         W:egpText(103,".RU",vec2(166,13))
  76.         W:egpFont(103,"Courier New",24)
  77.         W:egpColor(103,vec(236,242,246))
  78.        
  79.         W:egpBox(104,vec2(356,24),vec2(270,28))
  80.         W:egpColor(104,vec(236,242,246))
  81.  
  82.         W:egpBox(105,vec2(475,24),vec2(22))
  83.         W:egpColor(105,vec4(1,242,246,110))
  84.         W:egpMaterial(105,"icon16/magnifier.png")
  85.     #---------------SEARCH TEXT-------------------------------------
  86.         W:egpText(106,"type #song name in chat":sub(0,25),vec2(226,14))
  87.         W:egpFont(106,"Helvetica",20)
  88.         W:egpColor(106,vec4(117,117,117,150))
  89.     #---------------------------------------------------------------
  90.         W:egpText(107,"MEZZOFORTE.MP3 by Arkiss [03.04.2022]",vec2(248,494))
  91.         W:egpFont(107,"Courier New",16)
  92.         W:egpColor(107,vec4(117,117,117,150))
  93.  
  94.         W:egpText(108,"User:"+"["+owner():name():sub(0,25)+"]",vec2(7,494))
  95.         W:egpFont(108,"Courier New",16)
  96.         W:egpColor(108,vec4(117,117,117,150))        
  97.        
  98.         for(I=1,12)
  99.         {
  100.             W:egpBox(I,vec2(256,30+I*37),vec2(512,36))
  101.             W:egpColor(I, vec(25))
  102.             W:egpAlpha(I,250)
  103.         }
  104.         for(I=1,12)
  105.         {
  106.             W:egpText(30+I,"",vec2(7,18+I*37))
  107.             W:egpFont(30+I,"Impact",24)
  108.             W:egpColor(30+I,vec(20))
  109.             W:egpAlpha(30+I,250)
  110.         }
  111.         W:egpSetText(31,httpUrlDecode("%D0%9A%D0%B0%D0%BA%20%D1%8E%D0%B7%D0%B0%D1%82%D1%8C%3A%20%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%20%D0%B2%20%D1%87%D0%B0%D1%82%20%23%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%20%D0%BF%D0%B5%D1%81%D0%BD%D0%B8"))
  112.         W:egpSetText(32,"            "+httpUrlDecode("%D0%94%D1%80%D1%83%D0%B3%D0%B8%D0%B5%20%D0%BA%D0%BE%D0%BC%D0%BC%D0%B0%D0%BD%D0%B4%D1%8B%20%D0%B2%20%D1%87%D0%B0%D1%82%3A"))
  113.         W:egpSetText(33,"            "+httpUrlDecode("'-s'%20%28%D1%8D%D1%82%D0%BE%20%D0%BF%D0%B0%D1%83%D0%B7%D0%B0%29"))
  114.         W:egpSetText(34,"            "+httpUrlDecode("'-p'%20%28%D1%8D%D1%82%D0%BE%20%D0%BF%D0%BB%D0%B5%D0%B9%29"))
  115.        
  116.         function wirelink:inBox(Index:number)
  117.         {
  118.             local Pos = This:egpPos(Index)
  119.             local Size = This:egpSize(Index)
  120.             local Cur = round(This:egpCursor(owner()))
  121.             local Use = owner():keyUse()
  122.            
  123.             if(inrange(Cur,Pos - Size/2,Pos + Size/2))
  124.             {
  125.                 This:egpColor(Index,vec(0,170,255))
  126.                 if(changed(Use)&Use)
  127.                 {
  128.                     This:egpColor(Index,vec(0,170/2,255/2))
  129.                     local URL = DLPlay[Index,array]
  130.                     soundURLdelete("rumus") soundURLPurge()
  131.    
  132.                     soundURLload("rumus","https://mezzoforte.ru"+URL:string(1)+".mp3",100,0,entity())
  133.  
  134.                     soundPlay("rupl",0,"ui/buttonclickrelease.wav")
  135.                     W:egpSetText(106,ArtName[Index,array][1,string]+" - "+SongName[Index,array][1,string])
  136.                 }
  137.             }
  138.             else
  139.             {
  140.                 This:egpColor(Index,vec4(236,242,246,200))
  141.             }
  142.         }
  143.         runOnChat(1)
  144.         runOnHTTP(1)
  145.        
  146.         E:setName("MEZZOFORTE.MP3 by Arkiss [03.04.2022]")
  147.     }
  148.     interval(100)
  149.  
  150. for(I=1,12){ W:inBox(I) }
Add Comment
Please, Sign In to add comment