Reload 4 Kong *OLD*

Reload games without refreshing the page.

  1. // ==UserScript==
  2. // @name Reload 4 Kong *OLD*
  3. // @namespace tag://kongregate
  4. // @description Reload games without refreshing the page.
  5. // @author SReject
  6. // @version 1.2.2.1
  7. // @date 2013.05.21
  8. // @include *://www.kongregate.com/games/*/*
  9. // ==/UserScript==
  10.  
  11. var d=document,s=d.createElement("script");
  12. if (top===self&&/^(?:https?:\/\/)?(?:www\.)?kongregate\.com\/games\/[^\s\\\/]+\/[^\s\\\/]+$/i.test(d.location.href)) {
  13. s.type="text/javascript";
  14. d.head.appendChild(s.appendChild(d.createTextNode('('+function(){
  15. reload4Kong=function(a){
  16. var b,d=document;
  17. if(holodeck&&activateGame&&(b=d.getElementById("quicklinks"))!==null){
  18. a=d.createElement('li');
  19. a.innerHTML='<a href="" onclick="activateGame();return false">Reload</a>';
  20. b.insertBefore(a,b.firstChild);
  21. holodeck.addChatCommand("reload",function(a,b){
  22. a.displayUnsanitizedMessage("Reloading","Please wait...",{class: "whisper whisper_received"},{non_user:true});
  23. activateGame();
  24. return false
  25. });
  26. setTimeout(function(){delete reload4Kong},1)
  27. }
  28. else if(a){setTimeout(function(b){reload4Kong(b)},10000,a--)}
  29. else{setTimeout(function(){delete reload4Kong},1)}
  30. }
  31. reload4Kong(10);
  32. }+')()')).parentNode);
  33. }