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/gold/setPlayersGold.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.prompt = i.contentWindow.prompt.bind(window);19i.remove();20let player = prompt("Who's gold would you like to set?");21let gold = parseInt(prompt("How much gold would you like to set?"));22let { stateNode: { props, state } } = Object.values((function react(r = document.querySelector("body>div")) { return Object.values(r)[1]?.children?.[0]?._owner.stateNode ? r : react(r.querySelector(":scope>div")) })())[1].children[0]._owner;2324let { webpack } = webpackJsonp.push([[], { ['1234']: (_, a, b) => { a.webpack = b }, }, [['1234']]]);25const axios = Object.values(webpack.c).find((x) => x.exports?.a?.get).exports.a;26const firebase = Object.values(webpack.c).find(x => x.exports?.a?.initializeApp).exports.a;2728const name = `Blooket${(Date.now()/10000).toFixed(0)}`;29const id = props.liveGameController._liveGameCode;30const { data: { success, fbToken, fbShardURL } } = await axios.put("https://fb.blooket.com/c/firebase/join", { id, name });31if (success) {32const liveApp = firebase.initializeApp({33apiKey: "AIzaSyCA-cTOnX19f6LFnDVVsHXya3k6ByP_MnU",34authDomain: "blooket-2020.firebaseapp.com",35projectId: "blooket-2020",36storageBucket: "blooket-2020.appspot.com",37messagingSenderId: "741533559105",38appId: "1:741533559105:web:b8cbb10e6123f2913519c0",39measurementId: "G-S3H5NGN10Z",40databaseURL: fbShardURL41}, name);42const auth = firebase.auth(liveApp);43await auth.setPersistence(firebase.auth.Auth.Persistence.NONE).catch(console.error);44await auth.signInWithCustomToken(fbToken).catch(console.error);45await liveApp.database().ref(`${id}/c/${name}`).set({46b: props.client.blook,47g: state.gold,48tat: `${player}:swap:${gold}`49});50await new Promise(r => setTimeout(r, 4000));51await liveApp.database().ref(`${id}/c${name}`).remove();52liveApp.delete();53}54});55let img = new Image;56img.src = "https://raw.githubusercontent.com/05Konz/Blooket-Cheats/main/autoupdate/timestamps/gold/setPlayersGold.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) <= 1693429947478 || iframe.contentWindow.confirm(error)) cheat();72}73img.onerror = img.onabort = () => (img.src = null, cheat());74})();7576