smooshie

to see who curates a song?

Oct 20th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. API.addEventListener(API.CURATE_UPDATE, seecurates);
  2. function seecurates(obj)
  3. {
  4. var media = API.getMedia();
  5. console.log(obj.user.username + " added " + media.author + " - " + media.title);
  6. }
  7.  
  8. API.addEventListener(API.DJ_UPDATE, pointcheck);
  9. var peoplewhoscored = new Array();
  10.  
  11. function pointcheck(user) {
  12.  
  13. var userlist=API.getUsers();
  14. var peopleinroom=userlist.length;
  15.  
  16. for(var i=0; i<peopleinroom;i++)
  17. {
  18.  
  19. var totalPoints = userlist[i].curatorPoints+userlist[i].listenerPoints+userlist[i].djPoints;
  20. var name = userlist[i].username;
  21.  
  22. if ($.inArray(name, peoplewhoscored) == -1) {
  23.  
  24. if ((totalPoints > 99 && totalPoints < 105) || (totalPoints > 299 && totalPoints < 310) || (totalPoints > 699 && totalPoints < 715) || (totalPoints > 999 && totalPoints < 1015) || (totalPoints > 2999 && totalPoints < 3015) || (totalPoints > 9999 && totalPoints < 10015)) {
  25. alert("Grats on " + totalPoints + " points, @" + name + "!");
  26. peoplewhoscored.push(name);
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment