To be used with the Ghost Trappers Facebook game. This script will count the total number of ghosts a player has caught and places the information in their profile page.
当前为
// ==UserScript==
// @name MouseHunt - Spooky Shuffle Tracker
// @author Rani Kheir
// @namespace https://greasyfork.org/users/4271-rani-kheir
// @version 1.2
// @description To be used with the Ghost Trappers Facebook game. This script will count the total number of ghosts a player has caught and places the information in their profile page.
// @include http://www.mousehuntgame.com/index.php
// @include https://www.mousehuntgame.com/index.php
// @include http://www.mousehuntgame.com/
// @include https://www.mousehuntgame.com/
// @include http://www.mousehuntgame.com
// @include https://www.mousehuntgame.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
var origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
//console.log('request started!');
this.addEventListener('load', function() {
var x = JSON.parse(this.responseText);
if (x.memory_game != undefined) {
var cards = x.memory_game.cards;
var len = x.memory_game.cards.length;
if (document.getElementById("card-hack-0"))
{
for (var i = 0; i < len; i++) {
if (x.memory_game.cards[i].name !== "?")
{
var ele = document.getElementById("card-hack-" + i);
ele.style.color = "green";
ele.firstChild.innerHTML = x.memory_game.cards[i].name;
}
}
}
else
{
for (var i = 0; i < len; i++) {
var divElement = document.createElement("Div");
divElement.id = "card-hack-" + i;
divElement.style.marginLeft = "12px";
divElement.style.textAlign = "center";
divElement.style.fontWeight = "bold";
divElement.style.fontSize = "smaller";
var paragraph = document.createElement("P");
var text = document.createTextNode("-----");
paragraph.appendChild(text);
divElement.appendChild(paragraph);
document.querySelector("[data-card-id='" + i + "']").appendChild(divElement);
}
}
}
});
origOpen.apply(this, arguments);
};
})();