Advertisement
dcv

Send Score

dcv
Jul 7th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. //define variables
  2. var woots = API.getScore().positive;
  3. var mehs = API.getScore().negative;
  4. var grabs = API.getScore().grabs;
  5.  
  6. //this gets the score
  7. function getScore() {
  8. woots = API.getScore().positive;
  9. mehs = API.getScore().negative;
  10. grabs = API.getScore().grabs;
  11. }
  12. //this updates the score every 10 seconds
  13. setInterval(function(){ getScore(); }, 10000);
  14.  
  15. //this sends the score
  16. function sendScore() {
  17. API.sendChat("Woots: " + woots + " | Mehs: " + mehs + " | Grabs: " + grabs);
  18. }
  19. //this sends the score on the song advance for the previous song
  20. API.on(API.ADVANCE, function(data) {
  21. sendScore();
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement