🏠 返回首頁 

Greasy Fork is available in English.

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. // (c) 2010-2011, demin (http://www.heroeswm.ru/pl_info.php?id=15091)
  19. // http://*.heroeswm.*/pl_info.php?*
  20. var version = '1.04';
  21. var url_cur = location.href;
  22. var url = 'http://'+location.hostname+'/';
  23. var scripts = tag('script');
  24. var Timeout1;
  25. var check = 0;
  26. for (var i=scripts.length; i--;) {
  27. if (scripts[i].innerHTML.indexOf("setTimeout")!=-1 ) {
  28. if (scripts[i].innerHTML.indexOf("Delta=")!=-1 ) {
  29. Timeout1 = scripts[i].innerHTML.split("\n")[1].replace(/.*Delta=(\d+).*/, "$1");
  30. if (Timeout1 < 35) { check = 1; }
  31. }
  32. else {
  33. check = 1;
  34. // alert("hwm_map_refresh does not work on the current page!");
  35. }
  36. }
  37. }
  38. if ( check == 0 ) {
  39. setTimeout(function() { window.location=url_cur; }, 34000);
  40. }
  41. function $( id ) { return document.getElementById( id ); }
  42. function tag( id ) { return document.getElementsByTagName( id ); }