Kahoot Game Finding Loop

The fuk ee dat???!!!!

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Kahoot Game Finding Loop
// @version      0.11
// @description  The fuk ee dat???!!!!
// @author       Mega-Konami
// @license      MIT
// @match        *://kahoot.it/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=kahoot.it
// @namespace kahoot-game-finding-loop-mk-1l2jff
// ==/UserScript==
/* jshint esversion:6 */

(function() {
    var code, btn, inp;
    var el = document.createElement('DIV');
    el.id = 'cds';
    document.body.appendChild(el);
    console.log('Connected!');
    window.addEventListener('load', function() {
        btn = document.querySelector('button.enter-pin-form__SubmitButton-sc-z047z0-1');
        inp = document.querySelector('input#game-input');
        function* CodeGenerator() {
            function rand(min, max) {return Math.floor(Math.random()*(max-min)+min);}
            const chars = '1234567890';
            while (true) {
                var len = 6; code = '';
                for (var i=0;i<6;i++) {
                    code += chars[rand(0,chars.length)];
                }
                var spread = code.split();
                if (spread[0]==='0') {
                    spread[0] = '1';
                    for (i in spread) {
                        code = '';
                        code += spread[i];
                    }
                }
                yield code;
            }
        }
        const gen = CodeGenerator();
        setInterval(function() {
            code = gen.next().value;
            var b = [...code];
            if (parseInt(b[0]) < 7) {
                b[0] = '7';
                code = '';
                for (var i in b) {
                    code += b[i];
                }
            }
            fetch(`https://kahoot.it/reserve/session/${code}/`, {
                method: 'GET'
            }).then(function(res) {
                console.log(typeof res.text());
                if (res.ok||res.status < 400) {
                    var e = document.createElement('SPAN');
                    e.innerHTML = code;
                    document.getElementById('cds').appendChild(e);
                }
            });
        }, 50);
    });
})();