smooshie

Plug.dj repeat check (untested)

Jul 6th, 2012
163
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. var historylist=Models.history.data; //gets array of songs in history
  7. var currentID=Models.room.data.media.cid; //gets ID of current song
  8.  
  9. 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
  10.  
  11. if (historylist[j].media.cid == currentID) {
  12. API.sendChat(j); //just test code, if it works, will replace with code to skip and send message
  13. }
  14.  
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment