// ==UserScript== // @name MH - BWrift HUD Enhancer(Charms) // @version 1.0.0 // @description See and change charms on your bwrift HUD! // @author Chromatical // @match https://www.mousehuntgame.com/* // @match https://apps.facebook.com/mousehunt/* // @icon https://www.google.com/s2/favicons?domain=mousehuntgame.com // @grant none // @namespace https://greasyfork.org/users/748165 // @downloadURL none // ==/UserScript== (function() { if (user.environment_name == "Bristle Woods Rift"){ huntListener(); getData(); } })(); var vac_quantity = 0; var super_vac_quantity = 0; var anti_skele_quantity = 0; function huntListener(){ const originalOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (){ this.addEventListener("load",function(){ if (this.responseURL === "https://www.mousehuntgame.com/managers/ajax/turns/activeturn.php" ||this.responseURL === "https://www.mousehuntgame.com/managers/ajax/pages/page.php"){ success:{update()} } }) originalOpen.apply(this,arguments); }; }; function getData(){ postReq("https://www.mousehuntgame.com/managers/ajax/users/gettrapcomponents.php", `sn=Hitgrab&hg_is_ajax=1&uh=${user.unique_hash}&classification=trinket` ).then(res=>{ try { var response = JSON.parse(res.responseText); if (response) { for (var i = 0;i{ try { var response = JSON.parse(res.responseText); if (response) { document.getElementsByClassName("Charm-Quantity")[0].textContent = 0; document.getElementsByClassName("Charm-Quantity")[1].textContent = 0; document.getElementsByClassName("Charm-Quantity")[2].textContent = 0; for (var i = 0;i { const xhr = new XMLHttpRequest(); xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function () { if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { resolve(this); } }; xhr.onerror = function () { reject(this); }; xhr.send(form); }); }