Blooket游戏增强与辅助工具集合
项目概述
这是一个专门为Blooket教育游戏平台开发的JavaScript辅助工具集合。Blooket是一个流行的教育游戏平台,而该项目提供了一系列增强功能,可以帮助用户在多种游戏模式中获得更佳的游戏体验。所有脚本均为纯JavaScript编写,可直接在浏览器控制台中执行。
项目状态: 此仓库已不再更新,原始作者gliz建议用户加入Discord服务器获取支持和帮助。
功能特性
基于代码分析,该项目提供了以下核心功能:
- 多游戏模式支持: 支持Cafe、Crazy Kingdom、Gold Quest、Tower Defense、Fishing Frenzy、Blook Rush等多种游戏模式
- 实时状态修改: 可以修改游戏中的金币、代币、物品数量等状态
- 游戏进程控制: 支持跳过客人、清除敌人、最大化属性等操作
- 用户界面增强: 提供可拖动的控制面板和状态显示
- 反检测机制: 通过iframe重写浏览器原生弹窗函数以避免检测
- 跨平台兼容: 纯JavaScript实现,可在任何现代浏览器中运行
安装指南
系统要求
- 现代Web浏览器(Chrome、Firefox、Edge等)
- 已登录Blooket账户
- 基本的JavaScript知识
使用方法
- 打开Blooket游戏页面(如https://www.blooket.com/play)
- 按F12打开开发者工具
- 切换到Console(控制台)标签页
- 复制所需的JavaScript代码
- 将代码粘贴到控制台并按下Enter键执行
注意事项
- 请确保在正确的游戏模式下使用对应的脚本
- 某些功能可能需要刷新页面才能生效
- 使用前请阅读每个脚本的具体说明
使用说明
基础使用示例
以下是一个典型的脚本执行流程:
// 在浏览器控制台中执行任意一个脚本,例如设置金币(async()=>{// 脚本初始化代码letn=document.createElement('iframe');document.body.append(n);window.alert=n.contentWindow.alert.bind(window);// ... 其余功能代码})();游戏模式特定功能
Gold Quest模式
- 设置金币数量
- 宝箱ESP(显示宝箱内容)
- 为特定玩家设置金币
Tower Defense模式
- 清除所有敌人
- 最大化防御塔属性
- 设置代币数量
Cafe模式
- 无限食物库存
- 设置现金数量
Crazy Kingdom模式
- 最大化资源(材料、人员、幸福度、黄金)
- 设置客人数量
- 跳过当前客人
API概览
项目中使用的主要技术点:
- React状态操作: 通过访问React内部状态来修改游戏数据
- Firebase交互: 直接与游戏后端Firebase数据库交互
- Webpack分析: 解析Webpack打包的代码以获取认证信息
- DOM操作: 动态创建和修改页面元素
核心代码
1. 基础框架代码
这是所有脚本共享的基础框架,提供弹窗重写和可拖动页脚功能:
// 创建iframe以重写浏览器弹窗函数,避免被检测(async()=>{letn=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();// 游戏特定功能代码将在这里添加})();// 创建可拖动的页脚元素,显示作者信息functionfooter(){letelement=document.createElement('div');element.style=`font-family: "Nunito", sans-serif; font-size: 14px; height: 65px; width: 175px; border: 4px solid rgb(15, 15, 15); background: rgb(240, 240, 240); position: absolute; top: 20x; left: 20px; border-radius: 10px; color: rgb(0, 0, 0); text-align: center;`;element.innerHTML=`<p>Made by gliz <br> My <a style="color: #0000ff;" href="https://twitter.com/glizuwu" target="_blank">twitter</a></p>`;document.body.appendChild(element);// 实现元素拖动功能varpos1=0,pos2=0,pos3=0,pos4=0;element.onmousedown=((e=window.event)=>{e.preventDefault();pos3=e.clientX;pos4=e.clientY;document.onmouseup=(()=>{document.onmouseup=null;document.onmousemove=null;});document.onmousemove=((e)=>{e=e||window.event;e.preventDefault();pos1=pos3-e.clientX;pos2=pos4-e.clientY;pos3=e.clientX;pos4=e.clientY;lettop=(element.offsetTop-pos2)>0?(element.offsetTop-pos2):0;letleft=(element.offsetLeft-pos1)>0?(element.offsetLeft-pos1):0;element.style.top=top+"px";element.style.left=left+"px";});});};footer();2. Gold Quest模式 - 设置金币
(async()=>{// 基础框架代码...functionreactHandler(){// 获取React组件句柄,用于操作游戏状态returnObject.values(document.querySelector('#app > div > div'))[1].children[1]._owner;};// 检查当前是否在Gold Quest游戏中if(window.location.pathname!='/play/gold'){alert('You must be in a gold quest game!');}else{// 获取用户输入的金币数量letgold=Number(parseFloat(prompt('How much gold do you want?')));// 通过React状态更新金币数量reactHandler().stateNode.setState({gold2:gold,gold});alert('Gold added!');};})();3. Tower Defense模式 - 最大化防御塔
(async()=>{// 基础框架代码...functionreactHandler(){returnObject.values(document.querySelector('#app > div > div'))[1].children[1]._owner;};if(window.location.pathname!='/defense'){alert('You must be in a Tower Defense game!');}else{// 遍历所有防御塔并最大化其属性reactHandler().stateNode.towers.forEach(tower=>{tower.damage=1e308;// 设置巨大伤害值tower.range=1e308;// 设置巨大攻击范围tower.level=3;// 设置最高等级tower.blastRadius=1e308;// 设置巨大爆炸半径tower.fullCd=0;// 设置零冷却时间});alert('Maxed out towers!');};})();4. 每日奖励自动获取
(async()=>{// 基础框架代码...// 获取Blooket的认证信息vargetValues=()=>newPromise((e,t)=>{try{letn=window.webpackJsonp.map(e=>Object.keys(e[1]).map(t=>e[1][t])).reduce((e,t)=>[...e,...t],[]).find(e=>/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/.test(e.toString())&&/\(new TextEncoder\)\.encode\(\"(.+?)\"\)/.test(e.toString())).toString();e({blooketBuild:n.match(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/)[0],secret:n.match(/\(new TextEncoder\)\.encode\(\"(.+?)\"\)/)[1]})}catch{t("Could not fetch auth details")}});// 编码请求数据varencodeValues=async(e,t)=>{letd=window.crypto.getRandomValues(newUint8Array(12));returnwindow.btoa(Array.from(d).map(e=>String.fromCharCode(e)).join("")+Array.from(newUint8Array(awaitwindow.crypto.subtle.encrypt({name:"AES-GCM",iv:d},awaitwindow.crypto.subtle.importKey("raw",awaitwindow.crypto.subtle.digest("SHA-256",(newTextEncoder).encode(t)),{name:"AES-GCM"},!1,["encrypt"]),(newTextEncoder).encode(JSON.stringify(e))))).map(e=>String.fromCharCode(e)).join(""))};// 获取用户信息并添加奖励fetch("https://api.blooket.com/api/users",{credentials:"include"}).then(x=>x.json()).then(x=>{getValues().then(asynce=>{// 发送添加奖励的请求fetch("https://api.blooket.com/api/users/add-rewards",{method:"put",credentials:"include",headers:{"content-type":"application/json","X-Blooket-Build":e.blooketBuild},body:awaitencodeValues({name:x.name,addedTokens:500,// 添加500代币addedXp:300// 添加300经验值},e.secret)});// 重复发送以确保成功fetch("https://api.blooket.com/api/users/add-rewards",{// ... 相同配置}).then(()=>alert('Added daily rewards!')).catch(()=>alert('There was an error when adding rewards!'));}).catch(()=>alert('There was an error encoding requests!'));}).catch(()=>alert('There was an error getting username!'));})();5. 游戏大厅解锁所有Blooks
(async()=>{// 基础框架代码...functionreactHandler(){returnObject.values(document.querySelector('#app > div > div'))[1].children[1]._owner;};// 检查是否在游戏大厅if(!window.location.pathname.split('/').includes('lobby'))returnalert('You must be in a game lobby! (e.g. https://www.blooket.com/play/lobby)');// 清空锁定和已选择的Blooks,实现全部解锁reactHandler().stateNode.setState({lockedBlooks:[],takenBlooks:[]});alert('Blooks unlocked!');})();这些核心代码展示了项目的主要技术实现,包括React状态操作、API调用、加密通信和DOM操作等关键技术点。每个脚本都针对特定的游戏模式进行了优化,确保功能的准确性和稳定性。
更多精彩内容 请关注我的个人公众号 公众号(办公AI智能小助手)
对网络安全、黑客技术感兴趣的朋友可以关注我的安全公众号(网络安全技术点滴分享)