Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //load history and define arrays to prevent repetitive messages
- Models.history.load();
- var skippedsongs = new Array();
- var peoplewhoscored = new Array();
- //code for repeat checker
- API.addEventListener(API.DJ_UPDATE, repeatcheck);
- function repeatcheck(user) {
- var historylist=Models.history.data;
- var currentID=Models.room.data.media.cid;
- for(var j=1; j<49;j++) {
- if (historylist[j].media.cid == currentID) {
- if ($.inArray(currentID, skippedsongs) == -1) {
- //API.moderateForceSkip();
- API.sendChat("This song may be in history (song " + j + " out of 50)");
- skippedsongs.push(currentID);
- break;
- }
- }
- }
- }
- //begin code to notify people of point advances
- API.addEventListener(API.DJ_UPDATE, pointcheck);
- var peoplewhoscored = new Array();
- function pointcheck(user) {
- var userlist=API.getUsers();
- var peopleinroom=userlist.length;
- for(var i=0; i<peopleinroom;i++)
- {
- var totalPoints = userlist[i].curatorPoints+userlist[i].listenerPoints+userlist[i].djPoints;
- var name = userlist[i].username;
- if ($.inArray(name, peoplewhoscored) == -1) {
- if((totalPoints == 100) || (totalPoints == 300) || (totalPoints == 700) || (totalPoints == 1500) || (totalPoints == 3000) || (totalPoints == 10000)) {
- API.sendChat("Grats on " + totalPoints + " points, @" + name + "!");
- peoplewhoscored.push(name);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment