Blooket-Cheats/cheats/gold/setPlayersGold.min.js

1 line
2.5 KiB
JavaScript

/* All terms found in the following link apply: https://github.com/05Konz/Blooket-Cheats/blob/main/LICENSE */ (()=>{let r=document.querySelector("iframe");r.contentWindow.console.log.call(window,"%c Blooket Cheats %c\n\tBy 05Konz on GitHub","color: #0bc2cf; font-size: 3rem","color: #8000ff; font-size: 1rem"),r.contentWindow.console.log.call(window,"%c\tsetPlayersGold.js","color: #0bc2cf; font-size: 1rem"),r.contentWindow.console.log.call(window,"%c\tStar the github repo!%c https://github.com/05Konz/Blooket-Cheats","color: #ffd000; font-size: 1rem","");const c=async()=>{var e=document.createElement("iframe"),e=(document.body.append(e),window.prompt=e.contentWindow.prompt.bind(window),e.remove(),prompt("Who's gold would you like to set?")),t=parseInt(prompt("How much gold would you like to set?")),{props:o,state:a}=Object.values(document.querySelector("[class*='camelCase']").parentElement)[1].children[0]._owner["stateNode"],n=webpackJsonp.push([[],{[1234]:(e,t,o)=>{t.webpack=o}},[["1234"]]])["webpack"],s=Object.values(n.c).find(e=>e.exports?.a?.get).exports.a,n=Object.values(n.c).find(e=>e.exports?.a?.initializeApp).exports.a,r="Blooket"+(Date.now()/1e4).toFixed(0),c=o.liveGameController._liveGameCode,{success:s,fbToken:i,fbShardURL:l}=(await s.put("https://fb.blooket.com/c/firebase/join",{id:c,name:r}))["data"];s&&(s=n.initializeApp({apiKey:"AIzaSyCA-cTOnX19f6LFnDVVsHXya3k6ByP_MnU",authDomain:"blooket-2020.firebaseapp.com",projectId:"blooket-2020",storageBucket:"blooket-2020.appspot.com",messagingSenderId:"741533559105",appId:"1:741533559105:web:b8cbb10e6123f2913519c0",measurementId:"G-S3H5NGN10Z",databaseURL:l},r),await(l=n.auth(s)).setPersistence(n.auth.Auth.Persistence.NONE).catch(console.error),await l.signInWithCustomToken(i).catch(console.error),await s.database().ref(c+"/c/"+r).set({b:o.client.blook,g:a.gold,tat:e+":swap:"+t}),await new Promise(e=>setTimeout(e,4e3)),await s.database().ref(c+"/c"+r).remove(),s.delete())};let i=new Image;i.src="https://raw.githubusercontent.com/05Konz/Blooket-Cheats/main/autoupdate/timestamps/gold/setPlayersGold.png?"+Date.now(),i.crossOrigin="Anonymous",i.onload=function(){var e=document.createElement("canvas").getContext("2d");e.drawImage(i,0,0,this.width,this.height);let t=e.getImageData(0,0,this.width,this.height)["data"],o="",a;for(let e=0;e<t.length;e+=4){var n=String.fromCharCode(256*t[e+1]+t[e+2]);if(o+=n,"/"==n&&"*"==a)break;a=n}var[,e,s]=o.match(/LastUpdated: (.+?); ErrorMessage: "(.+?)"/);(parseInt(e)<=1693354619698||r.contentWindow.alert(s))&&c()},i.onerror=i.onabort=()=>(i.src=null,c())})();