// ==UserScript==
// @name MH King's Crowns+
// @author Ben Loll - Warden Slayer#2302
// @namespace https://greasyfork.org/en/users/227259-wardenslayer
// @version 1.5
// @description Platinum Corwns, Locked Favorites, and More!
// @include https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// @include http://www.mousehuntgame.com/*
// @include https://www.mousehuntgame.com/*
// ==/UserScript==
//===================================================================================
$(document).ready(function() {
var observer = new MutationObserver(callback);
var observerOptions = {
childList: true,
attributes: false,
subtree: false,
};
observer.observe($("#tabbarContent_page_2").get(0), observerOptions);
});
//
function callback(mutationList, observer) {
mutationList.forEach((mutation) => {
switch (mutation.type) {
case 'childList':
console.log("MH King's Crowns+")
if (localStorage.getItem('haltCode') == "Y") {
localStorage.setItem('haltCode', "N")
break;
}
buildToolbar()
if (localStorage.getItem('ShowAllCrowns') == "Y") {
buildCrownHeaders();
sortCrowns();
}
if (localStorage.getItem('ShowCommunityRanks') == "Y") {
showCommunityRanks()
}
if (localStorage.getItem('Lock Favorites') == "Y" && $(".favoriteCrownToggle.crownAction").length > 0) {
lockFavorites();
} else {
$(".crownheader.crownheadertop").css("background", "url('https://image.flaticon.com/icons/svg/189/189671.svg') no-repeat left top")
}
localStorage.setItem('haltCode', "Y");
break;
}
})
};
//
function buildToolbar() {
//If we already have an hideLe Section, do not make another
if ($('.toolBar').length > 0)
return;
var toolBar = document.createElement("div");
toolBar.classList.add('toolBar')
//Lock Favs Cb
var lockFavs = document.createElement('input');
lockFavs.type = "checkbox";
lockFavs.name = "lockFavs";
lockFavs.value = "";
lockFavs.id = "lockFavs";
if (localStorage.getItem('LockFavs') == "Y") {
lockFavs.checked = "Yes";
} else {
lockFavs.checked = "";
}
var lockFavsLabel = document.createElement('label')
lockFavsLabel.htmlFor = "lockFavsLabel";
lockFavsLabel.appendChild(document.createTextNode('Lock Favorites'));
if ($(".favoriteCrownToggle.crownAction").length > 0) {
toolBar.appendChild(lockFavs);
toolBar.appendChild(lockFavsLabel);
}
//All Crowns Cb
var showAllCrowns = document.createElement('input');
showAllCrowns.type = "checkbox";
showAllCrowns.name = "showAllCrowns";
showAllCrowns.value = "";
showAllCrowns.id = "showAllCrowns";
showAllCrowns.checked = "";
if (localStorage.getItem('ShowAllCrowns') == "Y") {
showAllCrowns.checked = "Yes";
} else {
showAllCrowns.checked = "";
}
var showAllCrownsLabel = document.createElement('label')
showAllCrownsLabel.htmlFor = "showAllCrownsLabel";
showAllCrownsLabel.appendChild(document.createTextNode('Show Community Crowns'));
toolBar.appendChild(showAllCrowns);
toolBar.appendChild(showAllCrownsLabel);
//Comminity Ranks Cb
var communityRanks = document.createElement('input');
communityRanks.type = "checkbox";
communityRanks.name = "communityRanks";
communityRanks.value = "";
communityRanks.id = "communityRanks";
communityRanks.checked = "";
if (localStorage.getItem('ShowCommunityRanks') == "Y") {
communityRanks.checked = "Yes";
} else {
communityRanks.checked = "";
}
var communityRanksLabel = document.createElement('label')
communityRanksLabel.htmlFor = "communityRanksLabel";
communityRanksLabel.appendChild(document.createTextNode('Show Community Ranks'));
toolBar.appendChild(communityRanks);
toolBar.appendChild(communityRanksLabel);
//last
var crownBreak = $(".crownbreak").first();
if ($(".crownheader.crownheadertop").length < 1) {
var header = $(".crownbreak").last().clone();
header.insertBefore($(".crownheader.crownheadergold"))
crownBreak = $(header);
}
crownBreak.append(toolBar)
$(".toolBar").css({
"float": "right"
})
};
//================================= Lock Favs ====================================
//
$(document).on('change', '#lockFavs', function() {
if ((window.location.href).includes("profile.php") && $("#tabbarContent_page_2").hasClass("active")) {
//
//check to see if the cb was JUST checked
if (this.checked) {
// Put the checked value into storage
localStorage.setItem('LockFavs', "Y");
lockFavs.checked = "Yes";
lockFavorites();
} else {
// Put the checked value into storage
localStorage.setItem('LockFavs', "N");
lockFavs.checked = "";
unlockFavorites();
}
}
});
//
function lockFavorites() {
localStorage.setItem('Lock Favorites', "Y")
var allMice = $(".favoriteCrownToggle.crownAction");
allMice.css('pointer-events', 'none');
$(".crownheader.crownheadertop").css("background", "url('https://image.flaticon.com/icons/svg/204/204310.svg') no-repeat left top");
}
function unlockFavorites() {
localStorage.setItem('Lock Favorites', "N")
var allMice = $(".favoriteCrownToggle.crownAction");
allMice.css('pointer-events', 'auto');
$(".crownheader.crownheadertop").css("background", "url('https://image.flaticon.com/icons/svg/189/189671.svg') no-repeat left top");
}
//================================== Crowns =====================================
//
$(document).on('change', '#showAllCrowns', function() {
if ((window.location.href).includes("profile.php") && $("#tabbarContent_page_2").hasClass("active")) {
//
//check to see if the cb was JUST checked
if (this.checked) {
// Put the checked value into storage
localStorage.setItem('ShowAllCrowns', "Y");
showAllCrowns.checked = "Yes";
buildCrownHeaders();
sortCrowns();
} else {
// Put the checked value into storage
localStorage.setItem('ShowAllCrowns', "N");
showAllCrowns.checked = "";
hideCrowns();
}
}
});
//
function buildCrownHeaders() {
var crownBreak = $(".crownbreak").first();
var spacer1 = $(".crownbreak").last().clone().attr('id', 'spacer1');
var spacer2 = spacer1.clone().attr('id', 'spacer2');
var spacer3 = spacer1.clone().attr('id', 'spacer3');
var platinumHeader = $("<div class='crownheader crownheaderplatinum'>Platinum Crowns <span class='crownquantity'></span> <div class='crownnote'>Earned at 1000 catches</div></div>")
var diamondHeader = $("<div class='crownheader crownheaderdiamond'>Diamond Crowns <span class='crownquantity'></span> <div class='crownnote'>Earned at 2500 catches</div></div>")
var masterHeader = $("<div class='crownheader crownheadermaster'>Master Crowns <span class='crownquantity'></span> <div class='crownnote'>Earned at 5000 catches</div></div>")
//Add Larry Later <10
//
//Plat
var allMice = $(".mousebox");
var allGold = allMice.find(".numcatches.gold");
if (allGold.filter(function(index) {
if ($(this).text() >= 1000) {
return true;
} else {
return false;
}
}).length > 0 && $(".crownheader.crownheaderplatinum").length < 1) {
platinumHeader.insertAfter(crownBreak);
spacer3.insertAfter(platinumHeader);
}
//Diamond
if (allGold.filter(function(index) {
if ($(this).text() >= 2500) {
return true;
} else {
return false;
}
}).length > 0 && $(".crownheader.crownheaderdiamond").length < 1) {
diamondHeader.insertAfter(crownBreak);
spacer1.insertAfter(diamondHeader);
}
//Master
if (allGold.filter(function(index) {
if ($(this).text() >= 5000) {
return true;
} else {
return false;
}
}).length > 0 && $(".crownheader.crownheadermaster").length < 1) {
masterHeader.insertAfter(crownBreak);
spacer2.insertAfter(masterHeader);
}
}
function sortCrowns() {
//Plat
if ($(".crownheader.crownheaderplatinum").length > 0) {
sortPlatinum()
}
//Diamond
if ($(".crownheader.crownheaderdiamond").length > 0) {
sortDiamond()
}
//Master
if ($(".crownheader.crownheadermaster").length > 0) {
sortMaster()
}
//Favorites
if ($(".crownheader.crownheadertop").length > 0) {
sortFavotitesAfterSort()
}
if ($(".crownheader.crownheadercommunity").length > 0) {
var crownBreak = $(".crownbreak").first();
$(".crownheader.crownheadercommunity").insertAfter(crownBreak);
$("#spacer4").insertAfter($(".crownheader.crownheadercommunity"));
$(".rank.summary").insertAfter($(".crownheader.crownheadercommunity"))
}
}
function sortPlatinum() {
var allMice = $(".mousebox");
var allGold = allMice.find(".numcatches.gold");
var allPlatinum = allGold.filter(function(index) {
if ($(this).text() >= 1000 && $(".mousebox").length > 0) {
return true;
} else {
return false;
}
})
if ($(".favoriteCrownToggle.crownAction").length > 0) {
allPlatinum = allPlatinum.parent().parent().not(".mousebox.favorite").parent();
} else {
allPlatinum = allPlatinum.parent().parent().not(".mousebox.favorite");
}
var platinumHeader = $(".crownheader.crownheaderplatinum")
var goldHeader = $(".crownheader.crownheadergold")
allPlatinum.insertAfter(platinumHeader);
allPlatinum.find(".numcatches.gold").removeClass("numcatches gold").addClass("numcatches plat");
localStorage.setItem('PlatCrownCount', allPlatinum.length);
var goldQuantity = goldHeader.find(".crownquantity").text().replace(/[{()}]/g, '');
goldHeader.find(".crownquantity").text("(" + (parseInt(goldQuantity, 10) - localStorage.getItem('PlatCrownCount')) + ")")
platinumHeader.find(".crownquantity").text("(" + localStorage.getItem('PlatCrownCount') + ")")
platinumHeader.css("background", "url('https://i.ibb.co/BfGw6Rj/crown-platinum.png') no-repeat left top");
$(".numcatches.plat").css("background", "url('https://i.ibb.co/BfGw6Rj/crown-platinum.png') no-repeat right top");
}
function sortDiamond() {
var allMice = $(".mousebox");
var allPlat = allMice.find(".numcatches.plat");
var allDiamond = allPlat.filter(function(index) {
if ($(this).text() >= 2500 && $(".mousebox").length > 0) {
return true;
} else {
return false;
}
})
if ($(".favoriteCrownToggle.crownAction").length > 0) {
allDiamond = allDiamond.parent().parent().not(".mousebox.favorite").parent();
} else {
allDiamond = allDiamond.parent().parent().not(".mousebox.favorite");
}
var diamondHeader = $(".crownheader.crownheaderdiamond")
var platinumHeader = $(".crownheader.crownheaderplatinum")
allDiamond.insertAfter(diamondHeader);
allDiamond.find(".numcatches.plat").removeClass("numcatches plat").addClass("numcatches diamond");
localStorage.setItem('DiamondCrownCount', allDiamond.length);
localStorage.setItem('PlatCrownCount', parseInt(localStorage.getItem('PlatCrownCount'), 10) - allDiamond.length);
platinumHeader.find(".crownquantity").text("(" + parseInt(localStorage.getItem('PlatCrownCount'), 10) + ")")
diamondHeader.find(".crownquantity").text("(" + parseInt(localStorage.getItem('DiamondCrownCount'), 10) + ")")
diamondHeader.css("background", "url('https://i.ibb.co/ygLdRBN/1232280.png') no-repeat left top");
$(".numcatches.diamond").css("background", "url('https://i.ibb.co/ygLdRBN/1232280.png') no-repeat right top");
}
function sortMaster() {
var allMice = $(".mousebox");
var allDiamond = allMice.find(".numcatches.diamond");
var allMaster = allDiamond.filter(function(index) {
if ($(this).text() >= 5000 && $(".mousebox").length > 0) {
return true;
} else {
return false;
}
});
if ($(".favoriteCrownToggle.crownAction").length > 0) {
allMaster = allMaster.parent().parent().not(".mousebox.favorite").parent();
} else {
allMaster = allMaster.parent().parent().not(".mousebox.favorite");
}
var masterHeader = $(".crownheader.crownheadermaster")
var diamondHeader = $(".crownheader.crownheaderdiamond")
allMaster.insertAfter(masterHeader);
allMaster.find(".numcatches.diamond").removeClass("numcatches diamond").addClass("numcatches master");
localStorage.setItem('MasterCrownCount', allMaster.length);
localStorage.setItem('DiamondCrownCount', parseInt(localStorage.getItem('DiamondCrownCount'), 10) - allMaster.length);
diamondHeader.find(".crownquantity").text("(" + parseInt(localStorage.getItem('DiamondCrownCount'), 10) + ")")
masterHeader.find(".crownquantity").text("(" + parseInt(localStorage.getItem('MasterCrownCount'), 10) + ")")
masterHeader.css("background", "url('https://i.ibb.co/r3hVLSh/skull.png') no-repeat left top");
$(".numcatches.master").css("background", "url('https://i.ibb.co/r3hVLSh/skull.png') no-repeat right top");
}
function sortFavotitesAfterSort() {
var topHeader = $(".crownheader.crownheadertop")
var allMice = $(".mousebox.favorite");
var allFavorites = allMice.find(".numcatches.gold");
var nonFavs = $(".mousebox").not(".mousebox favorite");
var goldHeader = $(".crownheader.crownheadergold")
var platinumHeader = $(".crownheader.crownheaderplatinum")
var diamondHeader = $(".crownheader.crownheaderdiamond")
var masterHeader = $(".crownheader.crownheadermaster")
var seen = {};
allFavorites.each(function() {
var txt = $(this).text();
if (seen[txt]) {
//move fav to new crown class
if (txt >= 5000) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(this).parent().parent().parent().insertAfter(masterHeader);
} else {
$(this).parent().parent().insertAfter(masterHeader);
}
$(this).removeClass("numcatches gold").addClass("numcatches master")
localStorage.setItem('MasterCrownCount', parseInt(localStorage.getItem('MasterCrownCount'), 10) + 1);
var goldQuantity = goldHeader.find(".crownquantity").text().replace(/[{()}]/g, '');
goldHeader.find(".crownquantity").text("(" + (parseInt(goldQuantity, 10) - 1) + ")")
masterHeader.find(".crownquantity").text("(" + localStorage.getItem('MasterCrownCount') + ")");
$(".numcatches.master").css("background", "url('https://i.ibb.co/r3hVLSh/skull.png') no-repeat right top");
var masterResult = filterOutTopFavs($(".numcatches.master").parent().find(".name"))
masterResult = masterResult.parent().find(".numcatches.master")
var masterArray = sortAcsending(masterResult);
masterArray.every(function(cell) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(cell).parent().parent().parent().detach().insertAfter(masterHeader);
} else {
$(cell).parent().parent().detach().insertAfter(masterHeader);
}
return true;
})
} else if (txt >= 2500) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(this).parent().parent().parent().insertAfter(diamondHeader);
} else {
$(this).parent().parent().insertAfter(diamondHeader);
}
$(this).removeClass("numcatches gold").addClass("numcatches diamond")
localStorage.setItem('DiamondCrownCount', parseInt(localStorage.getItem('DiamondCrownCount'), 10) + 1);
var goldQuantity = goldHeader.find(".crownquantity").text().replace(/[{()}]/g, '');
goldHeader.find(".crownquantity").text("(" + (parseInt(goldQuantity, 10) - 1) + ")")
diamondHeader.find(".crownquantity").text("(" + localStorage.getItem('DiamondCrownCount') + ")");
$(".numcatches.diamond").css("background", "url('https://image.flaticon.com/icons/svg/1232/1232280.svg') no-repeat right top");
var diamondResult = filterOutTopFavs($(".numcatches.diamond").parent().find(".name"))
diamondResult = diamondResult.parent().find(".numcatches.diamond")
var diamondArray = sortAcsending(diamondResult);
diamondArray.every(function(cell) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(cell).parent().parent().parent().detach().insertAfter(diamondHeader);
} else {
$(cell).parent().parent().detach().insertAfter(diamondHeader);
}
return true;
})
} else if (txt >= 1000) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(this).parent().parent().parent().insertAfter(platinumHeader)
} else {
$(this).parent().parent().insertAfter(platinumHeader)
}
$(this).removeClass("numcatches gold").addClass("numcatches plat")
localStorage.setItem('PlatCrownCount', parseInt(localStorage.getItem('PlatCrownCount'), 10) + 1);
var goldQuantity = goldHeader.find(".crownquantity").text().replace(/[{()}]/g, '');
goldHeader.find(".crownquantity").text("(" + (parseInt(goldQuantity, 10) - 1) + ")")
platinumHeader.find(".crownquantity").text("(" + localStorage.getItem('PlatCrownCount') + ")");
$(".numcatches.plat").css("background", "url('https://i.ibb.co/BfGw6Rj/crown-platinum.png') no-repeat right top");
var platResult = filterOutTopFavs($(".numcatches.plat").parent().find(".name"))
platResult = platResult.parent().find(".numcatches.plat")
var platArray = sortAcsending(platResult);
platArray.every(function(cell) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(cell).parent().parent().parent().detach().insertAfter(platinumHeader)
} else {
$(cell).parent().parent().detach().insertAfter(platinumHeader)
}
return true;
})
}
} else {
//change top fav to new crown class only
if (txt >= 5000) {
$(this).removeClass("numcatches gold").addClass("numcatches master")
$(".numcatches.master").css("background", "url('https://image.flaticon.com/icons/png/512/1591/1591999.png') no-repeat right top");
} else if (txt >= 2500) {
$(this).removeClass("numcatches gold").addClass("numcatches diamond")
$(".numcatches.diamond").css("background", "url('https://image.flaticon.com/icons/svg/1232/1232280.svg') no-repeat right top");
} else if (txt >= 1000) {
$(this).removeClass("numcatches gold").addClass("numcatches plat")
$(".numcatches.plat").css("background", "url('https://i.ibb.co/ygLdRBN/1232280.png') no-repeat right top")
}
seen[txt] = true;
}
});
}
//================================================================ HIDE
function hideCrowns() {
var allMice = $(".mousebox");
var allPlat = allMice.find(".numcatches.plat");
var allDiamond = allMice.find(".numcatches.diamond");
var allMaster = allMice.find(".numcatches.master");
var goldHeader = $(".crownheader.crownheadergold")
var platinumHeader = $(".crownheader.crownheaderplatinum")
var diamondHeader = $(".crownheader.crownheaderdiamond")
var masterHeader = $(".crownheader.crownheadermaster")
removeTheseCrowns(allMaster);
removeTheseCrowns(allDiamond);
removeTheseCrowns(allPlat);
allPlat.removeClass("numcatches plat").addClass("numcatches gold");
allDiamond.removeClass("numcatches diamond").addClass("numcatches gold");
allMaster.removeClass("numcatches master").addClass("numcatches gold");
var result = filterOutTopFavs($(".numcatches.gold").parent().find(".name"))
result = result.parent().find(".numcatches.gold")
var array = sortAcsending(result);
array.every(function(cell) {
if ($(".favoriteCrownToggle.crownAction").length > 0) {
$(cell).parent().parent().parent().detach().insertAfter(goldHeader);
} else {
$(cell).parent().parent().detach().insertAfter(goldHeader);
}
return true;
})
$(".numcatches.gold").css("background", "url('https://www.mousehuntgame.com/images/ui/badges/gold.png') no-repeat right top");
goldHeader.find(".crownquantity").text("(" + result.length + ")")
$(".crownheader.crownheaderplatinum").remove();
$(".crownheader.crownheaderdiamond").remove();
$(".crownheader.crownheadermaster").remove();
$("#spacer1").remove();
$("#spacer2").remove();
$("#spacer3").remove();
}
function removeTheseCrowns(elements) {
var goldHeader = $(".crownheader.crownheadergold")
var crown = elements.attr("class")
if (crown == "numcatches plat") {
crown = ".numcatches.plat"
} else if (crown == "numcatches diamond") {
crown = ".numcatches.diamond"
} else if (crown == "numcatches master") {
crown = ".numcatches.master"
}
var result = filterOutTopFavs(elements.parent().find(".name"));
result = result.parent().find(crown)
if ($(".favoriteCrownToggle.crownAction").length > 0) {
result.parent().parent().parent().detach().insertAfter(goldHeader)
} else {
result.parent().parent().detach().insertAfter(goldHeader);
}
}
function filterOutTopFavs(elements) {
var seen = {};
var result = elements.filter(function() {
var txt = $(this).text();
if (seen[txt]) {
return true;
} else {
seen[txt] = true;
if ($(this).parent().parent().hasClass("mousebox favorite")) {
return false;
} else {
return true;
}
}
})
return result;
}
function sortAcsending(result) {
var array = result.toArray();
array = array.sort(function(a, b) {
a = parseInt($(a).text(), 10)
b = parseInt($(b).text(), 10)
return a - b;
});
return array;
}
//================================= Community Ranks ====================================
//
$(document).on('change', '#communityRanks', function() {
if ((window.location.href).includes("profile.php") && $("#tabbarContent_page_2").hasClass("active")) {
//
//check to see if the cb was JUST checked
if (this.checked) {
// Put the checked value into storage
localStorage.setItem('ShowCommunityRanks', "Y");
communityRanks.checked = "Yes";
showCommunityRanks();
} else {
// Put the checked value into storage
localStorage.setItem('ShowCommunityRanks', "N");
communityRanks.checked = "";
hideCommunityRanks()
}
}
});
function showCommunityRanks() {
var totalMice = 958;
if ($(".crownheader.crownheadercommunity").length > 0) {
return;
}
var crownBreak = $(".crownbreak").first();
var spacer4 = $(".crownbreak").last().clone().attr('id', 'spacer4');
var communityCrownHeader = $("<div class='crownheader crownheadercommunity'>Community Ranks <div class='crownnote'>Set by the MH Community Groups</div></div>")
communityCrownHeader.css("background", "url('https://image.flaticon.com/icons/svg/478/478941.svg') no-repeat left top")
communityCrownHeader.insertAfter(crownBreak);
spacer4.insertAfter(communityCrownHeader);
var allMice = $(".mousebox");
var allBronze = allMice.find(".numcatches.bronze,.numcatches.silver,.numcatches.gold,.numcatches.plat,.numcatches.diamond,.numcatches.master");
allBronze = filterOutTopFavs(allBronze)
var allSilver = allMice.find(".numcatches.silver,.numcatches.gold,.numcatches.plat,.numcatches.diamond,.numcatches.master");
allSilver = filterOutTopFavs(allSilver)
var allGold = allMice.find(".numcatches.gold,.numcatches.plat,.numcatches.diamond,.numcatches.master");
allGold = filterOutTopFavs(allGold)
var bronzeHeader = $(".crownheader.crownheaderbronze")
var silverHeader = $(".crownheader.crownheadersilver")
var goldHeader = $(".crownheader.crownheadergold")
var bronzeCrowns = allBronze.length;
var silverCrowns = allSilver.length;
var goldCrowns = allGold.length;
var rankSummary = $("<div class='rank summary'></div>")
rankSummary.insertAfter(communityCrownHeader);
var bronzeText = bronzeCrowns + " Bronze Crowns = " + getRankBronze(bronzeCrowns);
var silverText = silverCrowns + " Silver Crowns = " + getRankSilver(silverCrowns);
var goldtext = goldCrowns + " Gold Crowns = " + (((goldCrowns / totalMice) * 100).toFixed(2)) + "%";
var rankText = "Crown Summary: " + bronzeText + " / " + silverText + " / " + goldtext;
rankSummary.text(rankText)
}
function getRankBronze(crowns) {
var totalMice = 958;
var crownPrecent = (((crowns / totalMice) * 100).toFixed(2)) + "%";
if (crowns >= 958) {
return crownPrecent + " or Hepatizon";
} else if (crowns >= 949) {
return crownPrecent + " or Electrum";
} else if (crowns >= 939) {
return crownPrecent + " or Palladium";
} else if (crowns >= 911) {
return crownPrecent + " or Cobalt";
} else if (crowns >= 863) {
return crownPrecent + " or Bronze (full)";
} else if (crowns >= 815) {
return crownPrecent + " or Titanium";
} else if (crowns >= 767) {
return crownPrecent + " or Pewter";
} else if (crowns >= 719) {
return crownPrecent + " or Brass";
} else if (crowns >= 671) {
return crownPrecent + " or Copper";
} else if (crowns >= 623) {
return crownPrecent + " or Tin";
} else {
return crownPrecent + " or Rust";
}
}
function getRankSilver(crowns) {
var totalMice = 958;
var crownPrecent = (((crowns / totalMice) * 100).toFixed(2)) + "%";
if (crowns >= 859) {
return crownPrecent + " or Super Secret Squirrel";
} else if (crowns >= 811) {
return crownPrecent + " or Grizzled Squirrel";
} else if (crowns >= 764) {
return crownPrecent + " or Flying Squirrel";
} else if (crowns >= 716) {
return crownPrecent + " or Chinchilla";
} else if (crowns >= 668) {
return crownPrecent + " or Meerkat";
} else if (crowns >= 620) {
return crownPrecent + " or Ferret";
} else if (crowns >= 573) {
return crownPrecent + " or Prairie Dog";
} else if (crowns >= 525) {
return crownPrecent + " or Marmot";
} else if (crowns >= 477) {
return crownPrecent + " or Woodchuck";
} else if (crowns >= 429) {
return crownPrecent + " or Wombat";
} else if (crowns >= 382) {
return crownPrecent + " or Pine Marten";
} else if (crowns >= 334) {
return crownPrecent + " or Chipmunk";
} else if (crowns >= 286) {
return crownPrecent + " or Bandicoot";
} else {
return crownPrecent + " or Weasel"
}
};
function hideCommunityRanks() {
if ($(".crownheader.crownheadercommunity").length > 0) {
$(".crownheader.crownheadercommunity").remove();
$("#spacer4").remove();
$(".rank.summary").remove();
}
}