Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- API.on(API.CURATE_UPDATE, grabs);
- API.on(API.VOTE_UPDATE, chatu);
- API.on(API.USER_FAN, userfan);
- API.on(API.MOD_SKIP, modskip);
- API.on(API.DJ_ADVANCE, djadvancee);
- API.on(API.WAIT_LIST_UPDATE, autojj);
- API.on(API.DJ_ADVANCE, DJ_ADVANCE_LISTENER);
- API.off(API.CHAT, log);
- var a = $('#chat-messages'), b = a.scrollTop() > a[0].scrollHeight - a.height() - 20;
- function grabs(obj)
- {
- var song3 = API.getMedia().author + ' - ' + API.getMedia().title;
- $("#chat-messages").append("<div class='BlueViolet system'><i class='icon icon-curate'></i><span class='text'> " + obj.user.username + " adicionou o video: "+song3+". </span></div>");
- b && a.scrollTop(a[0].scrollHeight);
- }
- function chatu(obj) {
- var song2 = API.getMedia().author + ' - ' + API.getMedia().title;
- var vote = obj.vote == 1 ? "woot" : "meh";
- if (vote == "meh"){
- $("#chat-messages").append("<div class='system'><i class='icon icon-meh'></i><span class='text'> " + obj.user.username + " votou Chato em: "+song2+" </span></div>");
- b && a.scrollTop(a[0].scrollHeight);
- }
- };
- function userfan(user) {
- $("#chat-messages").append("<div class='LGreen system'><i class='icon icon-fan'></i><span class='text'> " + user.username + " virou seu fã! </span></div>");
- b && a.scrollTop(a[0].scrollHeight);
- };
- function modskip(username) {
- $("#chat-messages").append("<div class='Orange system'><i class='icon icon-skip'></i><span class='text'> " + username + " pulou o DJ! </span></div>");
- b && a.scrollTop(a[0].scrollHeight);
- };
- function log(data) {
- console.log(data);
- var a = data.message.toLowerCase();
- if (a.indexOf('!') > -1)
- {
- }
- else if (a.indexOf(' ') > -1)
- {
- }
- }
- function djadvancee(obj) {
- if (obj == null) return;
- var str = "";
- var currentDJ = obj.dj;
- str += currentDJ.username;
- var total = currentDJ.djPoints + currentDJ.listenerPoints + currentDJ.curatorPoints;
- str += " pontos: " + total;
- str += ", fãs: " + currentDJ.fans;
- str += " ||Tocando Agora: " + obj.media.author + " - " + obj.media.title;
- $("#chat-messages").append("<div class='Yellow system'><i class='icon icon-volume-half'></i><span class='text'> " +str+ " </span></div>");
- b && a.scrollTop(a[0].scrollHeight);
- };
- Grab = {};
- Grab.check=function(e){
- if(e===null){
- API.chatLog("Autoadd: Não há DJ",true);
- Grab.djname=null
- }
- else if(API.getDJ().username!=API.getUser().username){
- Grab.grab();
- Grab.djname=API.getDJ().username
- }
- else{
- if(Grab.djname!=API.getUser().username){
- API.chatLog("Autoadd: Você é o DJ Agora",false);
- Grab.djname=API.getDJ().username
- }
- }
- };
- Grab.grab=function(){
- $(".icon-curate").click();$($(".curate").children(".menu").children().children()[0]).mousedown()
- };
- function autojj(){
- var waitingCount = API.getWaitList().length;
- if (waitingCount<50){
- API.djJoin();
- }
- }
- var wooting = true;
- wootSong();
- function DJ_ADVANCE_LISTENER(obj) {
- wootSong();
- }
- function wootSong() {
- if(wooting) {
- $("#woot").click();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement