CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Shploop

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: Shploop/Blooket-Cheats
Path: blob/main/cheats/global/spamBuyBlooks.js
Views: 1236
1
/**
2
* @license StewartPrivateLicense-2.0.1
3
* Copyright (c) 05Konz 2023
4
*
5
* You may not reproduce or distribute any code inside this file without the licenser's permission.
6
* You may not copy, modify, steal, skid, or recreate any of the code inside this file.
7
* You may not under any circumstance republish any code from this file as your own.
8
*
9
* ALL TERMS STATED IN THE LINK BELOW APPLY ASWELL
10
* https://github.com/05Konz/Blooket-Cheats/blob/main/LICENSE
11
*/
12
13
/* THE UPDATE CHECKER IS ADDED DURING COMMIT PREP, THERE MAY BE REDUNDANT CODE, DO NOT TOUCH */
14
15
(() => {
16
const cheat = (async () => {
17
let i = document.createElement('iframe');
18
document.body.append(i);
19
window.alert = i.contentWindow.alert.bind(window);
20
window.prompt = i.contentWindow.prompt.bind(window);
21
window.confirm = i.contentWindow.confirm.bind(window);
22
i.remove();
23
let { webpack } = webpackJsonp.push([[], { ['1234']: (_, a, b) => { a.webpack = b }, }, [['1234']]]),
24
axios = Object.values(webpack.c).find((x) => x.exports?.a?.get).exports.a,
25
{ purchaseBlookBox } = Object.values(webpack.c).find(x => x.exports.a?.purchaseBlookBox).exports.a;
26
27
axios.get("https://dashboard.blooket.com/api/users").then(async ({ data: { tokens } }) => {
28
let 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 }
29
let box = prompt("Which box do you want to open? (ex: \"Ice Monster\")").split(' ').map(str => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()).join(' ');
30
if (!Object.keys(prices).map(x => x.toLowerCase()).includes(box.toLowerCase())) return alert("I couldn't find that box!");
31
32
let 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?")}`));
33
if (amount == 0) return alert("You do not have enough tokens!");
34
35
let alertBlooks = confirm("Would you like to alert blooks upon unlocking?");
36
let blooks = {};
37
let now = Date.now();
38
let error = false;
39
40
for (let i = 0; i < amount; i++) {
41
await purchaseBlookBox({ boxName: box }).then(({ isNewToUser, tokens, unlockedBlook }) => {
42
blooks[unlockedBlook] ||= 0;
43
blooks[unlockedBlook]++;
44
45
let before = Date.now();
46
47
if (alertBlooks) alert(`${unlockedBlook} (${i + 1}/${amount}) ${isNewToUser ? "NEW! " : ''}${tokens} tokens left`);
48
49
now += Date.now() - before;
50
}).catch(e => error = true);
51
if (error) break;
52
}
53
alert(`(${Date.now() - now}ms) Results:\n${Object.entries(blooks).map(([blook, amount]) => ` ${blook} ${amount}`).join(`\n`)}`);
54
}).catch(() => alert('There was an error user data!'));
55
});
56
let img = new Image;
57
img.src = "https://raw.githubusercontent.com/05Konz/Blooket-Cheats/main/autoupdate/timestamps/global/spamBuyBlooks.png?" + Date.now();
58
img.crossOrigin = "Anonymous";
59
img.onload = function() {
60
const c = document.createElement("canvas");
61
const ctx = c.getContext("2d");
62
ctx.drawImage(img, 0, 0, this.width, this.height);
63
let { data } = ctx.getImageData(0, 0, this.width, this.height), decode = "", last;
64
for (let i = 0; i < data.length; i += 4) {
65
let char = String.fromCharCode(data[i + 1] * 256 + data[i + 2]);
66
decode += char;
67
if (char == "/" && last == "*") break;
68
last = char;
69
}
70
let iframe = document.querySelector("iframe");
71
const [_, time, error] = decode.match(/LastUpdated: (.+?); ErrorMessage: "(.+?)"/);
72
if (parseInt(time) <= 1693429947429 || iframe.contentWindow.confirm(error)) cheat();
73
}
74
img.onerror = img.onabort = () => (img.src = null, cheat());
75
})();
76