smooshie

Plug.dj repeat check (untested)

Jul 6th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Models.history.load(); //history needs to be loaded so it doesn't return blank array
  2.  
  3. API.addEventListener(API.DJ_UPDATE, repeatcheck); //activates when there's a new DJ
  4.  
  5. function repeatcheck(user) {
  6. 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
  7.  
  8. if (Models.history.data[j].media.cid == Models.room.data.media.cid) { //if the ID of the current song is the same as the ID of an item in history
  9. API.sendChat("j"); //just test code, if it works, will replace with code to skip and send message
  10. }
  11.  
  12. }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment