Advertisement
Astyll

Test

Mar 29th, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.29 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Blooket cheat sadhf
  3. // @namespace
  4. // @version 1
  5. // @description Some Useful Blooket Hacks.
  6. // @author Spikesee3
  7. // @match *://*.blooket.com/*
  8. // @match *://blooket.com/*
  9. // @run-at document-end
  10. // @supportURL
  11. // @license
  12. // @source ilities.js
  13. // @downloadURL https://update.greasyfork.org/scripts/463382/Blooket%20Hacks.user.js
  14. // @updateURL https://update.greasyfork.org/scripts/463382/Blooket%20Hacks.meta.js
  15. // ==/UserScript==
  16.  
  17. (() => {
  18. let n = document.createElement("iframe");
  19.  
  20. document.body.append(n);
  21.  
  22. window.alert = n.contentWindow.alert.bind(window);
  23.  
  24. window.prompt = n.contentWindow.prompt.bind(window);
  25.  
  26. window.confirm = n.contentWindow.confirm.bind(window);
  27.  
  28. n.remove();
  29. })();
  30.  
  31. (() => {
  32. let style = document.createElement("style");
  33.  
  34. style.innerHTML = `details > summary {
  35.  
  36. cursor: pointer;
  37.  
  38. transition: 0.15s;
  39.  
  40. list-style: none;
  41.  
  42. }
  43.  
  44. details > summary:hover {
  45.  
  46. color: hsl(0, 0%, 50%)
  47.  
  48. }
  49.  
  50. details > summary::-webkit-details-marker {
  51.  
  52. display: none;
  53.  
  54. }
  55.  
  56. details summary ~ * {
  57.  
  58. animation: sweep .5s ease-in-out;
  59.  
  60. }
  61.  
  62.  
  63.  
  64. @keyframes sweep {
  65.  
  66. 0% {opacity: 0; transform: translateY(-10px)}
  67.  
  68. 100% {opacity: 1; transform: translateY(0)}
  69.  
  70. }
  71.  
  72. .cheat {
  73.  
  74. border: none;
  75.  
  76. background: hsl(0, 0%, 20%);
  77.  
  78. padding: 5px;
  79.  
  80. margin: 3px;
  81.  
  82. width: 60%;
  83.  
  84. color: hsl(0, 0%, 100%);
  85.  
  86. transition: 0.2s;
  87.  
  88. border-radius: 5px;
  89.  
  90. cursor: pointer;
  91.  
  92. }
  93.  
  94. .cheat:hover {
  95.  
  96. background: hsl(0, 0%, 30%);
  97.  
  98. }`;
  99.  
  100. const GUI = document.createElement("div");
  101.  
  102. GUI.appendChild(style);
  103.  
  104. GUI.style.width = "400px";
  105.  
  106. //GUI.style.height = '500px';
  107.  
  108. GUI.style.background = "hsl(0, 0%, 10%)";
  109.  
  110. GUI.style.borderRadius = "10px";
  111.  
  112. GUI.style.position = "absolute";
  113.  
  114. GUI.style.textAlign = "center";
  115.  
  116. GUI.style.fontFamily = "Nunito";
  117.  
  118. GUI.style.color = "white";
  119.  
  120. GUI.style.overflow = "hidden";
  121.  
  122. GUI.style.top = "50px";
  123.  
  124. GUI.style.left = "50px";
  125.  
  126. var pos1 = 0,
  127. pos2 = 0,
  128. pos3 = 0,
  129. pos4 = 0;
  130.  
  131. GUI.onmousedown = (e = window.event) => {
  132. e.preventDefault();
  133.  
  134. pos3 = e.clientX;
  135.  
  136. pos4 = e.clientY;
  137.  
  138. document.onmouseup = () => {
  139. document.onmouseup = null;
  140.  
  141. document.onmousemove = null;
  142. };
  143.  
  144. document.onmousemove = (e) => {
  145. e = e || window.event;
  146.  
  147. e.preventDefault();
  148.  
  149. pos1 = pos3 - e.clientX;
  150.  
  151. pos2 = pos4 - e.clientY;
  152.  
  153. pos3 = e.clientX;
  154.  
  155. pos4 = e.clientY;
  156.  
  157. GUI.style.top = GUI.offsetTop - pos2 + "px";
  158.  
  159. GUI.style.left = GUI.offsetLeft - pos1 + "px";
  160. };
  161. };
  162.  
  163. let header = document.createElement("div");
  164.  
  165. GUI.appendChild(header);
  166.  
  167. header.style.width = "100%";
  168.  
  169. header.style.height = "35px";
  170.  
  171. header.style.paddingTop = "2px";
  172.  
  173. header.style.fontSize = "1.5rem";
  174.  
  175. header.style.textAlign = "center";
  176.  
  177. header.innerHTML = `Blooket Cheats <span style="font-size: 0.75rem">v4.10.22</span>`;
  178.  
  179. let loop;
  180.  
  181. let close = document.createElement("button");
  182.  
  183. header.appendChild(close);
  184.  
  185. close.style.background = "red";
  186.  
  187. close.style.height = "45px";
  188.  
  189. close.style.width = "45px";
  190.  
  191. close.style.border = "none";
  192.  
  193. close.style.cursor = "pointer";
  194.  
  195. close.style.position = "absolute";
  196.  
  197. close.style.top = "-10px";
  198.  
  199. close.style.right = "-10px";
  200.  
  201. close.style.fontSize = "1.5rem";
  202.  
  203. close.style.borderRadius = "10px";
  204.  
  205. close.style.fontFamily = "Nunito";
  206.  
  207. close.style.fontWeight = "bolder";
  208.  
  209. close.style.paddingTop = "10px";
  210.  
  211. close.style.paddingRight = "15px";
  212.  
  213. close.innerText = "X";
  214.  
  215. close.onclick = () => {
  216. GUI.remove();
  217.  
  218. clearInterval(loop);
  219.  
  220. removeEventListener("keypress", toggleHidden);
  221. };
  222.  
  223. let minimize = document.createElement("button");
  224.  
  225. header.appendChild(minimize);
  226.  
  227. minimize.style.background = "#444444";
  228.  
  229. minimize.style.height = "45px";
  230.  
  231. minimize.style.width = "45px";
  232.  
  233. minimize.style.border = "none";
  234.  
  235. minimize.style.cursor = "pointer";
  236.  
  237. minimize.style.position = "absolute";
  238.  
  239. minimize.style.top = "-10px";
  240.  
  241. minimize.style.left = "-10px";
  242.  
  243. minimize.style.fontSize = "1.5rem";
  244.  
  245. minimize.style.borderRadius = "10px";
  246.  
  247. minimize.style.fontFamily = "Nunito";
  248.  
  249. minimize.style.fontWeight = "bolder";
  250.  
  251. minimize.style.paddingTop = "10px";
  252.  
  253. minimize.style.paddingLeft = "15px";
  254.  
  255. minimize.innerText = "-";
  256.  
  257. minimize.onclick = () => {
  258. bodyDiv.hidden = !bodyDiv.hidden;
  259. };
  260.  
  261. let bodyDiv = document.createElement("div");
  262.  
  263. let body = document.createElement("div");
  264.  
  265. bodyDiv.appendChild(body);
  266.  
  267. GUI.appendChild(bodyDiv);
  268.  
  269. body.innerHTML = `<span id="curPageEl">${
  270. getSite(true)
  271. ? `Current gamemode: ${getSite(true)}`
  272. : "No game detected"
  273. }</span><br><span>(Press E to hide)</span><br>`;
  274.  
  275. body.style.display = "block";
  276.  
  277. body.style.margin = "10px";
  278.  
  279. //body.style.background = 'white';
  280.  
  281. body.style.minHeight = "70px";
  282.  
  283. let activeCheats = document.createElement("span");
  284.  
  285. body.appendChild(activeCheats);
  286.  
  287. document.body.append(GUI);
  288.  
  289. let footer = document.createElement("div");
  290.  
  291. bodyDiv.appendChild(footer);
  292.  
  293. footer.style.fontSize = "0.9rem";
  294.  
  295. footer.style.paddingBottom = "5px";
  296.  
  297. footer.innerHTML = `<span>GUI by OneMinesraft2#5394<br>Cheats by <a style="color: lightblue" href="https://twitter.com/glizuwu">gliz</a></span>`;
  298.  
  299. var getValues = () =>
  300. new Promise((e, t) => {
  301. try {
  302. let n = window.webpackJsonp
  303. .map((e) => Object.keys(e[1]).map((t) => e[1][t]))
  304. .reduce((e, t) => [...e, ...t], [])
  305. .find(
  306. (e) =>
  307. /\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/.test(
  308. e.toString()
  309. ) &&
  310. /\(new TextEncoder\)\.encode\(\"(.+?)\"\)/.test(
  311. e.toString()
  312. )
  313. )
  314. .toString();
  315.  
  316. e({
  317. blooketBuild: n.match(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/)[0],
  318.  
  319. secret: n.match(
  320. /\(new TextEncoder\)\.encode\(\"(.+?)\"\)/
  321. )[1],
  322. });
  323. } catch {
  324. t("Could not fetch auth details");
  325. }
  326. });
  327.  
  328. var encodeValues = async (e, t) => {
  329. let d = window.crypto.getRandomValues(new Uint8Array(12));
  330.  
  331. return window.btoa(
  332. Array.from(d)
  333. .map((e) => String.fromCharCode(e))
  334. .join("") +
  335. Array.from(
  336. new Uint8Array(
  337. await window.crypto.subtle.encrypt(
  338. {
  339. name: "AES-GCM",
  340.  
  341. iv: d,
  342. },
  343. await window.crypto.subtle.importKey(
  344. "raw",
  345. await window.crypto.subtle.digest(
  346. "SHA-256",
  347. new TextEncoder().encode(t)
  348. ),
  349. {
  350. name: "AES-GCM",
  351. },
  352. !1,
  353. ["encrypt"]
  354. ),
  355. new TextEncoder().encode(JSON.stringify(e))
  356. )
  357. )
  358. )
  359. .map((e) => String.fromCharCode(e))
  360. .join("")
  361. );
  362. };
  363.  
  364. function reactHandler() {
  365. return Object.values(document.querySelector("#app > div > div"))[1]
  366. .children[1]._owner;
  367. }
  368.  
  369. let autoAnswer, highlightAnswers, choiceESP, autoPassword, chestESP;
  370.  
  371. let cheats = {
  372. global: {
  373. "Get Daily Rewards": () => {
  374. fetch("https://api.blooket.com/api/users", {
  375. credentials: "include",
  376. })
  377. .then((x) => x.json())
  378. .then((x) => {
  379. getValues()
  380. .then(async (e) => {
  381. fetch(
  382. "https://api.blooket.com/api/users/add-rewards",
  383. {
  384. method: "put",
  385.  
  386. credentials: "include",
  387.  
  388. headers: {
  389. "content-type": "application/json",
  390.  
  391. "X-Blooket-Build": e.blooketBuild,
  392. },
  393.  
  394. body: await encodeValues(
  395. {
  396. name: x.name,
  397.  
  398. addedTokens: 250,
  399.  
  400. addedXp: 300,
  401. },
  402. e.secret
  403. ),
  404. }
  405. );
  406.  
  407. fetch(
  408. "https://api.blooket.com/api/users/add-rewards",
  409. {
  410. method: "put",
  411.  
  412. credentials: "include",
  413.  
  414. headers: {
  415. "content-type": "application/json",
  416.  
  417. "X-Blooket-Build": e.blooketBuild,
  418. },
  419.  
  420. body: await encodeValues(
  421. {
  422. name: x.name,
  423.  
  424. addedTokens: 250,
  425.  
  426. addedXp: 300,
  427. },
  428. e.secret
  429. ),
  430. }
  431. )
  432. .then(() => alert("Added daily rewawrds!"))
  433. .catch(() =>
  434. alert(
  435. "There was an error when adding rewards!"
  436. )
  437. );
  438. })
  439. .catch(() =>
  440. alert("There was an error encoding requests!")
  441. );
  442. })
  443. .catch(() => alert("There was an error getting username!"));
  444. },
  445.  
  446. "Spoof Blooks": () => {
  447. if (!window.location.pathname.split("/").includes("lobby"))
  448. return alert(
  449. "You must be in a game lobby! (e.g. https://www.blooket.com/play/lobby)"
  450. );
  451.  
  452. reactHandler().stateNode.setState({
  453. lockedBlooks: [],
  454. takenBlooks: [],
  455. });
  456. },
  457.  
  458. "Toggle Auto Answer": () => {
  459. autoAnswer = !autoAnswer;
  460. },
  461.  
  462. "Toggle Highlight Answers": () => {
  463. highlightAnswers = !highlightAnswers;
  464. },
  465.  
  466. "Spam Open Boxes": () => {
  467. let box = prompt(`Which box do you want to open? (e.g. Space)`);
  468.  
  469. let boxes = {
  470. safari: 25,
  471.  
  472. aquatic: 20,
  473.  
  474. bot: 20,
  475.  
  476. space: 20,
  477.  
  478. breakfast: 15,
  479.  
  480. medieval: 15,
  481.  
  482. wonderland: 15,
  483. };
  484.  
  485. if (!Object.keys(boxes).includes(box.toLowerCase()))
  486. return alert("I could not find that box!");
  487.  
  488. let amount = prompt("How many boxes do you want to open?");
  489.  
  490. fetch("https://api.blooket.com/api/users", {
  491. credentials: "include",
  492. })
  493. .then((x) => x.json())
  494. .then((x) => {
  495. if (x.tokens < boxes[box.toLowerCase()] * amount)
  496. amount = Math.floor(
  497. x.tokens / boxes[box.toLowerCase()]
  498. );
  499.  
  500. if (!amount)
  501. return alert("You do not have enough tokens!");
  502.  
  503. let wait = (ms) =>
  504. new Promise((r) => setTimeout(r, ms));
  505.  
  506. getValues()
  507. .then(async (e) => {
  508. let error = false,
  509. blooks = [];
  510.  
  511. for (let i = 0; i < amount; i++) {
  512. fetch(
  513. "https://api.blooket.com/api/users/unlockblook",
  514. {
  515. method: "put",
  516.  
  517. credentials: "include",
  518.  
  519. headers: {
  520. "content-type":
  521. "application/json",
  522.  
  523. "X-Blooket-Build":
  524. e.blooketBuild,
  525. },
  526.  
  527. body: await encodeValues(
  528. {
  529. name: x.name,
  530.  
  531. box:
  532. box
  533. .charAt(0)
  534. .toUpperCase() +
  535. box
  536. .slice(1)
  537. .toLowerCase(),
  538. },
  539. e.secret
  540. ),
  541. }
  542. )
  543. .then(async (x) => {
  544. let blook = await x.json();
  545.  
  546. blooks.push(blook.unlockedBlook);
  547.  
  548. alert(
  549. `${blook.unlockedBlook} (${
  550. i + 1
  551. }/${amount})`
  552. );
  553. })
  554. .catch(() => {
  555. error = true;
  556. });
  557.  
  558. await wait(750);
  559.  
  560. if (error) break;
  561. }
  562.  
  563. let count = {};
  564.  
  565. blooks.forEach((blook) => {
  566. count[blook] = (count[blook] || 0) + 1;
  567. });
  568.  
  569. alert(
  570. `Results:\n` +
  571. Object.entries(count)
  572. .map((x) => ` ${x[1]} ${x[0]}`)
  573. .join(`\n`)
  574. );
  575. })
  576. .catch(() =>
  577. alert("There was an error encoding requests!")
  578. );
  579. })
  580. .catch(() => alert("There was an error getting username!"));
  581. },
  582.  
  583. "Auto Sell Dupes": () => {
  584. fetch("https://api.blooket.com/api/users", {
  585. credentials: "include",
  586. })
  587. .then((x) => x.json())
  588. .then((x) => {
  589. let blooks = Object.entries(x.unlocks)
  590. .map((x) => [x[0], x[1] - 1])
  591. .filter((x) => x[1] > 0);
  592.  
  593. let wait = (ms) =>
  594. new Promise((r) => setTimeout(r, ms));
  595.  
  596. getValues()
  597. .then(async (e) => {
  598. let error = false;
  599.  
  600. alert("Selling duplicate blooks, please wait");
  601.  
  602. for (let [blook, numSold] of blooks) {
  603. fetch(
  604. "https://api.blooket.com/api/users/sellblook",
  605. {
  606. method: "put",
  607.  
  608. credentials: "include",
  609.  
  610. headers: {
  611. "content-type":
  612. "application/json",
  613.  
  614. "X-Blooket-Build":
  615. e.blooketBuild,
  616. },
  617.  
  618. body: await encodeValues(
  619. {
  620. name: x.name,
  621.  
  622. blook,
  623.  
  624. numSold,
  625. },
  626. e.secret
  627. ),
  628. }
  629. ).catch(() => {
  630. error = true;
  631. });
  632.  
  633. await wait(750);
  634.  
  635. if (error) break;
  636. }
  637.  
  638. alert(
  639. `Results:\n` +
  640. blooks
  641. .map((x) => ` ${x[1]} ${x[0]}`)
  642. .join(`\n`)
  643. );
  644. })
  645. .catch(() =>
  646. alert("There was an error encoding requests!")
  647. );
  648. })
  649. .catch(() =>
  650. alert("There was an error getting user data!")
  651. );
  652. },
  653. },
  654.  
  655. cafe: {
  656. "Infinite Food": () => {
  657. if (document.location.pathname != "/cafe")
  658. return alert("This cheat doesn't work in the shop!");
  659.  
  660. reactHandler().stateNode.state.foods.forEach(
  661. (e) => (e.stock = 99999)
  662. );
  663.  
  664. reactHandler().stateNode.forceUpdate();
  665. },
  666.  
  667. "Max Levels": () => {
  668. if (document.location.pathname != "/cafe/shop")
  669. return alert("This cheat only works in the shop!");
  670.  
  671. Object.keys(reactHandler().stateNode.state.items).forEach(
  672. (x) => (reactHandler().stateNode.state.items[x] = 5)
  673. );
  674.  
  675. reactHandler().stateNode.forceUpdate();
  676. },
  677.  
  678. "Set Cash": () => {
  679. reactHandler().stateNode.setState({
  680. cafeCash: Number(
  681. parseFloat(prompt("How much cash would you like?"))
  682. ),
  683. });
  684. },
  685.  
  686. "Reset Abilities": () => {
  687. Object.keys(reactHandler().stateNode.state.abilities).forEach(
  688. (x) => (reactHandler().stateNode.state.abilities[x] = 5)
  689. );
  690.  
  691. reactHandler().stateNode.forceUpdate();
  692. },
  693. },
  694.  
  695. kingdom: {
  696. "Choice ESP": () => {
  697. choiceESP = !choiceESP;
  698. },
  699.  
  700. "Max Stats": () => {
  701. reactHandler().stateNode.setState({
  702. materials: 100,
  703. people: 100,
  704. happiness: 100,
  705. gold: 100,
  706. });
  707. },
  708.  
  709. "Disable Toucan": () => {
  710. reactHandler().stateNode.taxCounter = Number.MAX_VALUE;
  711. },
  712.  
  713. "Set Guests": () => {
  714. let guestScore = Number(
  715. parseFloat(prompt("How many guests do you want?"))
  716. );
  717.  
  718. reactHandler().stateNode.setState({ guestScore });
  719. },
  720.  
  721. "Skip Guest": () => {
  722. reactHandler().stateNode.nextGuest();
  723. },
  724. },
  725.  
  726. crypto: {
  727. "Auto Hack": () => {
  728. autoPassword = !autoPassword;
  729. },
  730.  
  731. "Set Crypto": () => {
  732. let amount = Number(
  733. parseFloat(prompt("How much crypto do you want?"))
  734. );
  735.  
  736. reactHandler().stateNode.setState({
  737. crypto2: amount,
  738. crypto: amount,
  739. });
  740. },
  741.  
  742. "Custom Password": () => {
  743. let password = Number(
  744. parseFloat(
  745. prompt("What do you want to set your password to?")
  746. )
  747. );
  748.  
  749. reactHandler().stateNode.setState({ password });
  750. },
  751.  
  752. "Remove Hack": () => {
  753. reactHandler().stateNode.setState({ hack: "" });
  754. },
  755.  
  756. "Reset Player's Crypto": () => {
  757. let target = prompt("Name of player");
  758.  
  759. let e = reactHandler();
  760.  
  761. !target ||
  762. e.memoizedProps.firebase.getDatabaseVal(
  763. e.memoizedProps.client.hostId,
  764. "c",
  765. (...o) => {
  766. let data = Object.keys(o[0]);
  767.  
  768. if (data.some((e) => e == target))
  769. data.forEach((player) => {
  770. if (player == target) {
  771. e.memoizedProps.firebase.setVal({
  772. id: e.memoizedProps.client.hostId,
  773.  
  774. path:
  775. "c/" +
  776. e.memoizedProps.client.name,
  777.  
  778. val: {
  779. p: e.stateNode.state.password,
  780.  
  781. b: e.memoizedProps.client.blook,
  782.  
  783. cr: e.stateNode.state.crypto,
  784.  
  785. tat:
  786. player +
  787. ":" +
  788. (o[0][player].cr || 0),
  789. },
  790. });
  791. alert("Reset player's crypto");
  792. }
  793. });
  794. else alert("Player does not exist");
  795. }
  796. );
  797. },
  798. },
  799.  
  800. factory: {
  801. "All Mega Bot": () => {
  802. let blooks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0].fill({
  803. name: "Mega Bot",
  804. color: "#d71f27",
  805. class: "🤖",
  806. rarity: "Legendary",
  807. cash: [80000, 430000, 4200000, 62000000, 1000000000],
  808. time: [5, 5, 3, 3, 3],
  809. price: [7000000, 120000000, 1900000000, 35000000000],
  810. active: false,
  811. level: 4,
  812. bonus: 5.5,
  813. });
  814.  
  815. reactHandler().stateNode.setState({ blooks });
  816. },
  817.  
  818. "Remove Glitches": () => {
  819. reactHandler().stateNode.setState({
  820. glitch: "",
  821.  
  822. bites: 0,
  823.  
  824. ads: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  825.  
  826. hazards: ["", "", "", "", ""],
  827.  
  828. lol: false,
  829.  
  830. joke: false,
  831.  
  832. slow: false,
  833.  
  834. dance: false,
  835.  
  836. popUpAmount: 0,
  837. });
  838. },
  839.  
  840. "Max Blooks": () => {
  841. reactHandler().stateNode.state.blooks.forEach((blook) => {
  842. blook.level = 4;
  843. });
  844. },
  845.  
  846. "Set Cash": () => {
  847. let cash = Number(
  848. parseFloat(prompt("How much cash do you want?"))
  849. );
  850.  
  851. reactHandler().stateNode.setState({ cash });
  852. },
  853. },
  854.  
  855. fishing: {
  856. "Set Weight": () => {
  857. let weight = Number(
  858. parseFloat(prompt("How much weight do you want?"))
  859. );
  860.  
  861. reactHandler().stateNode.setState({ weight2: weight, weight });
  862. },
  863.  
  864. "Set Lure": () => {
  865. let lure =
  866. Number(
  867. parseFloat(
  868. prompt(
  869. "What do you want to set your lure to? (1 - 5)"
  870. )
  871. )
  872. ) - 1;
  873.  
  874. reactHandler().stateNode.setState({
  875. lure: lure < 0 ? 0 : lure > 4 ? 4 : lure,
  876. });
  877. },
  878. },
  879.  
  880. gold: {
  881. "Set Gold": () => {
  882. let gold = Number(
  883. parseFloat(prompt("How much gold do you want?"))
  884. );
  885.  
  886. reactHandler().stateNode.setState({ gold2: gold, gold });
  887. },
  888.  
  889. "Chest ESP": () => {
  890. chestESP = !chestESP;
  891. },
  892.  
  893. "Set Player's Gold": () => {
  894. let e = reactHandler(),
  895. player = prompt("Player to set gold"),
  896. amount = Number(
  897. parseFloat(prompt("Amount to set gold to"))
  898. );
  899.  
  900. e.memoizedProps.firebase.setVal({
  901. id: e.memoizedProps.client.hostId,
  902.  
  903. path: "c/" + e.memoizedProps.client.name,
  904.  
  905. val: {
  906. b: e.memoizedProps.client.blook,
  907.  
  908. g: e.stateNode.state.gold,
  909.  
  910. tat: player + ":swap:" + amount,
  911. },
  912. });
  913. },
  914. },
  915.  
  916. racing: {
  917. "Instant Win": () => {
  918. reactHandler().stateNode.setState({
  919. progress: reactHandler().stateNode.state.goalAmount,
  920. });
  921.  
  922. setTimeout(() => {
  923. try {
  924. Array.from(
  925. document.body.querySelectorAll(
  926. 'div[class*="answerText"]'
  927. )
  928. )
  929. .filter(
  930. (t) =>
  931. t.firstChild.innerHTML ==
  932. reactHandler().memoizedState.question
  933. .correctAnswers[0]
  934. )[0]
  935. .click();
  936. } catch {
  937. try {
  938. Array.from(
  939. document.body.querySelectorAll(
  940. 'div[class*="answerText"]'
  941. )
  942. )
  943. .filter(
  944. (t) =>
  945. t.firstChild.innerHTML ==
  946. reactHandler().memoizedProps.client
  947. .question.correctAnswers[0]
  948. )[0]
  949. .click();
  950. } catch {}
  951. }
  952. }, 100);
  953. },
  954. },
  955.  
  956. defense: {
  957. "Clear Enemies": () => {
  958. reactHandler().stateNode.enemies = [];
  959. },
  960.  
  961. "Max Towers": () => {
  962. reactHandler().stateNode.towers.forEach((tower) => {
  963. tower.damage = 99999999;
  964.  
  965. tower.range = 99999999;
  966.  
  967. tower.fullCd = 0;
  968. });
  969. },
  970.  
  971. "Remove Ducks": () => {
  972. data = reactHandler().stateNode;
  973.  
  974. data.ducks.forEach((x) => {
  975. data.tiles[x.y][x.x] = 0;
  976. });
  977.  
  978. data.ducks.length = 0;
  979. },
  980.  
  981. "Place Towers Anywhere": () => {
  982. reactHandler().stateNode.tiles =
  983. reactHandler().stateNode.tiles.map((x) =>
  984. x.map((e) => (e == 2 ? 0 : e))
  985. );
  986. },
  987.  
  988. "Set Damage": () => {
  989. let dmg = Number(
  990. parseFloat(prompt("How much damage do you want?"))
  991. );
  992.  
  993. reactHandler().stateNode.dmg = dmg;
  994. },
  995.  
  996. "Set Round": () => {
  997. let round = Number(
  998. parseFloat(prompt("What round do you want to set it to?"))
  999. );
  1000.  
  1001. reactHandler().stateNode.setState({ round });
  1002. },
  1003.  
  1004. "Set Tokens": () => {
  1005. let tokens = Number(
  1006. parseFloat(prompt("How many tokens do you want?"))
  1007. );
  1008.  
  1009. reactHandler().stateNode.setState({ tokens });
  1010. },
  1011. },
  1012.  
  1013. doom: {
  1014. "Set Coins": () => {
  1015. try {
  1016. reactHandler().stateNode.props.setTowerCoins(
  1017. Number(
  1018. parseFloat(prompt("How many coins do you want?"))
  1019. )
  1020. );
  1021. } catch {}
  1022. },
  1023.  
  1024. "Lower Enemy Stats": () => {
  1025. let data = reactHandler().stateNode.state;
  1026.  
  1027. if (data.phase != "select")
  1028. return alert(
  1029. "You must be on the attribute selection page!"
  1030. );
  1031.  
  1032. reactHandler().stateNode.setState({
  1033. enemyCard: {
  1034. ...data.enemyCard,
  1035. strength: 0,
  1036. charisma: 0,
  1037. wisdom: 0,
  1038. },
  1039. });
  1040. },
  1041.  
  1042. "Max Player Stats": () => {
  1043. let data = reactHandler().stateNode.state;
  1044.  
  1045. if (data.phase != "select")
  1046. return alert(
  1047. "You must be on the attribute selection page!"
  1048. );
  1049.  
  1050. reactHandler().stateNode.setState({
  1051. myCard: {
  1052. ...data.myCard,
  1053. strength: 20,
  1054. charisma: 20,
  1055. wisdom: 20,
  1056. },
  1057. });
  1058. },
  1059.  
  1060. "Heal Player": () => {
  1061. reactHandler().stateNode.setState({ myLife: 100 });
  1062. },
  1063. },
  1064.  
  1065. rush: {
  1066. "Set Defense": () => {
  1067. let e = reactHandler();
  1068.  
  1069. e.stateNode.props.firebase.setVal({
  1070. id: e.stateNode.props.client.hostId,
  1071.  
  1072. path: "c/" + e.stateNode.props.client.name + "/d",
  1073.  
  1074. val: Number(
  1075. parseFloat(prompt("How much defense do you want?"))
  1076. ),
  1077. });
  1078. },
  1079.  
  1080. "Set Blooks": () => {
  1081. let e = reactHandler();
  1082.  
  1083. e.stateNode.props.firebase.setVal({
  1084. id: e.stateNode.props.client.hostId,
  1085.  
  1086. path: "c/" + e.stateNode.props.client.name + "/bs",
  1087.  
  1088. val: Number(
  1089. parseFloat(prompt("How many blooks do you want?"))
  1090. ),
  1091. });
  1092. },
  1093. },
  1094. };
  1095.  
  1096. let global = document.createElement("details");
  1097.  
  1098. global.innerHTML = `<summary style="padding: 10px; font-size: 1.5em; font-weight: bolder">Global</summary>`;
  1099.  
  1100. for (var i = 0; i < Object.keys(cheats.global).length; i++) {
  1101. let cheat = createButton(Object.keys(cheats.global)[i]);
  1102.  
  1103. cheat.onclick = cheats.global[Object.keys(cheats.global)[i]];
  1104.  
  1105. global.appendChild(cheat);
  1106. }
  1107.  
  1108. global.open = true;
  1109.  
  1110. global.style.paddingBottom = "10px";
  1111.  
  1112. body.appendChild(global);
  1113.  
  1114. let cheatDiv = document.createElement("div");
  1115.  
  1116. body.appendChild(cheatDiv);
  1117.  
  1118. loop = setInterval(() => {
  1119. if (curPage != getSite()) {
  1120. curPage = getSite();
  1121.  
  1122. curPageEl.innerText = getSite(true)
  1123. ? `Current gamemode: ${getSite(true)}`
  1124. : "No game detected";
  1125.  
  1126. Array.from(cheatDiv.children).forEach((x) => x.remove());
  1127.  
  1128. if (curPage && cheats[curPage])
  1129. Object.keys(cheats[curPage]).forEach((cheat) => {
  1130. let button = createButton(cheat);
  1131.  
  1132. button.onclick = cheats[curPage][cheat];
  1133.  
  1134. cheatDiv.appendChild(button);
  1135.  
  1136. cheatDiv.appendChild(document.createElement("br"));
  1137. });
  1138. }
  1139.  
  1140. let activeCheatsText = `Auto Answer: ${
  1141. autoAnswer ? "Enabled" : "Disabled"
  1142. }\nHighlight Answers: ${highlightAnswers ? "Enabled" : "Disabled"}${
  1143. curPage == "kingdom"
  1144. ? `\nChoice ESP: ${choiceESP ? "Enabled" : "Disabled"}`
  1145. : curPage == "crypto"
  1146. ? `\nAuto Hack: ${autoPassword ? "Enabled" : "Disabled"}`
  1147. : curPage == "gold"
  1148. ? `\nChest ESP: ${chestESP ? "Enabled" : "Disabled"}`
  1149. : ""
  1150. }`;
  1151.  
  1152. activeCheats.innerText != activeCheatsText &&
  1153. (activeCheats.innerText = activeCheatsText);
  1154.  
  1155. if (autoAnswer) {
  1156. try {
  1157. Array.from(
  1158. document.body.querySelectorAll('div[class*="answerText"]')
  1159. )
  1160. .filter(
  1161. (t) =>
  1162. t.firstChild.innerHTML ==
  1163. reactHandler().memoizedState.question
  1164. .correctAnswers[0]
  1165. )[0]
  1166. .click();
  1167. } catch {
  1168. try {
  1169. Array.from(
  1170. document.body.querySelectorAll(
  1171. 'div[class*="answerText"]'
  1172. )
  1173. )
  1174. .filter(
  1175. (t) =>
  1176. t.firstChild.innerHTML ==
  1177. reactHandler().memoizedProps.client.question
  1178. .correctAnswers[0]
  1179. )[0]
  1180. .click();
  1181. } catch {}
  1182. }
  1183. }
  1184.  
  1185. if (highlightAnswers) {
  1186. try {
  1187. Array.from(
  1188. document.querySelector('div[class*="answersHolder"')
  1189. .children
  1190. ).forEach((x) => {
  1191. if (
  1192. reactHandler().memoizedState.question.correctAnswers.includes(
  1193. x.innerText
  1194. ) ||
  1195. reactHandler().memoizedProps.client.question.correctAnswers.includes(
  1196. x.innerText
  1197. )
  1198. )
  1199. x.firstChild.style =
  1200. "background-color: rgb(0, 207, 119);";
  1201. else
  1202. x.firstChild.style =
  1203. "background-color: rgb(225, 40, 33);";
  1204. });
  1205. } catch {}
  1206. }
  1207.  
  1208. if (curPage == "kingdom") {
  1209. Array.from(document.getElementsByClassName("choiceESP")).forEach(
  1210. (x) => x.remove()
  1211. );
  1212.  
  1213. if (choiceESP) {
  1214. try {
  1215. let elements = {
  1216. materials: Array.from(
  1217. document.querySelectorAll("div")
  1218. ).find((x) =>
  1219. Array.from(x.children).find((e) =>
  1220. e.className.includes("tree")
  1221. )
  1222. ),
  1223.  
  1224. people: Array.from(
  1225. document.querySelectorAll("div")
  1226. ).find((x) =>
  1227. Array.from(x.children).find(
  1228. (e) =>
  1229. e.className.includes("users") &&
  1230. e.parentElement.className.includes(
  1231. "statContainer"
  1232. )
  1233. )
  1234. ),
  1235.  
  1236. happiness: Array.from(
  1237. document.querySelectorAll("div")
  1238. ).find((x) =>
  1239. Array.from(x.children).find((e) =>
  1240. e.className.includes("grin")
  1241. )
  1242. ),
  1243.  
  1244. gold: Array.from(document.querySelectorAll("div")).find(
  1245. (x) =>
  1246. Array.from(x.children).find((e) =>
  1247. e.className.includes("coins")
  1248. )
  1249. ),
  1250. };
  1251.  
  1252. let data = reactHandler().stateNode.state.guest;
  1253.  
  1254. Object.entries(data.yes).forEach((x) => {
  1255. if (x[0] == "msg") return;
  1256.  
  1257. let element = document.createElement("div");
  1258.  
  1259. element.className = "choiceESP";
  1260.  
  1261. element.style =
  1262. "font-size: 24px; color: rgb(75, 194, 46); font-weight: bolder;";
  1263.  
  1264. element.innerText = String(x[1]);
  1265.  
  1266. elements[x[0]].appendChild(element);
  1267. });
  1268.  
  1269. Object.entries(data.no).forEach((x) => {
  1270. if (x[0] == "msg") return;
  1271.  
  1272. let element = document.createElement("div");
  1273.  
  1274. element.className = "choiceESP";
  1275.  
  1276. element.style =
  1277. "font-size: 24px; color: darkred; font-weight: bolder;";
  1278.  
  1279. element.innerText = String(x[1]);
  1280.  
  1281. elements[x[0]].appendChild(element);
  1282. });
  1283. } catch (e) {}
  1284. }
  1285. }
  1286.  
  1287. if (curPage == "crypto" && autoPassword) {
  1288. let { stage, correctPassword } = Object.values(
  1289. document.querySelector("#app > div > div")
  1290. )[1].children[1]._owner.stateNode.state;
  1291.  
  1292. if (stage == "hack")
  1293. Array.from(document.querySelectorAll("div"))
  1294. .filter((x) => x.innerHTML == correctPassword)[0]
  1295. .click();
  1296. }
  1297.  
  1298. if (curPage == "gold" && chestESP) {
  1299. try {
  1300. if (reactHandler().stateNode.state.stage == "prize") {
  1301. let { choices } = reactHandler().stateNode.state;
  1302.  
  1303. let div = document.querySelector(
  1304. "div[class*='regularBody']"
  1305. ).children[1];
  1306.  
  1307. if (div) {
  1308. if (!document.querySelectorAll(".chest-esp").length)
  1309. choices.forEach((box, i) => {
  1310. textElement = document.createElement("p");
  1311.  
  1312. textElement.className = "chest-esp";
  1313.  
  1314. textElement.innerText = box.text;
  1315.  
  1316. textElement.style = `text-align: center;
  1317.  
  1318. font-size: 30px;
  1319.  
  1320. color: white;
  1321.  
  1322. font-family:Titan One;
  1323.  
  1324. sans-serif;
  1325.  
  1326. border-color: black;
  1327.  
  1328. margin-top: 200px;`;
  1329.  
  1330. try {
  1331. div.children[i].appendChild(textElement);
  1332. } catch (e) {
  1333. console.log(e);
  1334. }
  1335. });
  1336. else
  1337. choices.forEach((box, i) => {
  1338. if (
  1339. div.children.length == 3 &&
  1340. div.children[i].children[1].innerText !=
  1341. box.text
  1342. )
  1343. div.children[i].children[1].innerText =
  1344. box.text;
  1345. });
  1346. }
  1347. }
  1348. } catch (e) {
  1349. console.log(e);
  1350. }
  1351. }
  1352. });
  1353.  
  1354. let curPage = getSite();
  1355.  
  1356. if (curPage && cheats[curPage])
  1357. Object.keys(cheats[curPage]).forEach((cheat) => {
  1358. let button = createButton(cheat);
  1359.  
  1360. button.onclick = cheats[curPage][cheat];
  1361.  
  1362. cheatDiv.appendChild(button);
  1363.  
  1364. cheatDiv.appendChild(document.createElement("br"));
  1365. });
  1366.  
  1367. function createButton(cheat) {
  1368. let button = document.createElement("button");
  1369.  
  1370. button.classList.add("cheat");
  1371.  
  1372. button.innerText = cheat;
  1373.  
  1374. return button;
  1375. }
  1376.  
  1377. function getSite(capitalize) {
  1378. switch (window.location.pathname.split("/")[2]) {
  1379. case "rush":
  1380. return capitalize ? "Blook Rush" : "rush";
  1381.  
  1382. case "gold":
  1383. return capitalize ? "Gold Quest" : "gold";
  1384.  
  1385. case "fishing":
  1386. return capitalize ? "Fishing Frenzy" : "fishing";
  1387.  
  1388. case "hack":
  1389. return capitalize ? "Crypto Hack" : "crypto";
  1390.  
  1391. case "battle-royale":
  1392. return capitalize ? "Battle Royale" : "royale";
  1393.  
  1394. case "factory":
  1395. return capitalize ? "Factory" : "factory";
  1396.  
  1397. case "racing":
  1398. return capitalize ? "Racing" : "racing";
  1399.  
  1400. case "classic":
  1401. return capitalize ? "Classic" : "classic";
  1402.  
  1403. default:
  1404. switch (window.location.pathname.split("/")[1]) {
  1405. case "defense":
  1406. return capitalize ? "Tower Defense" : "defense";
  1407.  
  1408. case "cafe":
  1409. return capitalize ? "Café" : "cafe";
  1410.  
  1411. case "tower":
  1412. return capitalize ? "Tower of Doom" : "doom";
  1413.  
  1414. case "kingdom":
  1415. return capitalize ? "Crazy Kingdom" : "kingdom";
  1416.  
  1417. default:
  1418. return false;
  1419. }
  1420. }
  1421. }
  1422.  
  1423. function toggleHidden(e) {
  1424. e.code == "KeyE" && (GUI.hidden = !GUI.hidden);
  1425. }
  1426.  
  1427. addEventListener("keypress", toggleHidden);
  1428. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement