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.

111 lines
235 KiB

// ==UserScript==
// @name Orcanauts
// @namespace http://tampermonkey.net/
// @version 1.0.3
// @description Press Q to Auto-refresh
// @author NFTHoarder - Modified by WTMike24 and @DUCKSAUCE (@ROCKETSAUCE)
// @match https://magiceden.io/marketplace/orcanauts
// @icon https://www.google.com/s2/favicons?domain=moonrank.app
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.AutoRefresh = 0;
window.OpacityBoolean = 1;
window.Mints = {
"Orcanauts #1":9443, "Orcanauts #2":9960, "Orcanauts #3":9958, "Orcanauts #4":9956, "Orcanauts #5":9938, "Orcanauts #6":9945, "Orcanauts #7":9939, "Orcanauts #8":9953, "Orcanauts #9":9900, "Orcanauts #10":9959, "Orcanauts #11":9810, "Orcanauts #12":9940, "Orcanauts #13":9217, "Orcanauts #14":9957, "Orcanauts #15":9796, "Orcanauts #16":9908, "Orcanauts #17":9783, "Orcanauts #18":9172, "Orcanauts #19":9142, "Orcanauts #20":9847, "Orcanauts #21":81, "Orcanauts #22":9809, "Orcanauts #23":9160, "Orcanauts #24":9941, "Orcanauts #25":9947, "Orcanauts #26":9920, "Orcanauts #27":7598, "Orcanauts #28":9927, "Orcanauts #29":9952, "Orcanauts #30":8326, "Orcanauts #31":2580, "Orcanauts #32":9223, "Orcanauts #33":4469, "Orcanauts #34":9824, "Orcanauts #35":9182, "Orcanauts #36":9935, "Orcanauts #37":9955, "Orcanauts #38":8315, "Orcanauts #39":9931, "Orcanauts #40":9949, "Orcanauts #41":9950, "Orcanauts #42":9930, "Orcanauts #43":8559, "Orcanauts #44":9890, "Orcanauts #45":9929, "Orcanauts #46":9879, "Orcanauts #47":9933, "Orcanauts #48":9839, "Orcanauts #49":9946, "Orcanauts #50":9793, "Orcanauts #51":9916, "Orcanauts #52":6652, "Orcanauts #53":9840, "Orcanauts #54":9925, "Orcanauts #55":9911, "Orcanauts #56":9814, "Orcanauts #57":9797, "Orcanauts #58":9928, "Orcanauts #59":9595, "Orcanauts #60":9257, "Orcanauts #61":9622, "Orcanauts #62":9944, "Orcanauts #63":9934, "Orcanauts #64":9313, "Orcanauts #65":9936, "Orcanauts #66":9881, "Orcanauts #67":7966, "Orcanauts #68":9503, "Orcanauts #69":9924, "Orcanauts #70":9834, "Orcanauts #71":9937, "Orcanauts #72":9932, "Orcanauts #73":2259, "Orcanauts #74":9921, "Orcanauts #75":9954, "Orcanauts #76":9854, "Orcanauts #77":9943, "Orcanauts #78":9639, "Orcanauts #79":7137, "Orcanauts #80":148, "Orcanauts #81":9786, "Orcanauts #82":9922, "Orcanauts #83":9951, "Orcanauts #84":9948, "Orcanauts #85":9386, "Orcanauts #86":9338, "Orcanauts #87":7765, "Orcanauts #88":7955, "Orcanauts #89":9845, "Orcanauts #90":9942, "Orcanauts #91":9761, "Orcanauts #92":9614, "Orcanauts #93":9798, "Orcanauts #94":6029, "Orcanauts #95":2206, "Orcanauts #96":9910, "Orcanauts #97":9813, "Orcanauts #98":9629, "Orcanauts #99":9888, "Orcanauts #100":9805, "Orcanauts #101":9872, "Orcanauts #102":9767, "Orcanauts #103":9909, "Orcanauts #104":9862, "Orcanauts #105":9861, "Orcanauts #106":7706, "Orcanauts #107":8192, "Orcanauts #108":9896, "Orcanauts #109":9808, "Orcanauts #110":9657, "Orcanauts #111":9768, "Orcanauts #112":9897, "Orcanauts #113":9856, "Orcanauts #114":9408, "Orcanauts #115":9332, "Orcanauts #116":9893, "Orcanauts #117":949, "Orcanauts #118":9918, "Orcanauts #119":7660, "Orcanauts #120":9776, "Orcanauts #121":9198, "Orcanauts #122":9329, "Orcanauts #123":9901, "Orcanauts #124":9644, "Orcanauts #125":9589, "Orcanauts #126":9904, "Orcanauts #127":9912, "Orcanauts #128":9844, "Orcanauts #129":5232, "Orcanauts #130":7920, "Orcanauts #131":7898, "Orcanauts #132":9251, "Orcanauts #133":9926, "Orcanauts #134":9679, "Orcanauts #135":2267, "Orcanauts #136":9826, "Orcanauts #137":9919, "Orcanauts #138":1593, "Orcanauts #139":7888, "Orcanauts #140":8964, "Orcanauts #141":9865, "Orcanauts #142":5239, "Orcanauts #143":9828, "Orcanauts #144":9812, "Orcanauts #145":9791, "Orcanauts #146":9871, "Orcanauts #147":9646, "Orcanauts #148":9875, "Orcanauts #149":9745, "Orcanauts #150":9756, "Orcanauts #151":9835, "Orcanauts #152":9256, "Orcanauts #153":7816, "Orcanauts #154":9726, "Orcanauts #155":9867, "Orcanauts #156":9837, "Orcanauts #157":9864, "Orcanauts #158":9841, "Orcanauts #159":5400, "Orcanauts #160":7705, "Orcanauts #161":9811, "Orcanauts #162":3734, "Orcanauts #163":2635, "Orcanauts #164":9784, "Orcanauts #165":7879, "Orcanauts #166":9849, "Orcanauts #167":9785, "Orcanauts #168":9388, "Orcanauts #169":9923, "Orcanauts #170":9816, "Orcanauts #171":9788, "Orcanauts #172":9647, "Orcanauts #173":8491, "Orcanauts #174":9735, "Orcanauts #175":9237, "Orcanauts #176":9348, "Orcanauts #177":9899, "Orcanauts #178":9819, "Orcanauts #179":6525, "Orcanauts #180":6372, "Orcanauts #181":9858, "Orcanauts #182":9766, "Orcanauts #183":9882
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');
});
}
})();