// ==UserScript== // @name HWM_AutoReportMGTasks // @namespace Небылица // @version 1.11 // @description Автосдача задания ГН // @author Небылица // @include /^https{0,1}:\/\/((www|qrator)\.heroeswm\.ru|178\.248\.235\.15)\/(map|mercenary_guild)\.php/ // @grant GM_setValue // @grant GM_getValue // @downloadURL none // ==/UserScript== (function() { 'use strict'; // скрипт требует для своей работы скрипт SetsMaster от Demin, который должен находиться выше по порядку исполнения if (document.getElementById("pers_gn").innerHTML.split(":").length === 3){ if ((document.querySelector("a[href=\"map.php?cx=51&cy=50\"]") !== null) || (document.querySelector("a[href=\"map.php?cx=50&cy=48\"]") !== null) || (document.querySelector("a[href=\"map.php?cx=52&cy=48\"]") !== null) || (document.querySelector("a[href=\"map.php?cx=52&cy=53\"]") !== null)){ var xhr = new XMLHttpRequest(); var response; xhr.open('GET', "mercenary_guild.php", true); xhr.send(); xhr.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { response = xhr.responseText; if (response.indexOf("Статус") !== -1){ try{GM_setValue("reward", response.match(/

(.+?)/)[1]);} catch(err){console.log(err);} window.open("mercenary_guild.php", "_self"); } } }; } } if (location.pathname.indexOf("mercenary_guild.php") !== -1 && GM_getValue("reward") !== "-1"){ var td = document.querySelector("td[rowspan=\"2\"]"); td.innerHTML = td.innerHTML.split("