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.
scripts/javascript/MagicEden-StockTylers.js

109 lines
60 KiB

// ==UserScript==
// @name Stock Tylers
// @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/stock_tylers
// @icon https://www.google.com/s2/favicons?domain=moonrank.app
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.AutoRefresh = 0;
window.OpacityBoolean = 1;
window.Mints = {
"Stock Tylers #1":1982, "Stock Tylers #2":1890, "Stock Tylers #3":391, "Stock Tylers #4":2153, "Stock Tylers #5":1702, "Stock Tylers #6":1720, "Stock Tylers #7":736, "Stock Tylers #8":1437, "Stock Tylers #9":401, "Stock Tylers #10":2127, "Stock Tylers #11":1068, "Stock Tylers #12":2192, "Stock Tylers #13":1494, "Stock Tylers #14":359, "Stock Tylers #15":83, "Stock Tylers #16":758, "Stock Tylers #17":825, "Stock Tylers #18":2007, "Stock Tylers #19":532, "Stock Tylers #20":794, "Stock Tylers #21":251, "Stock Tylers #22":599, "Stock Tylers #23":1464, "Stock Tylers #24":2170, "Stock Tylers #25":1756, "Stock Tylers #26":1009, "Stock Tylers #27":1129, "Stock Tylers #28":299, "Stock Tylers #29":420, "Stock Tylers #30":1235, "Stock Tylers #31":485, "Stock Tylers #32":139, "Stock Tylers #33":1207, "Stock Tylers #34":1560, "Stock Tylers #35":381, "Stock Tylers #36":1966, "Stock Tylers #37":1110, "Stock Tylers #38":1916, "Stock Tylers #39":2066, "Stock Tylers #40":1528, "Stock Tylers #41":1202, "Stock Tylers #42":431, "Stock Tylers #43":2091, "Stock Tylers #44":600, "Stock Tylers #45":379, "Stock Tylers #46":1507, "Stock Tylers #47":410, "Stock Tylers #48":1701, "Stock Tylers #49":1760, "Stock Tylers #50":987, "Stock Tylers #51":2212, "Stock Tylers #52":1144, "Stock Tylers #53":1203, "Stock Tylers #54":2222, "Stock Tylers #55":1594, "Stock Tylers #56":671, "Stock Tylers #57":1287, "Stock Tylers #58":472, "Stock Tylers #59":2175, "Stock Tylers #60":1417, "Stock Tylers #61":682, "Stock Tylers #62":1814, "Stock Tylers #63":761, "Stock Tylers #64":2149, "Stock Tylers #65":1521, "Stock Tylers #66":1062, "Stock Tylers #67":1018, "Stock Tylers #68":211, "Stock Tylers #69":2054, "Stock Tylers #70":738, "Stock Tylers #71":1735, "Stock Tylers #72":1035, "Stock Tylers #73":1246, "Stock Tylers #74":817, "Stock Tylers #75":261, "Stock Tylers #76":1058, "Stock Tylers #77":646, "Stock Tylers #78":1278, "Stock Tylers #79":199, "Stock Tylers #80":180, "Stock Tylers #81":14, "Stock Tylers #82":1998, "Stock Tylers #83":1518, "Stock Tylers #84":1881, "Stock Tylers #85":610, "Stock Tylers #86":1178, "Stock Tylers #87":818, "Stock Tylers #88":649, "Stock Tylers #89":2102, "Stock Tylers #90":260, "Stock Tylers #91":1, "Stock Tylers #92":1829, "Stock Tylers #93":798, "Stock Tylers #94":113, "Stock Tylers #95":2100, "Stock Tylers #96":1041, "Stock Tylers #97":1262, "Stock Tylers #98":1120, "Stock Tylers #99":1856, "Stock Tylers #100":690, "Stock Tylers #101":1495, "Stock Tylers #102":140, "Stock Tylers #103":923, "Stock Tylers #104":871, "Stock Tylers #105":918, "Stock Tylers #106":1786, "Stock Tylers #107":935, "Stock Tylers #108":1374, "Stock Tylers #109":978, "Stock Tylers #110":126, "Stock Tylers #111":1775, "Stock Tylers #112":1240, "Stock Tylers #113":1208, "Stock Tylers #114":1023, "Stock Tylers #115":365, "Stock Tylers #116":1841, "Stock Tylers #117":927, "Stock Tylers #118":2035, "Stock Tylers #119":2125, "Stock Tylers #120":560, "Stock Tylers #121":1930, "Stock Tylers #122":243, "Stock Tylers #123":887, "Stock Tylers #124":1893, "Stock Tylers #125":188, "Stock Tylers #126":18, "Stock Tylers #127":1751, "Stock Tylers #128":1592, "Stock Tylers #129":1426, "Stock Tylers #130":1913, "Stock Tylers #131":244, "Stock Tylers #132":1584, "Stock Tylers #133":2026, "Stock Tylers #134":768, "Stock Tylers #135":2113, "Stock Tylers #136":707, "Stock Tylers #137":1540, "Stock Tylers #138":839, "Stock Tylers #139":1232, "Stock Tylers #140":2110, "Stock Tylers #141":2168, "Stock Tylers #142":2068, "Stock Tylers #143":316, "Stock Tylers #144":1219, "Stock Tylers #145":160, "Stock Tylers #146":26, "Stock Tylers #147":1434, "Stock Tylers #148":249, "Stock Tylers #149":638, "Stock Tylers #150":425, "Stock Tylers #151":1059, "Stock Tylers #152":1935, "Stock Tylers #153":1123, "Stock Tylers #154":1552, "Stock Tylers #155":1274, "Stock Tylers #156":475, "Stock Tylers #157":776, "Stock Tylers #158":780, "Stock Tylers #159":2056, "Stock Tylers #160":1069, "Stock Tylers #161":2022, "Stock Tylers #162":163, "Stock Tylers #163":1612, "Stock Tylers #164":1837, "Stock Tylers
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');
});
}
})();