Advertisement
SuperSans

TagProGo

Aug 5th, 2014
1,021
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          TagProGO
  3. // @namespace     http://www.reddit.com/u/SuperSans
  4. // @description   Plays the "Go" sound on late game join
  5. // @include       http://tagpro-*.koalabeast.com:*
  6. // @include       http://tangent.jukejuice.com:*
  7. // @include       http://maptest.newcompte.fr:*
  8. // @include       http://justletme.be:*
  9. // @license       WTFPL; http://www.wtfpl.net/txt/copying/
  10. // @author        SuperSans
  11. // @version       1.0
  12. // ==/UserScript==
  13.  
  14.  
  15. var goSound = new Audio("http://tagpro-origin.koalabeast.com/sounds/go.mp3");
  16. function playSound() {
  17.         goSound.play();
  18. }
  19.    
  20. function getGameEnd() {
  21.     var d = new Date();
  22.     var n = d.getTime();
  23.     var end = tagpro.gameEndsAt;
  24.     var endTime = end.getTime();
  25.     var difference = endTime-n;
  26.     if (difference < 720000 && difference > 20000){
  27.         playSound();
  28. }
  29. }
  30. window.onload = function(){getGameEnd()};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement