javascript:(function()%7B(() %3D> %7B%0A    let n %3D document.createElement('iframe')%3B%0A    document.body.append(n)%3B%0A    window.alert %3D n.contentWindow.alert.bind(window)%3B%0A    window.prompt %3D n.contentWindow.prompt.bind(window)%3B%0A    window.confirm %3D n.contentWindow.confirm.bind(window)%3B%0A    n.remove()%3B%0A%7D)()%3B%0A(() %3D> %7B%0A    let style %3D document.createElement('style')%3B%0A    style.innerHTML %3D (%60details > summary %7B%0A    cursor%3A pointer%3B%0A    transition%3A 0.15s%3B%0A    list-style%3A none%3B%0A%7D%0Adetails > summary%3Ahover %7B%0A    color%3A hsl(0%2C 0%25%2C 50%25)%0A%7D%0Adetails > summary%3A%3A-webkit-details-marker %7B%0A    display%3A none%3B%0A%7D%0Adetails summary ~ * %7B%0A    animation%3A sweep .5s ease-in-out%3B%0A%7D%0A%0A%40keyframes sweep %7B%0A    0%25    %7Bopacity%3A 0%3B transform%3A translateY(-10px)%7D%0A    100%25  %7Bopacity%3A 1%3B transform%3A translateY(0)%7D%0A%7D%0A.cheat %7B%0A    border%3A none%3B%0A    background%3A hsl(0%2C 0%25%2C 20%25)%3B%0A    padding%3A 5px%3B%0A    margin%3A 3px%3B%0A    width%3A 60%25%3B%0A    color%3A hsl(0%2C 0%25%2C 100%25)%3B%0A    transition%3A 0.2s%3B%0A    border-radius%3A 5px%3B%0A    cursor%3A pointer%3B%0A%7D%0A.cheat%3Ahover %7B%0A    background%3A hsl(0%2C 0%25%2C 30%25)%3B%0A%7D%60)%3B%0A%0A    const GUI %3D document.createElement('div')%3B%0A    GUI.appendChild(style)%3B%0A    GUI.style.width %3D '400px'%3B%0A    %2F%2FGUI.style.height %3D '500px'%3B%0A    GUI.style.background %3D 'hsl(0%2C 0%25%2C 10%25)'%3B%0A    GUI.style.borderRadius %3D '10px'%3B%0A    GUI.style.position %3D 'absolute'%3B%0A    GUI.style.textAlign %3D 'center'%3B%0A    GUI.style.fontFamily %3D 'Nunito'%3B%0A    GUI.style.color %3D 'white'%3B%0A    GUI.style.overflow %3D 'hidden'%3B%0A    GUI.style.top %3D '50px'%3B%0A    GUI.style.left %3D '50px'%3B%0A%0A    var pos1 %3D 0%2C pos2 %3D 0%2C pos3 %3D 0%2C pos4 %3D 0%3B%0A    GUI.onmousedown %3D ((e %3D window.event) %3D> %7B%0A        e.preventDefault()%3B%0A        pos3 %3D e.clientX%3B%0A        pos4 %3D e.clientY%3B%0A        document.onmouseup %3D (() %3D> %7B%0A            document.onmouseup %3D null%3B%0A            document.onmousemove %3D null%3B%0A        %7D)%3B%0A        document.onmousemove %3D ((e) %3D> %7B%0A            e %3D e %7C%7C window.event%3B%0A            e.preventDefault()%3B%0A            pos1 %3D pos3 - e.clientX%3B%0A            pos2 %3D pos4 - e.clientY%3B%0A            pos3 %3D e.clientX%3B%0A            pos4 %3D e.clientY%3B%0A            GUI.style.top %3D (GUI.offsetTop - pos2) %2B "px"%3B%0A            GUI.style.left %3D (GUI.offsetLeft - pos1) %2B "px"%3B%0A        %7D)%3B%0A    %7D)%3B%0A%0A    let header %3D document.createElement('div')%3B%0A    GUI.appendChild(header)%3B%0A    header.style.width %3D '100%25'%3B%0A    header.style.height %3D '35px'%3B%0A    header.style.paddingTop %3D '2px'%3B%0A    header.style.fontSize %3D '1.5rem'%3B%0A    header.style.textAlign %3D 'center'%0A    header.innerHTML %3D %60Blooket Cheats <span style%3D"font-size%3A 0.75rem">v4.10.22<%2Fspan>%60%3B%0A%0A    let loop%3B%0A%0A    let close %3D document.createElement('button')%3B%0A    header.appendChild(close)%3B%0A    close.style.background %3D 'red'%3B%0A    close.style.height %3D '45px'%3B%0A    close.style.width %3D '45px'%3B%0A    close.style.border %3D 'none'%3B%0A    close.style.cursor %3D 'pointer'%3B%0A    close.style.position %3D 'absolute'%3B%0A    close.style.top %3D '-10px'%3B%0A    close.style.right %3D '-10px'%3B%0A    close.style.fontSize %3D '1.5rem'%3B%0A    close.style.borderRadius %3D '10px'%3B%0A    close.style.fontFamily %3D 'Nunito'%3B%0A    close.style.fontWeight %3D 'bolder'%3B%0A    close.style.paddingTop %3D '10px'%3B%0A    close.style.paddingRight %3D '15px'%3B%0A    close.innerText %3D 'X'%3B%0A    close.onclick %3D () %3D> %7B%0A        GUI.remove()%3B%0A        clearInterval(loop)%3B%0A        removeEventListener('keypress'%2C toggleHidden)%0A    %7D%0A%0A    let minimize %3D document.createElement('button')%3B%0A    header.appendChild(minimize)%3B%0A    minimize.style.background %3D '%23444444'%3B%0A    minimize.style.height %3D '45px'%3B%0A    minimize.style.width %3D '45px'%3B%0A    minimize.style.border %3D 'none'%3B%0A    minimize.style.cursor %3D 'pointer'%3B%0A    minimize.style.position %3D 'absolute'%3B%0A    minimize.style.top %3D '-10px'%3B%0A    minimize.style.left %3D '-10px'%3B%0A    minimize.style.fontSize %3D '1.5rem'%3B%0A    minimize.style.borderRadius %3D '10px'%3B%0A    minimize.style.fontFamily %3D 'Nunito'%3B%0A    minimize.style.fontWeight %3D 'bolder'%3B%0A    minimize.style.paddingTop %3D '10px'%3B%0A    minimize.style.paddingLeft %3D '15px'%3B%0A    minimize.innerText %3D '-'%3B%0A    minimize.onclick %3D () %3D> %7B%0A        bodyDiv.hidden %3D !bodyDiv.hidden%3B%0A    %7D%0A    let bodyDiv %3D document.createElement('div')%3B%0A    let body %3D document.createElement('div')%3B%0A    bodyDiv.appendChild(body)%3B%0A    GUI.appendChild(bodyDiv)%3B%0A%0A    body.innerHTML %3D (%60<span id%3D"curPageEl">%24%7BgetSite(true) %3F %60Current gamemode%3A %24%7BgetSite(true)%7D%60 %3A 'No game detected'%7D<%2Fspan><br><span>(Press E to hide)<%2Fspan><br>%60)%3B%0A    body.style.display %3D 'block'%3B%0A    body.style.margin %3D '10px'%3B%0A    %2F%2Fbody.style.background %3D 'white'%3B%0A    body.style.minHeight %3D '70px'%3B%0A%0A    let activeCheats %3D document.createElement('span')%3B%0A    body.appendChild(activeCheats)%3B%0A%0A    document.body.append(GUI)%3B%0A%0A    let footer %3D document.createElement('div')%3B%0A    bodyDiv.appendChild(footer)%3B%0A    footer.style.fontSize %3D '0.9rem'%3B%0A    footer.style.paddingBottom %3D '5px'%3B%0A    footer.innerHTML %3D (%60<span>Github Repo by SkyeGamesYT<br>Cheats by <a style%3D"color%3A lightblue" href%3D"https%3A%2F%2Fgithub.com%2FSkyeGamesYT%2FBookmarklets">Github<%2Fa><%2Fspan>%60)%3B%0A%0A    var getValues %3D () %3D> new Promise((e%2C t) %3D> %7B%0A        try %7B%0A            let n %3D window.webpackJsonp.map(e %3D> Object.keys(e%5B1%5D).map(t %3D> e%5B1%5D%5Bt%5D)).reduce((e%2C t) %3D> %5B...e%2C ...t%5D%2C %5B%5D).find(e %3D> %2F%5Cw%7B8%7D-%5Cw%7B4%7D-%5Cw%7B4%7D-%5Cw%7B4%7D-%5Cw%7B12%7D%2F.test(e.toString()) %26%26 %2F%5C(new TextEncoder%5C)%5C.encode%5C(%5C"(.%2B%3F)%5C"%5C)%2F.test(e.toString())).toString()%3B%0A            e(%7B%0A                blooketBuild%3A n.match(%2F%5Cw%7B8%7D-%5Cw%7B4%7D-%5Cw%7B4%7D-%5Cw%7B4%7D-%5Cw%7B12%7D%2F)%5B0%5D%2C%0A                secret%3A n.match(%2F%5C(new TextEncoder%5C)%5C.encode%5C(%5C"(.%2B%3F)%5C"%5C)%2F)%5B1%5D%0A            %7D)%0A        %7D catch %7B%0A            t("Could not fetch auth details")%0A        %7D%0A    %7D)%0A    var encodeValues %3D async (e%2C t) %3D> %7B%0A        let d %3D window.crypto.getRandomValues(new Uint8Array(12))%3B%0A        return window.btoa(Array.from(d).map(e %3D> String.fromCharCode(e)).join("") %2B Array.from(new Uint8Array(await window.crypto.subtle.encrypt(%7B%0A            name%3A "AES-GCM"%2C%0A            iv%3A d%0A        %7D%2C await window.crypto.subtle.importKey("raw"%2C await window.crypto.subtle.digest("SHA-256"%2C (new TextEncoder).encode(t))%2C %7B%0A            name%3A "AES-GCM"%0A        %7D%2C !1%2C %5B"encrypt"%5D)%2C (new TextEncoder).encode(JSON.stringify(e))))).map(e %3D> String.fromCharCode(e)).join(""))%0A    %7D%3B%0A%0A    function reactHandler() %7B%0A        return Object.values(document.querySelector('%23app > div > div'))%5B1%5D.children%5B1%5D._owner%3B%0A    %7D%0A%0A    let autoAnswer%2C highlightAnswers%2C choiceESP%2C autoPassword%2C chestESP%3B%0A%0A    let cheats %3D %7B%0A        global%3A %7B%0A            'Get Daily Rewards'%3A () %3D> %7B%0A                fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers"%2C %7B credentials%3A "include" %7D).then(x %3D> x.json()).then(x %3D> %7B%0A                    getValues().then(async e %3D> %7B%0A                        fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers%2Fadd-rewards"%2C %7B%0A                            method%3A "put"%2C%0A                            credentials%3A "include"%2C%0A                            headers%3A %7B%0A                                "content-type"%3A "application%2Fjson"%2C%0A                                "X-Blooket-Build"%3A e.blooketBuild%0A                            %7D%2C%0A                            body%3A await encodeValues(%7B%0A                                name%3A x.name%2C%0A                                addedTokens%3A 250%2C%0A                                addedXp%3A 300%0A                            %7D%2C e.secret)%0A                        %7D)%3B%0A                        fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers%2Fadd-rewards"%2C %7B%0A                            method%3A "put"%2C%0A                            credentials%3A "include"%2C%0A                            headers%3A %7B%0A                                "content-type"%3A "application%2Fjson"%2C%0A                                "X-Blooket-Build"%3A e.blooketBuild%0A                            %7D%2C%0A                            body%3A await encodeValues(%7B%0A                                name%3A x.name%2C%0A                                addedTokens%3A 250%2C%0A                                addedXp%3A 300%0A                            %7D%2C e.secret)%0A                        %7D).then(() %3D> alert('Added daily rewawrds!')).catch(() %3D> alert('There was an error when adding rewards!'))%3B%3B%0A                    %7D).catch(() %3D> alert('There was an error encoding requests!'))%3B%0A                %7D).catch(() %3D> alert('There was an error getting username!'))%3B%0A            %7D%2C%0A            'Spoof Blooks'%3A () %3D> %7B%0A                if (!window.location.pathname.split('%2F').includes('lobby')) return alert('You must be in a game lobby! (e.g. https%3A%2F%2Fwww.blooket.com%2Fplay%2Flobby)')%3B%0A                reactHandler().stateNode.setState(%7B lockedBlooks%3A %5B%5D%2C takenBlooks%3A %5B%5D %7D)%3B%0A            %7D%2C%0A            'Toggle Auto Answer'%3A () %3D> %7B autoAnswer %3D !autoAnswer %7D%2C%0A            'Toggle Highlight Answers'%3A () %3D> %7B highlightAnswers %3D !highlightAnswers %7D%2C%0A            'Spam Open Boxes'%3A () %3D> %7B%0A                let box %3D prompt(%60Which box do you want to open%3F (e.g. Space)%60)%3B%0A                let boxes %3D %7B%0A                    safari%3A 25%2C%0A                    aquatic%3A 20%2C%0A                    bot%3A 20%2C%0A                    space%3A 20%2C%0A                    breakfast%3A 15%2C%0A                    medieval%3A 15%2C%0A                    wonderland%3A 15%0A                %7D%0A                if (!Object.keys(boxes).includes(box.toLowerCase())) return alert('I could not find that box!')%3B%0A                let amount %3D prompt('How many boxes do you want to open%3F')%3B%0A                fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers"%2C %7B credentials%3A "include" %7D).then(x %3D> x.json()).then(x %3D> %7B%0A                    if (x.tokens < boxes%5Bbox.toLowerCase()%5D * amount) amount %3D Math.floor(x.tokens %2F boxes%5Bbox.toLowerCase()%5D)%3B%0A                    if (!amount) return alert('You do not have enough tokens!')%3B%0A                    let wait %3D ms %3D> new Promise(r %3D> setTimeout(r%2C ms))%3B%0A                    getValues().then(async e %3D> %7B%0A                        let error %3D false%2C%0A                            blooks %3D %5B%5D%3B%0A                        for (let i %3D 0%3B i < amount%3B i%2B%2B) %7B%0A                            fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers%2Funlockblook"%2C %7B%0A                                method%3A "put"%2C%0A                                credentials%3A "include"%2C%0A                                headers%3A %7B%0A                                    "content-type"%3A "application%2Fjson"%2C%0A                                    "X-Blooket-Build"%3A e.blooketBuild%0A                                %7D%2C%0A                                body%3A await encodeValues(%7B%0A                                    name%3A x.name%2C%0A                                    box%3A box.charAt(0).toUpperCase() %2B box.slice(1).toLowerCase()%0A                                %7D%2C e.secret)%0A                            %7D).then(async x %3D> %7B%0A                                let blook %3D await x.json()%3B%0A                                blooks.push(blook.unlockedBlook)%3B%0A                                alert(%60%24%7Bblook.unlockedBlook%7D (%24%7Bi %2B 1%7D%2F%24%7Bamount%7D)%60)%3B%0A                            %7D).catch(() %3D> %7B error %3D true %7D)%3B%0A                            await wait(750)%3B%0A                            if (error) break%3B%0A                        %7D%0A                        let count %3D %7B%7D%3B%0A                        blooks.forEach(blook %3D> %7B count%5Bblook%5D %3D (count%5Bblook%5D %7C%7C 0) %2B 1 %7D)%3B%0A                        alert(%60Results%3A%5Cn%60 %2B Object.entries(count).map((x) %3D> %60    %24%7Bx%5B1%5D%7D %24%7Bx%5B0%5D%7D%60).join(%60%5Cn%60))%3B%0A                    %7D).catch(() %3D> alert('There was an error encoding requests!'))%3B%0A                %7D).catch(() %3D> alert('There was an error getting username!'))%3B%0A            %7D%2C%0A            'Auto Sell Dupes'%3A () %3D> %7B%0A                fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers"%2C %7B credentials%3A "include" %7D).then(x %3D> x.json()).then(x %3D> %7B%0A                    let blooks %3D Object.entries(x.unlocks).map(x %3D> %5Bx%5B0%5D%2C x%5B1%5D - 1%5D).filter(x %3D> x%5B1%5D > 0)%3B%0A                    let wait %3D ms %3D> new Promise(r %3D> setTimeout(r%2C ms))%3B%0A                    getValues().then(async e %3D> %7B%0A                        let error %3D false%3B%0A                        alert('Selling duplicate blooks%2C please wait')%3B%0A                        for (let %5Bblook%2C numSold%5D of blooks) %7B%0A                            fetch("https%3A%2F%2Fapi.blooket.com%2Fapi%2Fusers%2Fsellblook"%2C %7B%0A                                method%3A "put"%2C%0A                                credentials%3A "include"%2C%0A                                headers%3A %7B%0A                                    "content-type"%3A "application%2Fjson"%2C%0A                                    "X-Blooket-Build"%3A e.blooketBuild%0A                                %7D%2C%0A                                body%3A await encodeValues(%7B%0A                                    name%3A x.name%2C%0A                                    blook%2C%0A                                    numSold%0A                                %7D%2C e.secret)%0A                            %7D).catch(() %3D> %7B error %3D true %7D)%3B%0A                            await wait(750)%3B%0A                            if (error) break%3B%0A                        %7D%0A                        alert(%60Results%3A%5Cn%60 %2B blooks.map((x) %3D> %60    %24%7Bx%5B1%5D%7D %24%7Bx%5B0%5D%7D%60).join(%60%5Cn%60))%3B%0A                    %7D).catch(() %3D> alert('There was an error encoding requests!'))%3B%0A                %7D).catch(() %3D> alert('There was an error getting user data!'))%3B%0A            %7D%0A        %7D%2C%0A        cafe%3A %7B%0A            'Infinite Food'%3A () %3D> %7B%0A                if (document.location.pathname !%3D "%2Fcafe") return alert("This cheat doesn't work in the shop!")%3B%0A                reactHandler().stateNode.state.foods.forEach(e %3D> e.stock %3D 99999)%3B%0A                reactHandler().stateNode.forceUpdate()%3B%0A            %7D%2C%0A            'Max Levels'%3A () %3D> %7B%0A                if (document.location.pathname !%3D "%2Fcafe%2Fshop") return alert("This cheat only works in the shop!")%3B%0A                Object.keys(reactHandler().stateNode.state.items).forEach(x %3D> reactHandler().stateNode.state.items%5Bx%5D %3D 5)%3B%0A                reactHandler().stateNode.forceUpdate()%3B%0A            %7D%2C%0A            'Set Cash'%3A () %3D> %7B%0A                reactHandler().stateNode.setState(%7B cafeCash%3A Number(parseFloat(prompt('How much cash would you like%3F'))) %7D)%3B%0A            %7D%2C%0A            'Reset Abilities'%3A () %3D> %7B%0A                Object.keys(reactHandler().stateNode.state.abilities).forEach(x %3D> reactHandler().stateNode.state.abilities%5Bx%5D %3D 5)%3B%0A                reactHandler().stateNode.forceUpdate()%3B%0A            %7D%0A        %7D%2C%0A        kingdom%3A %7B%0A            'Choice ESP'%3A () %3D> %7B choiceESP %3D !choiceESP %7D%2C%0A            'Max Stats'%3A () %3D> %7B%0A                reactHandler().stateNode.setState(%7B materials%3A 100%2C people%3A 100%2C happiness%3A 100%2C gold%3A 100 %7D)%3B%0A            %7D%2C%0A            'Disable Toucan'%3A () %3D> %7B%0A                reactHandler().stateNode.taxCounter %3D Number.MAX_VALUE%3B%0A            %7D%2C%0A            'Set Guests'%3A () %3D> %7B%0A                let guestScore %3D Number(parseFloat(prompt('How many guests do you want%3F')))%3B%0A                reactHandler().stateNode.setState(%7B guestScore %7D)%3B%0A            %7D%2C%0A            'Skip Guest'%3A () %3D> %7B%0A                reactHandler().stateNode.nextGuest()%3B%0A            %7D%0A        %7D%2C%0A        crypto%3A %7B%0A            'Auto Hack'%3A () %3D> %7B autoPassword %3D !autoPassword %7D%2C%0A            'Set Crypto'%3A () %3D> %7B%0A                let amount %3D Number(parseFloat(prompt('How much crypto do you want%3F')))%3B%0A                reactHandler().stateNode.setState(%7B crypto2%3A amount%2C crypto%3A amount %7D)%3B%0A            %7D%2C%0A            'Custom Password'%3A () %3D> %7B%0A                let password %3D Number(parseFloat(prompt('What do you want to set your password to%3F')))%3B%0A                reactHandler().stateNode.setState(%7B password %7D)%3B%0A            %7D%2C%0A            'Remove Hack'%3A () %3D> %7B%0A                reactHandler().stateNode.setState(%7B hack%3A '' %7D)%0A            %7D%2C%0A            'Reset Player%5C's Crypto'%3A () %3D> %7B%0A                let target %3D prompt("Name of player")%3B%0A                let e %3D reactHandler()%3B%0A                !target %7C%7C e.memoizedProps.firebase.getDatabaseVal(e.memoizedProps.client.hostId%2C "c"%2C (...o) %3D> %7B%0A                    let data %3D Object.keys(o%5B0%5D)%3B%0A                    if (data.some(e %3D> e %3D%3D target)) data.forEach(player %3D> %7B%0A                        if (player %3D%3D target) %7B%0A                            e.memoizedProps.firebase.setVal(%7B%0A                                id%3A e.memoizedProps.client.hostId%2C%0A                                path%3A "c%2F" %2B e.memoizedProps.client.name%2C%0A                                val%3A %7B%0A                                    p%3A e.stateNode.state.password%2C%0A                                    b%3A e.memoizedProps.client.blook%2C%0A                                    cr%3A e.stateNode.state.crypto%2C%0A                                    tat%3A player %2B "%3A" %2B (o%5B0%5D%5Bplayer%5D.cr %7C%7C 0)%0A                                %7D%0A                            %7D)%3B alert('Reset player%5C's crypto')%0A                        %7D%3B%0A                    %7D)%3B%0A                    else alert("Player does not exist")%3B%0A                %7D)%0A            %7D%0A        %7D%2C%0A        factory%3A %7B%0A            'All Mega Bot'%3A () %3D> %7B%0A                let blooks %3D %5B0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%5D.fill(%7B name%3A "Mega Bot"%2C color%3A "%23d71f27"%2C class%3A "%F0%9F%A4%96"%2C rarity%3A "Legendary"%2C cash%3A %5B80000%2C 430000%2C 4200000%2C 62000000%2C 1000000000%5D%2C time%3A %5B5%2C 5%2C 3%2C 3%2C 3%5D%2C price%3A %5B7000000%2C 120000000%2C 1900000000%2C 35000000000%5D%2C active%3A false%2C level%3A 4%2C bonus%3A 5.5 %7D)%0A                reactHandler().stateNode.setState(%7B blooks %7D)%3B%0A            %7D%2C%0A            'Remove Glitches'%3A () %3D> %7B%0A                reactHandler().stateNode.setState(%7B%0A                    glitch%3A ""%2C%0A                    bites%3A 0%2C%0A                    ads%3A %5B0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%2C 0%5D%2C%0A                    hazards%3A %5B""%2C ""%2C ""%2C ""%2C ""%5D%2C%0A                    lol%3A false%2C%0A                    joke%3A false%2C%0A                    slow%3A false%2C%0A                    dance%3A false%2C%0A                    popUpAmount%3A 0%2C%0A                %7D)%3B%0A            %7D%2C%0A            'Max Blooks'%3A () %3D> %7B%0A                reactHandler().stateNode.state.blooks.forEach(blook %3D> %7B blook.level %3D 4 %7D)%3B%0A            %7D%2C%0A            'Set Cash'%3A () %3D> %7B%0A                let cash %3D Number(parseFloat(prompt('How much cash do you want%3F')))%3B%0A                reactHandler().stateNode.setState(%7B cash %7D)%3B%0A            %7D%2C%0A        %7D%2C%0A        fishing%3A %7B%0A            'Set Weight'%3A () %3D> %7B%0A                let weight %3D Number(parseFloat(prompt('How much weight do you want%3F')))%3B%0A                reactHandler().stateNode.setState(%7B weight2%3A weight%2C weight %7D)%3B%0A            %7D%2C%0A            'Set Lure'%3A () %3D> %7B%0A                let lure %3D Number(parseFloat(prompt('What do you want to set your lure to%3F (1 - 5)'))) - 1%3B%0A                reactHandler().stateNode.setState(%7B lure%3A lure < 0 %3F 0 %3A lure > 4 %3F 4 %3A lure %7D)%3B%0A            %7D%0A        %7D%2C%0A        gold%3A %7B%0A            'Set Gold'%3A () %3D> %7B%0A                let gold %3D Number(parseFloat(prompt('How much gold do you want%3F')))%3B%0A                reactHandler().stateNode.setState(%7B gold2%3A gold%2C gold %7D)%3B%0A            %7D%2C%0A            'Chest ESP'%3A () %3D> %7B chestESP %3D !chestESP %7D%2C%0A            "Set Player's Gold"%3A () %3D> %7B%0A                let e %3D reactHandler()%2C%0A                    player %3D prompt("Player to set gold")%2C%0A                    amount %3D Number(parseFloat(prompt("Amount to set gold to")))%3B%0A                e.memoizedProps.firebase.setVal(%7B%0A                    id%3A e.memoizedProps.client.hostId%2C%0A                    path%3A "c%2F" %2B e.memoizedProps.client.name%2C%0A                    val%3A %7B%0A                        b%3A e.memoizedProps.client.blook%2C%0A                        g%3A e.stateNode.state.gold%2C%0A                        tat%3A player %2B "%3Aswap%3A" %2B amount%0A                    %7D%0A                %7D)%0A            %7D%0A        %7D%2C%0A        racing%3A %7B%0A            'Instant Win'%3A () %3D> %7B%0A                reactHandler().stateNode.setState(%7B progress%3A reactHandler().stateNode.state.goalAmount %7D)%3B%0A                setTimeout(() %3D> %7B%0A                    try %7B%0A                        Array.from(document.body.querySelectorAll('div%5Bclass*%3D"answerText"%5D')).filter(t %3D> t.firstChild.innerHTML %3D%3D reactHandler().memoizedState.question.correctAnswers%5B0%5D)%5B0%5D.click()%3B%0A                    %7D catch %7B%0A                        try %7B%0A                            Array.from(document.body.querySelectorAll('div%5Bclass*%3D"answerText"%5D')).filter(t %3D> t.firstChild.innerHTML %3D%3D reactHandler().memoizedProps.client.question.correctAnswers%5B0%5D)%5B0%5D.click()%3B%0A                        %7D catch %7B %7D%3B%0A                    %7D%3B%0A                %7D%2C 100)%3B%0A            %7D%0A        %7D%2C%0A        defense%3A %7B%0A            'Clear Enemies'%3A () %3D> %7B%0A                reactHandler().stateNode.enemies %3D %5B%5D%3B%0A            %7D%2C%0A            'Max Towers'%3A () %3D> %7B%0A                reactHandler().stateNode.towers.forEach(tower %3D> %7B%0A                    tower.damage %3D 99999999%3B%0A                    tower.range %3D 99999999%3B%0A                    tower.fullCd %3D 0%3B%0A                %7D)%3B%0A            %7D%2C%0A            'Remove Ducks'%3A () %3D> %7B%0A                data %3D reactHandler().stateNode%3B%0A                data.ducks.forEach(x %3D> %7B data.tiles%5Bx.y%5D%5Bx.x%5D %3D 0%3B %7D)%3B%0A                data.ducks.length %3D 0%3B%0A            %7D%2C%0A            'Place Towers Anywhere'%3A () %3D> %7B%0A                reactHandler().stateNode.tiles %3D reactHandler().stateNode.tiles.map(x %3D> x.map(e %3D> e %3D%3D 2 %3F 0 %3A e))%3B%0A            %7D%2C%0A            'Set Damage'%3A () %3D> %7B%0A                let dmg %3D Number(parseFloat(prompt('How much damage do you want%3F')))%3B%0A                reactHandler().stateNode.dmg %3D dmg%3B%0A            %7D%2C%0A            'Set Round'%3A () %3D> %7B%0A                let round %3D Number(parseFloat(prompt('What round do you want to set it to%3F')))%3B%0A                reactHandler().stateNode.setState(%7B round %7D)%3B%0A            %7D%2C%0A            'Set Tokens'%3A () %3D> %7B%0A                let tokens %3D Number(parseFloat(prompt('How many tokens do you want%3F')))%3B%0A                reactHandler().stateNode.setState(%7B tokens %7D)%3B%0A            %7D%0A        %7D%2C%0A        doom%3A %7B%0A            'Set Coins'%3A () %3D> %7B%0A                try %7B%0A                    reactHandler().stateNode.props.setTowerCoins(Number(parseFloat(prompt('How many coins do you want%3F'))))%3B%0A                %7D catch %7B %7D%0A            %7D%2C%0A            'Lower Enemy Stats'%3A () %3D> %7B%0A                let data %3D reactHandler().stateNode.state%3B%0A                if (data.phase !%3D 'select') return alert('You must be on the attribute selection page!')%3B%0A                reactHandler().stateNode.setState(%7B enemyCard%3A %7B ...data.enemyCard%2C strength%3A 0%2C charisma%3A 0%2C wisdom%3A 0 %7D %7D)%0A            %7D%2C%0A            'Max Player Stats'%3A () %3D> %7B%0A                let data %3D reactHandler().stateNode.state%3B%0A                if (data.phase !%3D 'select') return alert('You must be on the attribute selection page!')%3B%0A                reactHandler().stateNode.setState(%7B myCard%3A %7B ...data.myCard%2C strength%3A 20%2C charisma%3A 20%2C wisdom%3A 20 %7D %7D)%0A            %7D%2C%0A            'Heal Player'%3A () %3D> %7B%0A                reactHandler().stateNode.setState(%7B myLife%3A 100 %7D)%3B%0A            %7D%0A        %7D%2C%0A        rush%3A %7B%0A            'Set Defense'%3A () %3D> %7B%0A                let e %3D reactHandler()%3B%0A                e.stateNode.props.firebase.setVal(%7B%0A                    id%3A e.stateNode.props.client.hostId%2C%0A                    path%3A 'c%2F' %2B e.stateNode.props.client.name %2B '%2Fd'%2C%0A                    val%3A Number(parseFloat(prompt('How much defense do you want%3F')))%0A                %7D)%3B%0A            %7D%2C%0A            'Set Blooks'%3A () %3D> %7B%0A                let e %3D reactHandler()%3B%0A                e.stateNode.props.firebase.setVal(%7B%0A                    id%3A e.stateNode.props.client.hostId%2C%0A                    path%3A 'c%2F' %2B e.stateNode.props.client.name %2B '%2Fbs'%2C%0A                    val%3A Number(parseFloat(prompt('How many blooks do you want%3F')))%0A                %7D)%3B%0A            %7D%0A        %7D%0A    %7D%3B%0A%0A    let global %3D document.createElement('details')%3B%0A    global.innerHTML %3D (%60<summary style%3D"padding%3A 10px%3B font-size%3A 1.5em%3B font-weight%3A bolder">Global<%2Fsummary>%60)%3B%0A    for (var i %3D 0%3B i < Object.keys(cheats.global).length%3B i%2B%2B) %7B%0A        let cheat %3D createButton(Object.keys(cheats.global)%5Bi%5D)%3B%0A        cheat.onclick %3D cheats.global%5BObject.keys(cheats.global)%5Bi%5D%5D%3B%0A        global.appendChild(cheat)%3B%0A    %7D%0A    global.open %3D true%3B%0A    global.style.paddingBottom %3D '10px'%3B%0A    body.appendChild(global)%3B%0A%0A    let cheatDiv %3D document.createElement('div')%3B%0A    body.appendChild(cheatDiv)%3B%0A%0A    loop %3D setInterval(() %3D> %7B%0A        if (curPage !%3D getSite()) %7B%0A            curPage %3D getSite()%3B%0A            curPageEl.innerText %3D getSite(true) %3F %60Current gamemode%3A %24%7BgetSite(true)%7D%60 %3A 'No game detected'%0A            Array.from(cheatDiv.children).forEach(x %3D> x.remove())%3B%0A            if (curPage %26%26 cheats%5BcurPage%5D) Object.keys(cheats%5BcurPage%5D).forEach(cheat %3D> %7B%0A                let button %3D createButton(cheat)%3B%0A                button.onclick %3D cheats%5BcurPage%5D%5Bcheat%5D%3B%0A                cheatDiv.appendChild(button)%3B%0A                cheatDiv.appendChild(document.createElement('br'))%3B%0A            %7D)%0A        %7D%3B%0A        let activeCheatsText %3D (%60Auto Answer%3A %24%7BautoAnswer %3F 'Enabled' %3A 'Disabled'%7D%5CnHighlight Answers%3A %24%7BhighlightAnswers %3F 'Enabled' %3A 'Disabled'%7D%24%7BcurPage %3D%3D 'kingdom' %3F %60%5CnChoice ESP%3A %24%7BchoiceESP %3F 'Enabled' %3A 'Disabled'%7D%60 %3A curPage %3D%3D 'crypto' %3F %60%5CnAuto Hack%3A %24%7BautoPassword %3F 'Enabled' %3A 'Disabled'%7D%60 %3A curPage %3D%3D 'gold' %3F %60%5CnChest ESP%3A %24%7BchestESP %3F 'Enabled' %3A 'Disabled'%7D%60 %3A ''%7D%60)%3B%0A        activeCheats.innerText !%3D activeCheatsText %26%26 (activeCheats.innerText %3D activeCheatsText)%3B%0A        if (autoAnswer) %7B%0A            try %7B%0A                Array.from(document.body.querySelectorAll('div%5Bclass*%3D"answerText"%5D')).filter(t %3D> t.firstChild.innerHTML %3D%3D reactHandler().memoizedState.question.correctAnswers%5B0%5D)%5B0%5D.click()%3B%0A            %7D catch %7B%0A                try %7B%0A                    Array.from(document.body.querySelectorAll('div%5Bclass*%3D"answerText"%5D')).filter(t %3D> t.firstChild.innerHTML %3D%3D reactHandler().memoizedProps.client.question.correctAnswers%5B0%5D)%5B0%5D.click()%3B%0A                %7D catch %7B %7D%3B%0A            %7D%3B%0A        %7D%3B%0A        if (highlightAnswers) %7B%0A            try %7B%0A                Array.from(document.querySelector('div%5Bclass*%3D"answersHolder"').children).forEach(x %3D> %7B%0A                    if (reactHandler().memoizedState.question.correctAnswers.includes(x.innerText) %7C%7C reactHandler().memoizedProps.client.question.correctAnswers.includes(x.innerText)) x.firstChild.style %3D 'background-color%3A rgb(0%2C 207%2C 119)%3B'%3B%0A                    else x.firstChild.style %3D 'background-color%3A rgb(225%2C 40%2C 33)%3B'%3B%0A                %7D)%3B%0A            %7D catch %7B %7D%0A        %7D%3B%0A        if (curPage %3D%3D 'kingdom') %7B%0A            Array.from(document.getElementsByClassName('choiceESP')).forEach(x %3D> x.remove())%0A            if (choiceESP) %7B%0A                try %7B%0A                    let elements %3D %7B%0A                        materials%3A Array.from(document.querySelectorAll('div')).find(x %3D> Array.from(x.children).find(e %3D> e.className.includes('tree')))%2C%0A                        people%3A Array.from(document.querySelectorAll('div')).find(x %3D> Array.from(x.children).find(e %3D> e.className.includes('users') %26%26 e.parentElement.className.includes('statContainer')))%2C%0A                        happiness%3A Array.from(document.querySelectorAll('div')).find(x %3D> Array.from(x.children).find(e %3D> e.className.includes('grin')))%2C%0A                        gold%3A Array.from(document.querySelectorAll('div')).find(x %3D> Array.from(x.children).find(e %3D> e.className.includes('coins')))%0A                    %7D%0A                    let data %3D reactHandler().stateNode.state.guest%3B%0A                    Object.entries(data.yes).forEach(x %3D> %7B%0A                        if (x%5B0%5D %3D%3D 'msg') return%3B%0A                        let element %3D document.createElement('div')%3B%0A                        element.className %3D 'choiceESP'%3B%0A                        element.style %3D 'font-size%3A 24px%3B color%3A rgb(75%2C 194%2C 46)%3B font-weight%3A bolder%3B'%3B%0A                        element.innerText %3D String(x%5B1%5D)%0A                        elements%5Bx%5B0%5D%5D.appendChild(element)%3B%0A                    %7D)%0A                    Object.entries(data.no).forEach(x %3D> %7B%0A                        if (x%5B0%5D %3D%3D 'msg') return%3B%0A                        let element %3D document.createElement('div')%3B%0A                        element.className %3D 'choiceESP'%3B%0A                        element.style %3D 'font-size%3A 24px%3B color%3A darkred%3B font-weight%3A bolder%3B'%3B%0A                        element.innerText %3D String(x%5B1%5D)%0A                        elements%5Bx%5B0%5D%5D.appendChild(element)%3B%0A                    %7D)%0A                %7D catch (e) %7B %7D%0A            %7D%3B%0A        %7D%0A        if (curPage %3D%3D 'crypto' %26%26 autoPassword) %7B%0A            let %7B stage%2C correctPassword %7D %3D Object.values(document.querySelector('%23app > div > div'))%5B1%5D.children%5B1%5D._owner.stateNode.state%3B%0A            if (stage %3D%3D "hack") Array.from(document.querySelectorAll('div')).filter(x %3D> x.innerHTML %3D%3D correctPassword)%5B0%5D.click()%3B%0A        %7D%3B%0A        if (curPage %3D%3D 'gold' %26%26 chestESP) %7B%0A            try %7B%0A                if (reactHandler().stateNode.state.stage %3D%3D 'prize') %7B%0A                    let %7B choices %7D %3D reactHandler().stateNode.state%3B%0A                    let div %3D document.querySelector("div%5Bclass*%3D'regularBody'%5D").children%5B1%5D%3B%0A                    if (div) %7B%0A                        if (!document.querySelectorAll(".chest-esp").length) choices.forEach((box%2C i) %3D> %7B%0A                            textElement %3D document.createElement('p')%3B%0A                            textElement.className %3D "chest-esp"%3B%0A                            textElement.innerText %3D box.text%3B%0A                            textElement.style %3D %60text-align%3A center%3B%0A                    font-size%3A 30px%3B%0A                    color%3A white%3B%0A                    font-family%3ATitan One%3B%0A                    sans-serif%3B%0A                    border-color%3A black%3B%0A                    margin-top%3A 200px%3B%60%0A                            try %7B div.children%5Bi%5D.appendChild(textElement)%3B %7D catch (e) %7B console.log(e) %7D%0A                        %7D)%3B%0A                        else choices.forEach((box%2C i) %3D> %7B%0A                            if (div.children.length %3D%3D 3 %26%26 div.children%5Bi%5D.children%5B1%5D.innerText !%3D box.text) div.children%5Bi%5D.children%5B1%5D.innerText %3D box.text%3B%0A                        %7D)%0A                    %7D%0A                %7D%0A            %7D catch (e) %7B console.log(e) %7D%0A        %7D%3B%0A    %7D)%3B%0A%0A    let curPage %3D getSite()%3B%0A    if (curPage %26%26 cheats%5BcurPage%5D) Object.keys(cheats%5BcurPage%5D).forEach(cheat %3D> %7B%0A        let button %3D createButton(cheat)%3B%0A        button.onclick %3D cheats%5BcurPage%5D%5Bcheat%5D%3B%0A        cheatDiv.appendChild(button)%3B%0A        cheatDiv.appendChild(document.createElement('br'))%3B%0A    %7D)%0A%0A    function createButton(cheat) %7B%0A        let button %3D document.createElement('button')%3B%0A        button.classList.add('cheat')%3B%0A        button.innerText %3D cheat%3B%0A        return button%0A    %7D%0A    function getSite(capitalize) %7B%0A        switch (window.location.pathname.split('%2F')%5B2%5D) %7B%0A            case 'rush'%3A return capitalize %3F 'Blook Rush' %3A 'rush'%3B%0A            case 'gold'%3A return capitalize %3F 'Gold Quest' %3A 'gold'%3B%0A            case 'fishing'%3A return capitalize %3F 'Fishing Frenzy' %3A 'fishing'%3B%0A            case 'hack'%3A return capitalize %3F 'Crypto Hack' %3A 'crypto'%3B%0A            case 'battle-royale'%3A return capitalize %3F 'Battle Royale' %3A 'royale'%3B%0A            case 'factory'%3A return capitalize %3F 'Factory' %3A 'factory'%3B%0A            case 'racing'%3A return capitalize %3F 'Racing' %3A 'racing'%3B%0A            case 'classic'%3A return capitalize %3F 'Classic' %3A 'classic'%3B%0A            default%3A switch (window.location.pathname.split('%2F')%5B1%5D) %7B%0A                case 'defense'%3A return capitalize %3F 'Tower Defense' %3A 'defense'%3B%0A                case 'cafe'%3A return capitalize %3F 'Caf%C3%A9' %3A 'cafe'%3B%0A                case 'tower'%3A return capitalize %3F 'Tower of Doom' %3A 'doom'%3B%0A                case 'kingdom'%3A return capitalize %3F 'Crazy Kingdom' %3A 'kingdom'%3B%0A                default%3A return false%3B%0A            %7D%0A        %7D%3B%0A    %7D%3B%0A    function toggleHidden(e) %7B%0A        e.code %3D%3D 'KeyE' %26%26 (GUI.hidden %3D !GUI.hidden)%0A    %7D%3B%0A    addEventListener('keypress'%2C toggleHidden)%3B%0A%7D)()%7D)()%3B
 

