Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name mp3shop_d03_y22
- @inputs W:wirelink
- @outputs
- @persist [ArtName SongName DLPlay]:table PP
- @trigger
- O = owner()
- E = entity()
- W = entity():isWeldedTo():wirelink()
- Cmd = O:lastSaid():explode("#"):string(2)
- if(chatClk(O))
- {
- switch(O:lastSaid())
- {
- case"#"+Cmd,
- hideChat(1)
- httpRequest("https://mp3store.cc/get-search/"+Cmd)
- W:egpSetText(105,Cmd)
- break
- }
- }
- if(httpClk())
- {
- Data = httpData()
- local Sub = httpUrlDecode("%D0%A1%D0%BB%D1%83%D1%88%D0%B0%D1%82%D1%8C")
- ArtName = Data:gmatch("<div class%=\"music%-info\"><b>(.-)%<%/")
- SongName = Data:gmatch("</b>(.-)</")
- DLPlay = Data:gmatch("class%=\"music%-load\" href%=\"(.-)\"")
- for(I=1,10) {
- local A = ArtName[I+1,array]
- local B = SongName[I+1,array]
- local DL = DLPlay[I+1,array]
- W:egpSetText(30+I,A:string(1)+" - "+httpUrlDecode(B:string(1):sub(0,30)))
- W:egpColor(I,vec(25))
- }
- }
- if(first())
- {
- E:setAlpha(0)
- W:egpClear()
- W:egpRoundedBox(99,vec2(256,256),vec2(516,516))
- W:egpColor(99,vec())
- W:egpRoundedBox(100,vec2(256,20),vec2(516,64))
- W:egpColor(100,vec(25))
- W:egpMaterial(100,"gui/gradient_down")
- W:egpRoundedBox(101,vec2(256,490),vec2(516,64))
- W:egpColor(101,vec(25))
- W:egpMaterial(101,"gui/gradient_up")
- W:egpBox(102,vec2(290,70),vec2(300,32)) # SearchBox
- W:egpColor(102,vec(200))
- W:egpText(103,"MP3",vec2(24,57))
- W:egpFont(103,"Trebuche24",24)
- W:egpColor(103,vec(255,0,0))
- W:egpText(104,"STORE",vec2(68,57))
- W:egpFont(104,"Trebuche24",24)
- W:egpText(105,"type in chat # song",vec2(150,57))
- W:egpFont(105,"Helvetica",24)
- W:egpColor(105,vec(5))
- W:egpText(106,"MP3-Shop Player by Arkiss[20.03.2022]",vec2(256,485))
- W:egpFont(106,"Helvetica",16)
- W:egpColor(106,vec(150,50,0))
- 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(50))
- if(changed(Use)&Use)
- {
- This:egpColor(Index,vec(150))
- local URL = DLPlay[Index,array]
- soundURLdelete("ark")
- soundURLPurge()
- soundURLload("ark","https://mp3store.cc"+URL:string(1),100,0,entity())
- soundPlay("pl",0,"ui/buttonclickrelease.wav")
- W:egpSetText(105,ArtName[Index+1,array][1,string]+" - "+SongName[Index+1,array][1,string])
- }
- }
- else
- {
- This:egpColor(Index,vec(25))
- }
- }
- for(I=1,10)
- {
- W:egpBox(I,vec2(256,90+I*35),vec2(512,32))
- W:egpColor(I, vec(25))
- }
- for(I=1,10)
- {
- W:egpText(30+I,"",vec2(20,78+I*35))
- W:egpFont(30+I,"Helvetica",24)
- W:egpColor(30+I,vec(200))
- }
- soundURLdelete("ark")
- soundURLPurge()
- runOnChat(1) runOnHTTP(1)
- E:setName("mp3shop_player by Arkiss")
- }
- interval(100)
- for(I=1,ArtName:count()){ W:inBox(I) }
Advertisement
Add Comment
Please, Sign In to add comment