Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Models.history.load(); //history needs to be loaded so it doesn't return blank array
- API.addEventListener(API.DJ_UPDATE, repeatcheck); //activates when there's a new DJ
- function repeatcheck(user) {
- var historylist=Models.history.data; //gets array of songs in history
- var currentID=Models.room.data.media.cid; //gets ID of current song
- for(var j=1; j<50;j++) { //should technically start at 0, but 1st item in history may be current song, don't want to check that
- if (historylist[j].media.cid == currentID) {
- API.sendChat(j); //just test code, if it works, will replace with code to skip and send message
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment