Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name mezzoforteMP3-EGP
- @inputs W:wirelink
- @outputs
- @persist [ArtName SongName DLPlay]:table
- @trigger
- E = entity()
- W = E:isWeldedTo():wirelink()
- Cmd = owner():lastSaid():explode("#"):string(2)
- if(chatClk(owner()))
- {
- switch(owner():lastSaid())
- {
- case"#"+Cmd,
- hideChat(1)
- httpRequest("https://mezzoforte.ru/search.php?q="+Cmd)
- W:egpSetText(106,Cmd)
- break
- case"-s",
- hideChat(1)
- soundPlay("rustop",0,"ui/buttonclick.wav")
- soundURLpause("rumus")
- break
- case"-p",
- hideChat(1)
- soundPlay("ruplay",0,"ui/buttonclick.wav")
- soundURLplay("rumus")
- break
- }
- }
- if(httpClk())
- {
- Data = httpData()
- ArtName = Data:gmatch("class%=\"artist_link\" title%=''>(.-)%<")
- SongName = Data:gmatch("html';\">(.-)%<%/")
- DLPlay = Data:gmatch("<span class%=\"song_text_link\" onclick%=\"document.location.href = '(.-)%.h")
- for(I=1,12) {
- local A = ArtName[I,array]
- local B = SongName[I,array]
- local DL = DLPlay[I,array]
- W:egpSetText(30+I,A:string(1)+" - "+httpUrlDecode(B:string(1):sub(0,30)))
- W:egpColor(I,vec(25))
- }
- }
- if(first())
- {
- soundURLdelete("rumus")
- soundURLPurge()
- E:setAlpha(0)
- W:egpClear()
- W:egpBox(99,vec2(256,256),vec2(512,512))
- W:egpColor(99,vec4(236,242,246,200))
- W:egpBox(100,vec2(256,24),vec2(512,49))
- W:egpColor(100,vec4(44,44,44,240))
- W:egpBox(101,vec2(256,24),vec2(512,49))
- W:egpColor(101,vec4(34,34,35,255))
- W:egpMaterial(101,"vgui/gradient-u")
- W:egpText(102,"MEZZOFORTE",vec2(38,13))
- W:egpFont(102,"Courier New",24)
- W:egpColor(102,vec(118,206,253))
- W:egpText(103,".RU",vec2(166,13))
- W:egpFont(103,"Courier New",24)
- W:egpColor(103,vec(236,242,246))
- W:egpBox(104,vec2(356,24),vec2(270,28))
- W:egpColor(104,vec(236,242,246))
- W:egpBox(105,vec2(475,24),vec2(22))
- W:egpColor(105,vec4(1,242,246,110))
- W:egpMaterial(105,"icon16/magnifier.png")
- #---------------SEARCH TEXT-------------------------------------
- W:egpText(106,"type #song name in chat":sub(0,25),vec2(226,14))
- W:egpFont(106,"Helvetica",20)
- W:egpColor(106,vec4(117,117,117,150))
- #---------------------------------------------------------------
- W:egpText(107,"MEZZOFORTE.MP3 by Arkiss [03.04.2022]",vec2(248,494))
- W:egpFont(107,"Courier New",16)
- W:egpColor(107,vec4(117,117,117,150))
- W:egpText(108,"User:"+"["+owner():name():sub(0,25)+"]",vec2(7,494))
- W:egpFont(108,"Courier New",16)
- W:egpColor(108,vec4(117,117,117,150))
- for(I=1,12)
- {
- W:egpBox(I,vec2(256,30+I*37),vec2(512,36))
- W:egpColor(I, vec(25))
- W:egpAlpha(I,250)
- }
- for(I=1,12)
- {
- W:egpText(30+I,"",vec2(7,18+I*37))
- W:egpFont(30+I,"Impact",24)
- W:egpColor(30+I,vec(20))
- W:egpAlpha(30+I,250)
- }
- 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"))
- 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"))
- 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"))
- W:egpSetText(34," "+httpUrlDecode("'-p'%20%28%D1%8D%D1%82%D0%BE%20%D0%BF%D0%BB%D0%B5%D0%B9%29"))
- function wirelink:inBox(Index:number)
- {
- local Pos = This:egpPos(Index)
- local Size = This:egpSize(Index)
- local Cur = round(This:egpCursor(owner()))
- local Use = owner():keyUse()
- if(inrange(Cur,Pos - Size/2,Pos + Size/2))
- {
- This:egpColor(Index,vec(0,170,255))
- if(changed(Use)&Use)
- {
- This:egpColor(Index,vec(0,170/2,255/2))
- local URL = DLPlay[Index,array]
- soundURLdelete("rumus") soundURLPurge()
- soundURLload("rumus","https://mezzoforte.ru"+URL:string(1)+".mp3",100,0,entity())
- soundPlay("rupl",0,"ui/buttonclickrelease.wav")
- W:egpSetText(106,ArtName[Index,array][1,string]+" - "+SongName[Index,array][1,string])
- }
- }
- else
- {
- This:egpColor(Index,vec4(236,242,246,200))
- }
- }
- runOnChat(1)
- runOnHTTP(1)
- E:setName("MEZZOFORTE.MP3 by Arkiss [03.04.2022]")
- }
- interval(100)
- for(I=1,12){ W:inBox(I) }
Add Comment
Please, Sign In to add comment