// ==UserScript== // @name hwm_map_upgrade // @namespace Demin // @description HWM mod - Avtosdacha zadanij GN, tajmer perehoda, skrytie karty (by Demin) // @homepage http://userscripts.org/scripts/show/105481 // @version 3.1 // @include http://*heroeswm.ru/* // @include http://178.248.235.15/* // @include http://209.200.152.144/* // @include http://*lordswm.com/* // @downloadURL https://update.greasyfork.icu/scripts/1226/hwm_map_upgrade.user.js // @updateURL https://update.greasyfork.icu/scripts/1226/hwm_map_upgrade.meta.js // ==/UserScript== // (c) 2011-2013, demin ( http://www.heroeswm.ru/pl_info.php?id=15091 ) var version = '3.1'; var script_num = 105481; var script_name = 'HWM mod - Avtosdacha zadanij GN, tajmer perehoda, skrytie karty (by Demin)'; var string_upd = /105481=(\d+\.\d+)/; var url_cur = location.href; var url = 'http://'+location.hostname+'/'; try { if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) { this.GM_getValue=function (key,def) { return localStorage[key] || def; }; this.GM_setValue=function (key,value) { return localStorage[key]=value; }; this.GM_deleteValue=function (key) { return delete localStorage[key]; }; } var flash_map = document.querySelector("object > param[value*='map.swf']"); if ( flash_map ) flash_map = flash_map.parentNode.querySelector("param[name='FlashVars']"); if ( document.querySelector("body") && flash_map ) { var place_map = flash_map.value.split('=')[1].split(':'); place_map[0] = /(\d+)/.exec( place_map[0] )[1]; if ( !GM_getValue("hwm_map_checkgn") ) GM_setValue( "hwm_map_checkgn", "1" ); if ( !GM_getValue("hwm_map_move_hide") ) GM_setValue( "hwm_map_move_hide", "1" ); if ( !GM_getValue("hwm_map_hide_gv") ) GM_setValue( "hwm_map_hide_gv", "1" ); if ( !GM_getValue("hwm_map_hide_map") ) GM_setValue( "hwm_map_hide_map", "0" ); add(place_map, flash_map); hidemap(place_map, flash_map); init(place_map); } } finally { update_n() } function hidemap(place_map, flash_map) { if ( url.match('lordswm') ) { var text_show_map = ' display map'; } else { var text_show_map = ' \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0443'; } if( place_map[14]==0 ) { if ( document.querySelector("a[href^='thief_ambush_cancel.php']") && ( GM_getValue( "hwm_map_hide_gv" )=="1" ) ) { flash_map.parentNode.style.display = 'none'; $('id_check_map2').innerHTML = text_show_map; $('id_check_map_one2').style.display = ''; $('id_check_map3').style.display = 'none'; } else if ( GM_getValue( "hwm_map_hide_map" )=="1" && ( place_map[0]==place_map[1] || $("div_left") ) ) { flash_map.parentNode.style.display = 'none'; $('id_check_map2').innerHTML = text_show_map; $('id_check_map_one2').style.display = ''; } } else if ( GM_getValue( "hwm_map_move_hide" )=="1" ) { flash_map.parentNode.style.display = 'none'; } } function add(place_map, flash_map) { var parent = flash_map.parentNode; while ( parent.tagName.toLowerCase()!='table' ) { parent = parent.parentNode; } parent.setAttribute("cellspacing", "0"); if( place_map[14]==0 ) { parent = parent.parentNode; while ( parent.tagName.toLowerCase()!='table' ) { parent = parent.parentNode; } parent.setAttribute("cellspacing", "0"); if ( url.match('lordswm') ) { var text_gn = ' complete objectives MG'; var text_hide_move = ' hide map on going'; var text_hide_gv = ' hide map in ambush TG'; var text_hide_map = ' hide map'; var text_show_map1 = ' display map once'; } else { var text_gn = ' \u0441\u0434\u0430\u0432\u0430\u0442\u044C \u0437\u0430\u0434\u0430\u043D\u0438\u044F \u0413\u041D'; var text_hide_move = ' \u0441\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043A\u0430\u0440\u0442\u0443 \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0435'; var text_hide_gv = ' \u0441\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043A\u0430\u0440\u0442\u0443 \u043F\u0440\u0438 \u0437\u0430\u0441\u0430\u0434\u0435 \u0413\u0412'; var text_hide_map = ' \u0441\u043A\u0440\u044B\u0442\u044C \u043A\u0430\u0440\u0442\u0443'; var text_show_map1 = ' \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0443 \u043E\u0434\u043D\u043E\u043A\u0440\u0430\u0442\u043D\u043E'; } var dm = document.createElement('table'); dm.style.width = "452"; dm.setAttribute("cellspacing", "0"); dm.setAttribute("cellpadding", "0"); dm.innerHTML = '