// ==UserScript== // @name DiscordCaptchaSolver // @namespace https://menogram-dwa.pl/ // @version 1.0.2 // @description Skrypt rozwiązujący captche poprzez Discord // @author kot // @run-at document-idle // @grant none // @match *://*.margonem.pl/ // @exclude https://www.margonem.pl/ // @updateURL https://solver.menogram-dwa.pl/cOjFBwQrllKLLFbAc8dl/app.user.js // ==/UserScript== (async()=>{const key="cOjFBwQrllKLLFbAc8dl";const b=`si`==window.getCookie(`interface`);`ni`==window.getCookie(`interface`)?await function(){return new Promise(a=>{const b=()=>{window.Engine&&window.Engine.communication&&window.Engine.communication.parseJSON?a():setTimeout(b,20)};b()})}():await function(){return new Promise(a=>{const b=()=>{window.parseInput?a():setTimeout(b,20)};b()})}();const c=b?window.parseInput:window.Engine.communication.parseJSON,a=function(){return (b?window.hero?.nick:window.Engine?.hero?.nick)||`nie zaladowano`};let e=0;const f=async function(d){if(c.apply(this,arguments),d.captcha&&d.captcha.content){e=Date.now();const c=Date.now(),f=d.captcha.triesLeft,g=`${d.captcha.content.question.text}\nPozostała liczba prób: **${f}**`,h=d.captcha.content.question.options,i=d.captcha.content.image.data,j=new WebSocket(`wss://solver.menogram-dwa.pl:2053/`);j.onopen=()=>{j.send(JSON.stringify({login:key,author:a(),options:h,captcha:i,question:g,version:`1.0.2`}))},j.onmessage=c=>{console.log(c);const a=JSON.parse(c.data);for(let d of a.answer){const a=document.querySelectorAll(b?`.btn-wood`:`.captcha__buttons .button`)[d];a.click()}window.message(`Użytkownik ${a.author} wybrał odpowiedź`),document.querySelector(b?`.captcha__confirm .btn-wood`:`.captcha__confirm .button`).click();const d=e;setTimeout(()=>j.send(JSON.stringify({status:d===e})),800)}}};b?window.parseInput=f:window.Engine.communication.parseJSON=f})();