You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
292 KiB
110 lines
292 KiB
3 years ago
|
// ==UserScript==
|
||
|
// @name Knightdom
|
||
|
// @namespace http://tampermonkey.net/
|
||
|
// @version 1.0.4
|
||
|
// @description Press Q to Auto-refresh
|
||
|
// @author NFTHoarder - Modified by WTMike24 and @DUCKSAUCE (@ROCKETSAUCE)
|
||
|
// @match https://magiceden.io/marketplace/knightdom
|
||
|
// @icon https://www.google.com/s2/favicons?domain=moonrank.app
|
||
|
// @grant none
|
||
|
// ==/UserScript==
|
||
|
|
||
|
(function() {
|
||
|
'use strict';
|
||
|
window.AutoRefresh = 0;
|
||
|
window.OpacityBoolean = 1;
|
||
|
window.Mints = {
|
||
|
"Knightdom #0":1883, "Knightdom #1":4513, "Knightdom #2":6563, "Knightdom #3":5619, "Knightdom #4":12160, "Knightdom #5":6643, "Knightdom #6":7072, "Knightdom #7":6668, "Knightdom #8":8170, "Knightdom #9":7586, "Knightdom #10":1178, "Knightdom #11":11453, "Knightdom #12":9947, "Knightdom #13":9009, "Knightdom #14":10666, "Knightdom #15":11660, "Knightdom #16":8655, "Knightdom #17":11349, "Knightdom #18":9879, "Knightdom #19":4820, "Knightdom #20":11679, "Knightdom #21":4621, "Knightdom #22":6816, "Knightdom #23":5595, "Knightdom #24":1676, "Knightdom #25":11816, "Knightdom #26":12142, "Knightdom #27":5620, "Knightdom #28":2963, "Knightdom #29":5243, "Knightdom #30":4212, "Knightdom #31":11523, "Knightdom #32":500, "Knightdom #33":3715, "Knightdom #34":6162, "Knightdom #35":11236, "Knightdom #36":11883, "Knightdom #37":7659, "Knightdom #38":6741, "Knightdom #39":11960, "Knightdom #40":4875, "Knightdom #41":5490, "Knightdom #42":4846, "Knightdom #43":1359, "Knightdom #44":2585, "Knightdom #45":11433, "Knightdom #46":4524, "Knightdom #47":1411, "Knightdom #48":11732, "Knightdom #49":9734, "Knightdom #50":10083, "Knightdom #51":3642, "Knightdom #52":10426, "Knightdom #53":3212, "Knightdom #54":4068, "Knightdom #55":8695, "Knightdom #56":11578, "Knightdom #57":4848, "Knightdom #58":1834, "Knightdom #59":5563, "Knightdom #60":11601, "Knightdom #61":4048, "Knightdom #62":10065, "Knightdom #63":5464, "Knightdom #64":1706, "Knightdom #65":52, "Knightdom #66":3769, "Knightdom #67":8485, "Knightdom #68":11687, "Knightdom #69":6597, "Knightdom #70":7833, "Knightdom #71":10183, "Knightdom #72":9320, "Knightdom #73":2427, "Knightdom #74":2702, "Knightdom #75":5331, "Knightdom #76":10674, "Knightdom #77":9720, "Knightdom #78":205, "Knightdom #79":8421, "Knightdom #80":4911, "Knightdom #81":342, "Knightdom #82":6694, "Knightdom #83":11643, "Knightdom #84":8692, "Knightdom #85":11967, "Knightdom #86":11780, "Knightdom #87":5906, "Knightdom #88":8302, "Knightdom #89":10438, "Knightdom #90":4278, "Knightdom #91":9935, "Knightdom #92":3437, "Knightdom #93":11357, "Knightdom #94":12074, "Knightdom #95":164, "Knightdom #96":6, "Knightdom #97":9616, "Knightdom #98":1959, "Knightdom #99":2010, "Knightdom #100":7118, "Knightdom #101":2937, "Knightdom #102":466, "Knightdom #103":7656, "Knightdom #104":1462, "Knightdom #105":659, "Knightdom #106":5438, "Knightdom #107":7372, "Knightdom #108":4134, "Knightdom #109":1377, "Knightdom #110":9301, "Knightdom #111":1530, "Knightdom #112":11223, "Knightdom #113":9442, "Knightdom #114":2323, "Knightdom #115":8234, "Knightdom #116":12065, "Knightdom #117":2192, "Knightdom #118":5244, "Knightdom #119":10937, "Knightdom #120":5852, "Knightdom #121":11689, "Knightdom #122":8272, "Knightdom #123":8629, "Knightdom #124":10259, "Knightdom #125":4147, "Knightdom #126":2204, "Knightdom #127":12310, "Knightdom #128":9893, "Knightdom #129":12099, "Knightdom #130":4014, "Knightdom #131":5173, "Knightdom #132":7967, "Knightdom #133":8754, "Knightdom #134":2348, "Knightdom #135":3491, "Knightdom #136":8985, "Knightdom #137":11071, "Knightdom #138":8944, "Knightdom #139":3566, "Knightdom #140":640, "Knightdom #141":12245, "Knightdom #142":2890, "Knightdom #143":12134, "Knightdom #144":10503, "Knightdom #145":7154, "Knightdom #146":2143, "Knightdom #147":10318, "Knightdom #148":9996, "Knightdom #149":9317, "Knightdom #150":8466, "Knightdom #151":8368, "Knightdom #152":1752, "Knightdom #153":4397, "Knightdom #154":3265, "Knightdom #155":9325, "Knightdom #156":9239, "Knightdom #157":2429, "Knightdom #158":1195, "Knightdom #159":9584, "Knightdom #160":4931, "Knightdom #161":5647, "Knightdom #162":3044, "Knightdom #163":11939, "Knightdom #164":1, "Knightdom #165":8544, "Knightdom #166":9076, "Knightdom #167":6735, "Knightdom #168":11486, "Knightdom #169":1065, "Knightdom #170":11028, "Knightdom #171":12301, "Knightdom #172":10480, "Knightdom #173":7410, "Knightdom #174":3851, "Knightdom #175":609, "Knightdom #176":3481, "Knightdom #177":2171, "Knightdom #178":3917, "Knightdom #179":5367, "Knightdom #180":7311, "Knightdom #1
|
||
|
|
||
|
window.MintSize = Object.keys(window.Mints).length;
|
||
|
var i = document.createElement('iframe');
|
||
|
i.style.display = 'none';
|
||
|
document.body.appendChild(i);
|
||
|
window.console = i.contentWindow.console;
|
||
|
|
||
|
var script = document.createElement('script');
|
||
|
script.src = 'https://code.jquery.com/jquery-3.4.1.min.js';
|
||
|
script.type = 'text/javascript';
|
||
|
document.getElementsByTagName('head')[0].appendChild(script);
|
||
|
setTimeout(function() {
|
||
|
const newDiv = document.createElement("div");
|
||
|
newDiv.setAttribute("id", "jquery_loaded");
|
||
|
const currentDiv = document.getElementById("root");
|
||
|
document.body.insertBefore(newDiv, currentDiv);
|
||
|
}, 1000);
|
||
|
|
||
|
(new MutationObserver(checkForJquery)).observe(document, {childList: true, subtree: true});
|
||
|
|
||
|
function checkForJquery(changes, observer) {
|
||
|
if(document.querySelector('#jquery_loaded')) {
|
||
|
observer.disconnect();
|
||
|
var oldFetch = fetch;
|
||
|
$('#root').css({ background: "black"});
|
||
|
$('body').keydown(function (e){
|
||
|
console.log(e.keyCode);
|
||
|
if(e.keyCode == 81){
|
||
|
toggleAutoRefresh();
|
||
|
}
|
||
|
if(e.keyCode == 82){
|
||
|
buyQuick();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
setInterval(function() {
|
||
|
quackWithOffers();
|
||
|
}, 50);
|
||
|
|
||
|
setInterval(function() {
|
||
|
autoRefresh();
|
||
|
}, 5000);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function buyQuick() {
|
||
|
$(".content").find("button")[3].click();
|
||
|
}
|
||
|
|
||
|
function autoRefresh() {
|
||
|
$(".d-flex").css({ display: "flex"});
|
||
|
//$(".pt-2").css({ padding: ".5rem"});
|
||
|
if(window.AutoRefresh == 1) {
|
||
|
$(".me-refresh-btn")[0].click()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function toggleAutoRefresh() {
|
||
|
if(window.AutoRefresh == 0) {
|
||
|
window.AutoRefresh = 1;
|
||
|
} else {
|
||
|
window.AutoRefresh = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function quackWithOffers() {
|
||
|
$(".grid-card__title").each(function( index ) {
|
||
|
var text = $( this ).text();
|
||
|
var split = text.split(" #");
|
||
|
var mint = parseInt(split[1]);
|
||
|
var rarityRank = 0;
|
||
|
var opacity = 1;
|
||
|
|
||
|
rarityRank = parseInt(window.Mints[text]);
|
||
|
//opacity = (window.MintSize - rarityRank) / window.MintSize + 0.5;
|
||
|
opacity=1;
|
||
|
$(this).text("#"+mint+"; Rank: "+rarityRank)
|
||
|
$(this).parent().parent().parent().parent().css({ opacity: opacity });
|
||
|
|
||
|
if(rarityRank <= window.MintSize/80) {
|
||
|
$(this).parent().parent().parent().parent().css({ border: '5px solid crimson' });
|
||
|
} else if(rarityRank <= window.MintSize/10) {
|
||
|
$(this).parent().parent().parent().parent().css({ border: '5px solid yellow' });
|
||
|
} else if(rarityRank <= window.MintSize/5) {
|
||
|
$(this).parent().parent().parent().parent().css({ border: '5px solid silver' });
|
||
|
}
|
||
|
$(this).removeClass('grid-card__title');
|
||
|
$(this).removeClass('grid-card__title');
|
||
|
$(this).removeClass('grid-card__title');
|
||
|
});
|
||
|
}
|
||
|
})();
|