hwm_map_refresh

HWM mod - hwm_map_refresh (by Demin)

  1. // ==UserScript==
  2. // @name hwm_map_refresh
  3. // @namespace Demin
  4. // @description HWM mod - hwm_map_refresh (by Demin)
  5. // @homepage http://userscripts.org/scripts/show/92567
  6. // @version 1.04
  7. // @include http://*heroeswm.*/map.php*
  8. // @include http://178.248.235.15/map.php*
  9. // @include http://173.231.37.114/map.php*
  10. // @include http://*freebsd-help.org/map.php*
  11. // @include http://*heroes-wm.*/map.php*
  12. // @include http://*hommkingdoms.info/map.php*
  13. // @include http://*hmmkingdoms.com/map.php*
  14. // @include http://*герои.рф/map.php*
  15. // @include http://*.lordswm.*/map.php*
  16. // @include http://*.heroeswm.*/forum_thread.php?id=10
  17. // ==/UserScript==
  18.  
  19. // (c) 2010-2011, demin (http://www.heroeswm.ru/pl_info.php?id=15091)
  20.  
  21. // http://*.heroeswm.*/pl_info.php?*
  22.  
  23. var version = '1.04';
  24.  
  25. var url_cur = location.href;
  26. var url = 'http://'+location.hostname+'/';
  27.  
  28.  
  29. var scripts = tag('script');
  30. var Timeout1;
  31. var check = 0;
  32.  
  33. for (var i=scripts.length; i--;) {
  34. if (scripts[i].innerHTML.indexOf("setTimeout")!=-1 ) {
  35. if (scripts[i].innerHTML.indexOf("Delta=")!=-1 ) {
  36. Timeout1 = scripts[i].innerHTML.split("\n")[1].replace(/.*Delta=(\d+).*/, "$1");
  37. if (Timeout1 < 35) { check = 1; }
  38. }
  39. else {
  40. check = 1;
  41. // alert("hwm_map_refresh does not work on the current page!");
  42. }
  43. }
  44. }
  45.  
  46. if ( check == 0 ) {
  47. setTimeout(function() { window.location=url_cur; }, 34000);
  48. }
  49.  
  50. function $( id ) { return document.getElementById( id ); }
  51.  
  52. function tag( id ) { return document.getElementsByTagName( id ); }