Autokahoot

Automatically move through kahoots - with more power and ease

As of 2021-03-18. See the latest version.

// ==UserScript==
// @name         Autokahoot
// @version      1.4.1
// @description  Automatically move through kahoots - with more power and ease
// @author       codingMASTER398
// @match        https://play.kahoot.it/v2*
// @run-at       document-start
// @grant      none
// @namespace https://greasyfork.org/users/682906
// ==/UserScript==
window.antibotAdditionalScripts = window.antibotAdditionalScripts || [];
window.antibotAdditionalScripts.push(()=>{
    console.log("[AUTOKAHOOT] running")

    window.toInsert = document.createElement("div");
    window.toInsert.innerHTML = "codingMASTER398 - Autokahoot"; //PLEASE DONT CHANGE, THIS IS MY ONLY FORM OF CREDIT ):
    window.toInsert.style.color = 'white'
    window.toInsert.style.position = "absolute";
    window.toInsert.style.bottom = "0px";
    window.toInsert.style.textAlign = "left";
    window.toInsert.style.width = "100%";
    document.body.appendChild(window.toInsert);

    icount=true
    setInterval(function() {
        if(icount==true){
            if(document.getElementsByClassName('flat-button__FlatButton-sc-6uljam-0')[0]){
                if(document.getElementsByClassName('flat-button__FlatButton-sc-6uljam-0')[0].disabled){}else{
                    icount = false
                    counts=16
                    countdown = setInterval(function(){
                        counts--
                        document.getElementsByClassName('flat-button__FlatButton-sc-6uljam-0')[0].innerText = "Start-"+counts
                        if(counts==0 || counts < 0){
                            if(counts < -5){
                                clearTimeout(countdown);
                                icount=true
                                document.getElementsByClassName('flat-button__FlatButton-sc-6uljam-0')[0].innerText = "Start"
                            }else{
                                clearTimeout(countdown);
                                icount=true
                                document.getElementsByClassName('flat-button__FlatButton-sc-6uljam-0')[0].innerText = "Start"
                                document.getElementsByClassName('flat-button__FlatButton-sc-6uljam-0')[0].click();
                            }
                        }
                    }, 1000);
                }
            }
        }
    },1000)
    setInterval(function() {
        if(document.getElementsByClassName('iJqmEC')[0]){
            document.getElementsByClassName('iJqmEC')[0].click();
        }
        if(document.getElementsByClassName('kFPtaw')[0]){
            if(document.getElementsByClassName('kFPtaw')[0].innerHTML=='Next'){
                document.getElementsByClassName('kFPtaw')[0].click();
            }
        }
        if(document.getElementsByClassName('kFPtaw')[0]){
            if(document.getElementsByClassName('kFPtaw')[0].innerText=="Play next" || document.getElementsByClassName('kFPtaw')[0].innerText=="Play again"){
                document.getElementsByClassName('kFPtaw')[0].click();
            }
        }
    },10000)
    setInterval(function() {
        if(document.getElementsByClassName('kxItuK')[0]){
            if(document.getElementsByClassName('kxItuK')[0].innerHTML=='Next'){
                document.getElementsByClassName('kxItuK')[0].click();
            }
        }
    },30000)

    function waitforendportal() {
        a = setInterval(() => {
            if(document.getElementsByClassName('cRHjov')[0]){
                clearInterval(a)
                setTimeout(() => {
                    console.log("Clicking")
                    document.getElementsByClassName('cRHjov')[0].click();
                    setTimeout(() => {
                        document.getElementsByClassName('ghnSPz')[0].click();
                    }, 1000);
                    waitforendportal();
                }, 30000);
            }
        }, 3000);
    }
    waitforendportal();
    ae = setInterval(() => {
        if(document.getElementsByClassName('guhfFk')[0]){
            clearInterval(ae)
            counts=31
            countdown = setInterval(function(){
                counts--
                document.getElementsByClassName('guhfFk')[0].innerText = "Classic - "+counts
                if(counts==0 || counts < 0){
                    clearInterval(countdown);
                    document.getElementsByClassName('guhfFk')[0].click();
                }
            }, 1000);
        }
    }, 3000);
});

if(!window.antibotAdditionalScripts){
    alert("Make sure you have theusaf's antibot on! Autokahoot wont work without it!")
}