smooshie

Full Plug.dj code

Jul 8th, 2012
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //load history and define arrays to prevent repetitive messages
  2.  
  3. Models.history.load();
  4. var skippedsongs = new Array();
  5. var peoplewhoscored = new Array();
  6.  
  7. //code for repeat checker
  8.  
  9. API.addEventListener(API.DJ_UPDATE, repeatcheck);
  10.  
  11. function repeatcheck(user) {
  12.  
  13. var historylist=Models.history.data;
  14. var currentID=Models.room.data.media.cid;
  15.  
  16. for(var j=1; j<49;j++) {
  17.  
  18. if (historylist[j].media.cid == currentID) {
  19.  
  20. if ($.inArray(currentID, skippedsongs) == -1) {
  21. //API.moderateForceSkip();
  22. API.sendChat("This song may be in history (song " + j + " out of 50)");
  23. skippedsongs.push(currentID);
  24. break;
  25. }
  26. }
  27. }
  28. }
  29.  
  30. //begin code to notify people of point advances
  31.  
  32. API.addEventListener(API.DJ_UPDATE, pointcheck);
  33. var peoplewhoscored = new Array();
  34.  
  35. function pointcheck(user) {
  36.  
  37. var userlist=API.getUsers();
  38. var peopleinroom=userlist.length;
  39.  
  40. for(var i=0; i<peopleinroom;i++)
  41. {
  42.  
  43. var totalPoints = userlist[i].curatorPoints+userlist[i].listenerPoints+userlist[i].djPoints;
  44. var name = userlist[i].username;
  45.  
  46. if ($.inArray(name, peoplewhoscored) == -1) {
  47.  
  48. if((totalPoints == 100) || (totalPoints == 300) || (totalPoints == 700) || (totalPoints == 1500) || (totalPoints == 3000) || (totalPoints == 10000)) {
  49. API.sendChat("Grats on " + totalPoints + " points, @" + name + "!");
  50. peoplewhoscored.push(name);
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment