CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/main/cheats/global/spamBuyBlooks.js
Views: 1236
/**1* @license StewartPrivateLicense-2.0.12* Copyright (c) 05Konz 20233*4* You may not reproduce or distribute any code inside this file without the licenser's permission.5* You may not copy, modify, steal, skid, or recreate any of the code inside this file.6* You may not under any circumstance republish any code from this file as your own.7*8* ALL TERMS STATED IN THE LINK BELOW APPLY ASWELL9* https://github.com/05Konz/Blooket-Cheats/blob/main/LICENSE10*/1112/* THE UPDATE CHECKER IS ADDED DURING COMMIT PREP, THERE MAY BE REDUNDANT CODE, DO NOT TOUCH */1314(() => {15const cheat = (async () => {16let i = document.createElement('iframe');17document.body.append(i);18window.alert = i.contentWindow.alert.bind(window);19window.prompt = i.contentWindow.prompt.bind(window);20window.confirm = i.contentWindow.confirm.bind(window);21i.remove();22let { webpack } = webpackJsonp.push([[], { ['1234']: (_, a, b) => { a.webpack = b }, }, [['1234']]]),23axios = Object.values(webpack.c).find((x) => x.exports?.a?.get).exports.a,24{ purchaseBlookBox } = Object.values(webpack.c).find(x => x.exports.a?.purchaseBlookBox).exports.a;2526axios.get("https://dashboard.blooket.com/api/users").then(async ({ data: { tokens } }) => {27let prices = Object.values(webpack.c).find(x => !isNaN(x?.exports?.a?.Space)).exports.a || { Medieval: 20, Breakfast: 20, Wonderland: 20, Blizzard: 25, Space: 20, Bot: 20, Aquatic: 20, Safari: 20, Dino: 25, "Ice Monster": 25, Outback: 25 }28let box = prompt("Which box do you want to open? (ex: \"Ice Monster\")").split(' ').map(str => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()).join(' ');29if (!Object.keys(prices).map(x => x.toLowerCase()).includes(box.toLowerCase())) return alert("I couldn't find that box!");3031let amount = Math.min(Math.floor(tokens / Object.entries(prices).find(x => x[0].toLowerCase() == box.toLowerCase())[1]), parseInt(`0${prompt("How many boxes do you want to open?")}`));32if (amount == 0) return alert("You do not have enough tokens!");3334let alertBlooks = confirm("Would you like to alert blooks upon unlocking?");35let blooks = {};36let now = Date.now();37let error = false;3839for (let i = 0; i < amount; i++) {40await purchaseBlookBox({ boxName: box }).then(({ isNewToUser, tokens, unlockedBlook }) => {41blooks[unlockedBlook] ||= 0;42blooks[unlockedBlook]++;4344let before = Date.now();4546if (alertBlooks) alert(`${unlockedBlook} (${i + 1}/${amount}) ${isNewToUser ? "NEW! " : ''}${tokens} tokens left`);4748now += Date.now() - before;49}).catch(e => error = true);50if (error) break;51}52alert(`(${Date.now() - now}ms) Results:\n${Object.entries(blooks).map(([blook, amount]) => ` ${blook} ${amount}`).join(`\n`)}`);53}).catch(() => alert('There was an error user data!'));54});55let img = new Image;56img.src = "https://raw.githubusercontent.com/05Konz/Blooket-Cheats/main/autoupdate/timestamps/global/spamBuyBlooks.png?" + Date.now();57img.crossOrigin = "Anonymous";58img.onload = function() {59const c = document.createElement("canvas");60const ctx = c.getContext("2d");61ctx.drawImage(img, 0, 0, this.width, this.height);62let { data } = ctx.getImageData(0, 0, this.width, this.height), decode = "", last;63for (let i = 0; i < data.length; i += 4) {64let char = String.fromCharCode(data[i + 1] * 256 + data[i + 2]);65decode += char;66if (char == "/" && last == "*") break;67last = char;68}69let iframe = document.querySelector("iframe");70const [_, time, error] = decode.match(/LastUpdated: (.+?); ErrorMessage: "(.+?)"/);71if (parseInt(time) <= 1693429947429 || iframe.contentWindow.confirm(error)) cheat();72}73img.onerror = img.onabort = () => (img.src = null, cheat());74})();7576