nabbynz

Confirm Next Game

Apr 15th, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name            Confirm Next Game
  3. // @description     Confirm play another game (or return to server page). Helps prevent AFK bans.
  4. // @version         0.1.1
  5. // @include         http://tagpro-*.koalabeast.com:*
  6. // @include         http://*.newcompte.fr:*
  7. // @license         GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
  8. // @author          nabby
  9. // ==/UserScript==
  10.  
  11. tagpro.ready(function() {
  12.     tagpro.socket.on('end', function(data) {
  13.         var endTime = (new Date).getTime();
  14.        
  15.         setTimeout(function() {
  16.             var confirmNewGame = confirm('Do you want to play another game?');
  17.            
  18.             if (!confirmNewGame) {
  19.                 window.location = 'http://' + tagpro.serverHost;
  20.             } else {
  21.                 var clickTime = (new Date).getTime();
  22.                 if (clickTime - endTime > 10000) { //possibly not necessary
  23.                     window.location = 'http://' + tagpro.serverHost + '/games/find/';
  24.                 }
  25.             }
  26.         }, 6000);
  27.  
  28.     });
  29. });
Advertisement
Add Comment
Please, Sign In to add comment