Javascript Online Compiler

Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for Javascript language. Getting started with the OneCompiler's Javascript editor is easy and fast. The editor shows sample boilerplate code when you choose language as Javascript and start coding.

About Javascript

Javascript(JS) is a object-oriented programming language which adhere to ECMA Script Standards. Javascript is required to design the behaviour of the web pages.

Key Features

  • Open-source
  • Just-in-time compiled language
  • Embedded along with HTML and makes web pages alive
  • Originally named as LiveScript.
  • Executable in both browser and server which has Javascript engines like V8(chrome), SpiderMonkey(Firefox) etc.

Syntax help

STDIN Example

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', function(line){
    console.log("Hello, " + line);
});

variable declaration

KeywordDescriptionScope
varVar is used to declare variables(old way of declaring variables)Function or global scope
letlet is also used to declare variables(new way)Global or block Scope
constconst is used to declare const values. Once the value is assigned, it can not be modifiedGlobal or block Scope

Backtick Strings

Interpolation

let greetings = `Hello ${name}`

Multi line Strings

const msg = `
hello
world!
`

Arrays

An array is a collection of items or values.

Syntax:

let arrayName = [value1, value2,..etc];
// or
let arrayName = new Array("value1","value2",..etc);

Example:

let mobiles = ["iPhone", "Samsung", "Pixel"];

