Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var lastMsg="";
- songs=["0","5","6"]; //ids of songs here
- DateToMs=function(h,m,s){
- return parseInt(h*3600000) + parseInt(m*60000) + parseInt(s*1000);};
- DateToMs1=function(m,s){
- return parseInt(m*60000) + parseInt(s*1000);
- }
- var songInt;
- stringDateToMs=function(str){
- if(str.split(":").length==2){return DateToMs1(str.split(":")[0],str.split(":")[1]);};
- if(str.split(":").length==3){return DateToMs(str.split(":")[0],str.split(":")[1],str.split(":")[2]);};
- }
- findLol11=function(str,a,b){
- return stringDateToMs(str.split(a)[str.split(a).length-1].replace(b,""));
- }
- pSong=function(ids,id,time){
- setTimeout(function(){MPP.chat.send("/play "+ids[id]);
- },time);
- };
- MPP.client.on("a", function (msg) {
- a = msg.a.split(' ');
- b = a[0];
- input = msg.a.substring(b.length).trim();
- lastMsg=msg.a;
- });
- pSongs=function(id,ids){var id1=id; MPP.chat.send("/p "+ids[id]); setTimeout(function(){var time1=findLol11(lastMsg,"[","]"); songsInt=setInterval(function(){clearInterval(songsInt); id1+=1; if(id1>ids.length-1){id1=0}; pSongs(id1,ids);},time1+1000); },1000); };
- playSongs=function(ids){pSongs(0,ids);};
- stopPlayingSongs=function(){
- clearInterval(songsInt);
- }
- playSongs(songs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement