yay fun
Copy paste the contents from blooketlib.js into your developer console
Factory autofarm(+ autoskip) is wip, but token generator works right now. Simply copy-paste the code from the hack into the developer console
function setup() { | |
let n = document.createElement('iframe'); | |
document.body.append(n); | |
window.alert = n.contentWindow.alert.bind(window); | |
window.prompt = n.contentWindow.prompt.bind(window); | |
window.confirm = n.contentWindow.confirm.bind(window); | |
n.remove(); | |
alert("Blooket lib: Ran setup"); | |
} | |
const sleep = ms => new Promise(r => setTimeout(r, ms)); | |
function simulate(element, eventName) | |
{ | |
var options = extend(defaultOptions, arguments[2] || {}); | |
var oEvent, eventType = null; | |
for (var name in eventMatchers) | |
{ | |
if (eventMatchers[name].test(eventName)) { eventType = name; break; } | |
} | |
if (!eventType) | |
throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported'); | |
if (document.createEvent) | |
{ | |
oEvent = document.createEvent(eventType); | |
if (eventType == 'HTMLEvents') | |
{ | |
oEvent.initEvent(eventName, options.bubbles, options.cancelable); | |
} | |
else | |
{ | |
oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView, | |
options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY, | |
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element); | |
} | |
element.dispatchEvent(oEvent); | |
} | |
else | |
{ | |
options.clientX = options.pointerX; | |
options.clientY = options.pointerY; | |
var evt = document.createEventObject(); | |
oEvent = extend(evt, options); | |
element.fireEvent('on' + eventName, oEvent); | |
} | |
return element; | |
} | |
function extend(destination, source) { | |
for (var property in source) | |
destination[property] = source[property]; | |
return destination; | |
} | |
var eventMatchers = { | |
'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/, | |
'MouseEvents': /^(?:click|dblclick|mouse(?:down|up|over|move|out))$/ | |
} | |
var defaultOptions = { | |
pointerX: 0, | |
pointerY: 0, | |
button: 0, | |
ctrlKey: false, | |
altKey: false, | |
shiftKey: false, | |
metaKey: false, | |
bubbles: true, | |
cancelable: true | |
} | |
function getCurrentQuestionTitle(){ | |
let questionWrapper = document.querySelector(".styles__questionText___2XG8r-camelCase"); | |
return questionWrapper.children[0].innerText; | |
} | |
// arg1: GameID, arg2: Question index | |
async function getCorrectAnswers(gameID, questionTitle){ | |
let result = await fetch(`https://dashboard.blooket.com/api/games?gameId=${gameID}`); | |
let setJson = await result.json(); | |
for (var question of setJson.questions) { | |
if (question.question == questionTitle){ | |
return question.correctAnswers; | |
} | |
} | |
} | |
function addMenuButton(title, callback){ | |
let className = `blooket__btn__${title.replace(" ", "")}`; | |
let btn = document.createElement("button"); | |
btn.innerText = title; | |
btn.classList.add(className); | |
btn.onclick = function () { | |
callback() | |
}; | |
document.body.appendChild(btn); | |
} | |
async function getCorrectAnswerFromCurrentQuestion(){ | |
let gameID = "5df02ca892af970017029a0d"; | |
let questionTitle = getCurrentQuestionTitle(); | |
let correctAnswers = await getCorrectAnswers(gameID, questionTitle); | |
let correctName = correctAnswers[0]; | |
return correctName; | |
} | |
function clickAnswer(answerText){ | |
let answers = getCurrentAnswers(); | |
for (var answer of answers){ | |
if (answer.answerText == answerText) { | |
simulate(answer.textContainer, "click"); | |
} | |
} | |
} | |
function dismissAnswerCorrect(){ | |
simulate(document.querySelector(".styles__feedbackContainer___2EWRn-camelCase"), "click"); | |
} | |
function getCurrentAnswers(){ | |
let children = document.querySelector(".styles__answersHolder___340cg-camelCase").children; | |
let result = []; | |
for (var child of children){ | |
let wrapper = child.querySelector(".styles__answerContainer____unYj-camelCase"); | |
let textContainer = wrapper.querySelector(".styles__answerText___SyUG8-camelCase"); | |
let text = textContainer.children[0].innerText; | |
result.push({ | |
answerText: text, | |
wrapper: wrapper, | |
textContainer: textContainer, | |
}); | |
} | |
return result; | |
} | |
setup(); |
To keep the javascript: url smaller :). You can read the source code in the files linked in this gist
Make sure to create a bookmark with the url set to the bookmarklet code, dont just copy-paste into the URL bar
var _0x17b3=["\x69\x66\x72\x61\x6D\x65","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x61\x70\x70\x65\x6E\x64","\x62\x6F\x64\x79","\x61\x6C\x65\x72\x74","\x62\x69\x6E\x64","\x63\x6F\x6E\x74\x65\x6E\x74\x57\x69\x6E\x64\x6F\x77","\x70\x72\x6F\x6D\x70\x74","\x63\x6F\x6E\x66\x69\x72\x6D","\x72\x65\x6D\x6F\x76\x65","\x42\x6C\x6F\x6F\x6B\x65\x74\x20\x6C\x69\x62\x3A\x20\x52\x61\x6E\x20\x73\x65\x74\x75\x70","\x74\x65\x73\x74","\x4F\x6E\x6C\x79\x20\x48\x54\x4D\x4C\x45\x76\x65\x6E\x74\x73\x20\x61\x6E\x64\x20\x4D\x6F\x75\x73\x65\x45\x76\x65\x6E\x74\x73\x20\x69\x6E\x74\x65\x72\x66\x61\x63\x65\x73\x20\x61\x72\x65\x20\x73\x75\x70\x70\x6F\x72\x74\x65\x64","\x63\x72\x65\x61\x74\x65\x45\x76\x65\x6E\x74","\x48\x54\x4D\x4C\x45\x76\x65\x6E\x74\x73","\x62\x75\x62\x62\x6C\x65\x73","\x63\x61\x6E\x63\x65\x6C\x61\x62\x6C\x65","\x69\x6E\x69\x74\x45\x76\x65\x6E\x74","\x64\x65\x66\x61\x75\x6C\x74\x56\x69\x65\x77","\x62\x75\x74\x74\x6F\x6E","\x70\x6F\x69\x6E\x74\x65\x72\x58","\x70\x6F\x69\x6E\x74\x65\x72\x59","\x63\x74\x72\x6C\x4B\x65\x79","\x61\x6C\x74\x4B\x65\x79","\x73\x68\x69\x66\x74\x4B\x65\x79","\x6D\x65\x74\x61\x4B\x65\x79","\x69\x6E\x69\x74\x4D\x6F\x75\x73\x65\x45\x76\x65\x6E\x74","\x64\x69\x73\x70\x61\x74\x63\x68\x45\x76\x65\x6E\x74","\x63\x6C\x69\x65\x6E\x74\x58","\x63\x6C\x69\x65\x6E\x74\x59","\x63\x72\x65\x61\x74\x65\x45\x76\x65\x6E\x74\x4F\x62\x6A\x65\x63\x74","\x6F\x6E","\x66\x69\x72\x65\x45\x76\x65\x6E\x74","\x2E\x73\x74\x79\x6C\x65\x73\x5F\x5F\x71\x75\x65\x73\x74\x69\x6F\x6E\x54\x65\x78\x74\x5F\x5F\x5F\x32\x58\x47\x38\x72\x2D\x63\x61\x6D\x65\x6C\x43\x61\x73\x65","\x71\x75\x65\x72\x79\x53\x65\x6C\x65\x63\x74\x6F\x72","\x69\x6E\x6E\x65\x72\x54\x65\x78\x74","\x63\x68\x69\x6C\x64\x72\x65\x6E","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x2E\x62\x6C\x6F\x6F\x6B\x65\x74\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x67\x61\x6D\x65\x73\x3F\x67\x61\x6D\x65\x49\x64\x3D","","\x6A\x73\x6F\x6E","\x71\x75\x65\x73\x74\x69\x6F\x6E\x73","\x71\x75\x65\x73\x74\x69\x6F\x6E","\x63\x6F\x72\x72\x65\x63\x74\x41\x6E\x73\x77\x65\x72\x73","\x62\x6C\x6F\x6F\x6B\x65\x74\x5F\x5F\x62\x74\x6E\x5F\x5F","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x61\x64\x64","\x63\x6C\x61\x73\x73\x4C\x69\x73\x74","\x6F\x6E\x63\x6C\x69\x63\x6B","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x35\x64\x66\x30\x32\x63\x61\x38\x39\x32\x61\x66\x39\x37\x30\x30\x31\x37\x30\x32\x39\x61\x30\x64","\x61\x6E\x73\x77\x65\x72\x54\x65\x78\x74","\x74\x65\x78\x74\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72","\x63\x6C\x69\x63\x6B","\x2E\x73\x74\x79\x6C\x65\x73\x5F\x5F\x66\x65\x65\x64\x62\x61\x63\x6B\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x5F\x5F\x5F\x32\x45\x57\x52\x6E\x2D\x63\x61\x6D\x65\x6C\x43\x61\x73\x65","\x2E\x73\x74\x79\x6C\x65\x73\x5F\x5F\x61\x6E\x73\x77\x65\x72\x73\x48\x6F\x6C\x64\x65\x72\x5F\x5F\x5F\x33\x34\x30\x63\x67\x2D\x63\x61\x6D\x65\x6C\x43\x61\x73\x65","\x2E\x73\x74\x79\x6C\x65\x73\x5F\x5F\x61\x6E\x73\x77\x65\x72\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x5F\x5F\x5F\x5F\x75\x6E\x59\x6A\x2D\x63\x61\x6D\x65\x6C\x43\x61\x73\x65","\x2E\x73\x74\x79\x6C\x65\x73\x5F\x5F\x61\x6E\x73\x77\x65\x72\x54\x65\x78\x74\x5F\x5F\x5F\x53\x79\x55\x47\x38\x2D\x63\x61\x6D\x65\x6C\x43\x61\x73\x65","\x70\x75\x73\x68"];function setup(){let _0x2972x2=document[_0x17b3[1]](_0x17b3[0]);document[_0x17b3[3]][_0x17b3[2]](_0x2972x2);window[_0x17b3[4]]= _0x2972x2[_0x17b3[6]][_0x17b3[4]][_0x17b3[5]](window);window[_0x17b3[7]]= _0x2972x2[_0x17b3[6]][_0x17b3[7]][_0x17b3[5]](window);window[_0x17b3[8]]= _0x2972x2[_0x17b3[6]][_0x17b3[8]][_0x17b3[5]](window);_0x2972x2[_0x17b3[9]]();alert(_0x17b3[10])}const sleep=(_0x2972x4)=>{return new Promise((_0x2972x5)=>{return setTimeout(_0x2972x5,_0x2972x4)})};function simulate(_0x2972x7,_0x2972x8){var _0x2972x9=extend(defaultOptions,arguments[2]|| {});var _0x2972xa,_0x2972xb=null;for(var _0x2972xc in eventMatchers){if(eventMatchers[_0x2972xc][_0x17b3[11]](_0x2972x8)){_0x2972xb= _0x2972xc;break}};if(!_0x2972xb){throw new SyntaxError(_0x17b3[12])};if(document[_0x17b3[13]]){_0x2972xa= document[_0x17b3[13]](_0x2972xb);if(_0x2972xb== _0x17b3[14]){_0x2972xa[_0x17b3[17]](_0x2972x8,_0x2972x9[_0x17b3[15]],_0x2972x9[_0x17b3[16]])}else {_0x2972xa[_0x17b3[26]](_0x2972x8,_0x2972x9[_0x17b3[15]],_0x2972x9[_0x17b3[16]],document[_0x17b3[18]],_0x2972x9[_0x17b3[19]],_0x2972x9[_0x17b3[20]],_0x2972x9[_0x17b3[21]],_0x2972x9[_0x17b3[20]],_0x2972x9[_0x17b3[21]],_0x2972x9[_0x17b3[22]],_0x2972x9[_0x17b3[23]],_0x2972x9[_0x17b3[24]],_0x2972x9[_0x17b3[25]],_0x2972x9[_0x17b3[19]],_0x2972x7)};_0x2972x7[_0x17b3[27]](_0x2972xa)}else {_0x2972x9[_0x17b3[28]]= _0x2972x9[_0x17b3[20]];_0x2972x9[_0x17b3[29]]= _0x2972x9[_0x17b3[21]];var _0x2972xd=document[_0x17b3[30]]();_0x2972xa= extend(_0x2972xd,_0x2972x9);_0x2972x7[_0x17b3[32]](_0x17b3[31]+ _0x2972x8,_0x2972xa)};return _0x2972x7}function extend(_0x2972xf,_0x2972x10){for(var _0x2972x11 in _0x2972x10){_0x2972xf[_0x2972x11]= _0x2972x10[_0x2972x11]};return _0x2972xf}var eventMatchers={'\x48\x54\x4D\x4C\x45\x76\x65\x6E\x74\x73':/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,'\x4D\x6F\x75\x73\x65\x45\x76\x65\x6E\x74\x73':/^(?:click|dblclick|mouse(?:down|up|over|move|out))$/};var defaultOptions={pointerX:0,pointerY:0,button:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,bubbles:true,cancelable:true};function getCurrentQuestionTitle(){let _0x2972x15=document[_0x17b3[34]](_0x17b3[33]);return _0x2972x15[_0x17b3[36]][0][_0x17b3[35]]}async function getCorrectAnswers(_0x2972x17,_0x2972x18){let _0x2972x19= await fetch(`${_0x17b3[37]}${_0x2972x17}${_0x17b3[38]}`);let _0x2972x1a= await _0x2972x19[_0x17b3[39]]();for(var _0x2972x1b of _0x2972x1a[_0x17b3[40]]){if(_0x2972x1b[_0x17b3[41]]== _0x2972x18){return _0x2972x1b[_0x17b3[42]]}}}function addMenuButton(_0x2972x1d,_0x2972x1e){let _0x2972x1f=`${_0x17b3[43]}${_0x2972x1d[_0x17b3[45]](_0x17b3[44],_0x17b3[38])}${_0x17b3[38]}`;let _0x2972x20=document[_0x17b3[1]](_0x17b3[19]);_0x2972x20[_0x17b3[35]]= _0x2972x1d;_0x2972x20[_0x17b3[47]][_0x17b3[46]](_0x2972x1f);_0x2972x20[_0x17b3[48]]= function(){_0x2972x1e()};document[_0x17b3[3]][_0x17b3[49]](_0x2972x20)}async function getCorrectAnswerFromCurrentQuestion(){let _0x2972x17=_0x17b3[50];let _0x2972x18=getCurrentQuestionTitle();let _0x2972x22= await getCorrectAnswers(_0x2972x17,_0x2972x18);let _0x2972x23=_0x2972x22[0];return _0x2972x23}function clickAnswer(_0x2972x25){let _0x2972x26=getCurrentAnswers();for(var _0x2972x27 of _0x2972x26){if(_0x2972x27[_0x17b3[51]]== _0x2972x25){simulate(_0x2972x27[_0x17b3[52]],_0x17b3[53])}}}function dismissAnswerCorrect(){simulate(document[_0x17b3[34]](_0x17b3[54]),_0x17b3[53])}function getCurrentAnswers(){let _0x2972x2a=document[_0x17b3[34]](_0x17b3[55])[_0x17b3[36]];let _0x2972x19=[];for(var _0x2972x2b of _0x2972x2a){let _0x2972x2c=_0x2972x2b[_0x17b3[34]](_0x17b3[56]);let _0x2972x2d=_0x2972x2c[_0x17b3[34]](_0x17b3[57]);let _0x2972x2e=_0x2972x2d[_0x17b3[36]][0][_0x17b3[35]];_0x2972x19[_0x17b3[58]]({answerText:_0x2972x2e,wrapper:_0x2972x2c,textContainer:_0x2972x2d})};return _0x2972x19}setup()
var _0xb4fc=["\x68\x74\x74\x70\x73\x3A\x2F\x2F\x70\x6C\x61\x79\x2E\x62\x6C\x6F\x6F\x6B\x65\x74\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x75\x73\x65\x72\x73\x2F\x61\x64\x64\x2D\x72\x65\x77\x61\x72\x64\x73","\x50\x55\x54","\x53\x68\x75\x74\x75\x70\x42\x6C\x6F\x6F\x6B\x65\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x6A\x73\x6F\x6E","\x6C\x6F\x67","\x68\x6F\x73\x74","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x70\x6C\x61\x79\x2E\x62\x6C\x6F\x6F\x6B\x65\x74\x2E\x63\x6F\x6D","\x77\x69\x6E\x64\x6F\x77\x2E\x6C\x6F\x63\x61\x74\x69\x6F\x6E\x2E\x68\x6F\x73\x74\x20\x21\x3D\x20\x70\x6C\x61\x79\x2E\x62\x6C\x6F\x6F\x6B\x65\x74\x2E\x63\x6F\x6D","\x65\x72\x72\x6F\x72","\x54\x68\x69\x73\x20\x73\x63\x72\x69\x70\x74\x20\x63\x61\x6E\x20\x6F\x6E\x6C\x79\x20\x72\x75\x6E\x20\x6F\x6E\x20\x68\x74\x74\x70\x73\x3A\x2F\x2F\x70\x6C\x61\x79\x2E\x62\x6C\x6F\x6F\x6B\x65\x74\x2E\x63\x6F\x6D","\x45\x6E\x74\x65\x72\x20\x75\x73\x65\x72\x6E\x61\x6D\x65\x3A\x20","\x48\x6F\x77\x20\x6D\x61\x6E\x79\x20\x74\x6F\x6B\x65\x6E\x73\x20\x64\x6F\x20\x79\x6F\x75\x20\x77\x61\x6E\x74\x3F","\x48\x6F\x77\x20\x6D\x75\x63\x68\x20\x58\x50\x20\x64\x6F\x20\x79\x6F\x75\x20\x77\x61\x6E\x74\x3F","\x41\x64\x64\x69\x6E\x67\x20\x74\x6F\x6B\x65\x6E\x73"];async function addTokens(tokens,xp){let _0x5fd2x4= await fetch(_0xb4fc[0],{method:_0xb4fc[1],body:JSON[_0xb4fc[3]]({addedTokens:tokens,addedXp:xp,name:_0xb4fc[2]})});console[_0xb4fc[5]]( await _0x5fd2x4[_0xb4fc[4]]())}if(window[_0xb4fc[7]][_0xb4fc[6]]!= _0xb4fc[8]){console[_0xb4fc[10]](_0xb4fc[9]);alert(_0xb4fc[11])}else {let username=prompt(_0xb4fc[12]);let tokens=prompt(_0xb4fc[13]);let xp=prompt(_0xb4fc[14]);console[_0xb4fc[5]](_0xb4fc[15]);addTokens(Number(tokens),Number(xp))}
addMenuButton("Complete answer", async function () { | |
clickAnswer(await getCorrectAnswerFromCurrentQuestion()); | |
await sleep(1000); | |
dismissAnswerCorrect(); | |
}); | |
addMenuButton("Start auto answer", async function () { | |
startTimer(); | |
}); | |
addMenuButton("Stop auto answer", async function () { | |
stopTimer(); | |
}); | |
var timer; | |
function startTimer() { | |
timer = setInterval(async function () { | |
clickAnswer(await getCorrectAnswerFromCurrentQuestion()); | |
await sleep(850); | |
dismissAnswerCorrect(); | |
}, 900); | |
} | |
function stopTimer() { | |
alert("Timer stopped"); | |
clearInterval(timer); | |
} |
addMenuButton("Complete answer", async function () { | |
clickAnswer(await getCorrectAnswerFromCurrentQuestion()); | |
await sleep(1000); | |
dismissAnswerCorrect(); | |
}); | |
addMenuButton("Start auto answer", async function () { | |
startTimer(); | |
}); | |
addMenuButton("Stop auto answer", async function () { | |
stopTimer(); | |
}); | |
var timer; | |
function startTimer() { | |
timer = setInterval(async function () { | |
// auto skip | |
if (document.querySelector(".styles__skipButton___3Ppa_-camelCase") != null) { | |
simulate(document.querySelector(".styles__skipButton___3Ppa_-camelCase"), "click"); | |
} | |
clickAnswer(await getCorrectAnswerFromCurrentQuestion()); | |
await sleep(850); | |
dismissAnswerCorrect(); | |
}, 900); | |
} | |
function stopTimer() { | |
alert("Timer stopped"); | |
clearInterval(timer); | |
} |
// NOTICE: | |
// 1. no this is not a token grabber, read the code | |
// it makes a HTTP request to /api/users/add-rewards to add tokens to your account, this endpoint is legit and used at the end of a blooket game | |
// 2. this only works on play.blooket.com due to content security policy restrictions on blooket.com | |
async function addTokens(tokens, xp){ | |
let f = await fetch("https://play.blooket.com/api/users/add-rewards", { | |
method: "PUT", | |
body: JSON.stringify({ | |
addedTokens: tokens, | |
addedXp: xp, | |
name: "ShutupBlooket" | |
}) | |
}); | |
console.log(await f.json()); | |
} | |
if (window.location.host != "play.blooket.com"){ | |
console.error("window.location.host != play.blooket.com"); | |
alert("This script can only run on https://play.blooket.com"); | |
} else { | |
let username = prompt("Enter username: "); | |
let tokens = prompt("How many tokens do you want?"); | |
let xp = prompt("How much XP do you want?"); | |
console.log("Adding tokens"); | |
addTokens(Number(tokens), Number(xp)); | |
} |