// accessing an array
console.log(mobiles[0]);

// changing an array element
mobiles[3] = "Nokia";

Arrow functions

Arrow Functions helps developers to write code in concise way, it’s introduced in ES6.
Arrow functions can be written in multiple ways. Below are couple of ways to use arrow function but it can be written in many other ways as well.

Syntax:

() => expression

Example:

const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const squaresOfEvenNumbers = numbers.filter(ele => ele % 2 == 0)
                                    .map(ele => ele ** 2);
console.log(squaresOfEvenNumbers);

De-structuring

Arrays

let [firstName, lastName] = ['Foo', 'Bar']

Objects

let {firstName, lastName} = {
  firstName: 'Foo',
  lastName: 'Bar'
}

rest(...) operator

 const {
    title,
    firstName,
    lastName,
    ...rest
  } = record;

Spread(...) operator

//Object spread
const post = {
  ...options,
  type: "new"
}
//array spread
const users = [
  ...adminUsers,
  ...normalUsers
]

Functions

function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo
  console.log(`Hello ${name}!`);
}
 
greet() // Hello Foo
greet({ name: 'Bar' }) // Hi Bar

Loops

1. If:

IF is used to execute a block of code based on a condition.

Syntax

if(condition){
    // code
}

2. If-Else:

Else part is used to execute the block of code when the condition fails.

Syntax

if(condition){
    // code
} else {
    // code
}

3. Switch:

Switch is used to replace nested If-Else statements.

Syntax

switch(condition){
    case 'value1' :
        //code
        [break;]
    case 'value2' :
        //code
        [break;]
    .......
    default :
        //code
        [break;]
}

4. For

For loop is used to iterate a set of statements based on a condition.

for(Initialization; Condition; Increment/decrement){  
//code  
} 

5. While

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while (condition) {  
  // code 
}  

6. Do-While

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {  
  // code 
} while (condition); 

Classes

ES6 introduced classes along with OOPS concepts in JS. Class is similar to a function which you can think like kind of template which will get called when ever you initialize class.

Syntax:

class className {
  constructor() { ... } //Mandatory Class method
  method1() { ... }
  method2() { ... }
  ...
}

Example:

class Mobile {
  constructor(model) {
    this.name = model;
  }
}

mbl = new Mobile("iPhone");