smooshie

Plug.dj repeat check

Jul 6th, 2012
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Models.history.load();
  2. var skippedsongs = new Array();
  3.  
  4. API.addEventListener(API.DJ_UPDATE, repeatcheck);
  5.  
  6. function repeatcheck(user) {
  7.  
  8. var historylist=Models.history.data;
  9. var currentID=Models.room.data.media.cid;
  10.  
  11. for(var j=1; j<50;j++) {
  12.  
  13. if (historylist[j].media.cid == currentID) {
  14.  
  15. if ($.inArray(currentID, skippedsongs) == -1) {
  16. API.moderateForceSkip();
  17. API.sendChat("Sorry, that song's still in history (song " + j + " out of 50)");
  18. skippedsongs.push(currentID);
  19. break;
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment