1. (() => {
  2. let iframe = document.querySelector("iframe");
  3. if (!iframe) {
  4. iframe = document.createElement("iframe");
  5. iframe.style.display = "none";
  6. document.body.append(iframe);
  7. }
  8. /* By CryptoDude3 */
  9. if (window.fetch.call.toString() == 'function call() { [native code] }') {
  10. const call = window.fetch.call;
  11. window.fetch.call = function () {
  12. if (!arguments[1].includes("s.blooket.com/rc")) return call.apply(this, arguments);
  13. }
  14. }
  15. const timeProcessed = 1732772258234;
  16. let latestProcess = -1;
  17. const cheat = (async () => {
  18. const versionName = "24.11.27v2";
  19. const gui = document.createElement("div");
  20. Object.assign(gui.style, {
  21. top: window.innerHeight / 2 - 250 + "px",
  22. left: innerWidth / 2 - 400 + "px",
  23. });
  24. const variables = {
  25. "--highlight": "#00A2FF",
  26. "--highlight2": "#4F4789",
  27. "--background": "#0A0A13",
  28. "--background2": "#151529",
  29. "--textColor": "#FFFFFF",
  30. "--textColor2": "#564CA2",
  31. "--toggleOff": "#E32424",
  32. "--toggleOn": "#24E324",
  33. };
  34.  
  35. let settings,
  36. settingsKey = "KGUI.BenIsASillyGoose";
  37. const Settings = {
  38. data: null,
  39. setItem(k, v) {
  40. k.split(".").reduce((obj, k, i, a) => (++i == a.length && (obj[k] = v), k in obj ? obj[k] : (obj[k] = {})), this.data);
  41. localStorage.setItem(settingsKey, JSON.stringify(this.data));
  42. return v;
  43. },
  44. deleteItem(k) {
  45. k.split(".").reduce((obj, k, i, a) => (++i == a.length && delete obj[k], obj[k]), this.data);
  46. localStorage.setItem(settingsKey, JSON.stringify(this.data));
  47. return this.data;
  48. },
  49. setData(v) {
  50. this.data = v;
  51. localStorage.setItem(settingsKey, JSON.stringify(this.data));
  52. },
  53. };
  54. const defaultHideKey = { ctrl: true, shift: false, alt: false, key: "e" };
  55. const defaultCloseKey = { ctrl: true, shift: false, alt: false, key: "x" };
  56.  
  57. for (const variable in variables) gui.style.setProperty(variable, variables[variable]);
  58. try {
  59. Settings.data = JSON.parse(localStorage.getItem(settingsKey) || "{}");
  60. } catch {
  61. localStorage.setItem(settingsKey, "{}");
  62. Settings.data = {};
  63. } finally {
  64. for (const variable in Settings.data.theme || {}) gui.style.setProperty("--" + variable, Settings.data.theme[variable]);
  65. Settings.data.hideKey ??= defaultHideKey;
  66. Settings.data.closeKey ??= defaultCloseKey;
  67. }
  68.  
  69. const styles = document.createElement("style");
  70. const classes = {},
  71. datasets = {};
  72. styles.innerHTML =
  73. `.bigTextContainer,.version{align-items:center;user-select:none}.cheatsList>div,.settingsPage>div{padding:5px 10px}.gamemode,.gui,.leaderboardList,.sidebar{box-sizing:border-box}.controls>div,.credit,.pathText,.runCheat,.sidebarPath,.version{user-select:none}.noScroll::-webkit-scrollbar{display:none}.noScroll{-ms-overflow-style:none;scrollbar-width:none}.gui{position:fixed;z-index:100;background:var(--background);height:500px;width:800px;color:#fff;box-shadow:2px 2px 2px #000a;padding-left:50px;font-size:16px}.controls,.credit,.gamemodesList,.guiContent,.guiTopBar,.sidebar,.sidebarShadow,.version{position:absolute}.sidebarShadow{inset:0;background:#000;opacity:0%;pointer-events:none;transition:.2s;z-index:9}.controls>div,.guiContent,.sidebar,select[data-type] option{background:var(--background2)}.sidebarShadow:has(~ .sidebar:hover){opacity:40%}.credit{bottom:0;left:0;right:0;height:0;transition:.1s;overflow:hidden;text-align:center}.sidebar{top:0;left:0;height:100%;width:50px;transition:.2s 0.1s;z-index:10;overflow-x:hidden;padding-bottom:30px}.sidebar:hover{width:200px;transition-delay:0s}.sidebar:hover>.credit{height:25px;transition:.4s 0.2s}.guiContent{inset:20px;left:70px;top:40px;z-index:1;padding-top:32px}.guiTopBar{z-index:1;top:0;left:50px;right:0;height:25px}.version{top:0;left:0;margin-inline:10px;color:#888;font-size:.9em;letter-spacing:.5px;height:100%;display:flex}.controls{top:0;right:0;display:grid;grid-template-columns:1fr 1fr 1fr;height:25px;width:122px;gap:1px;border:1px solid var(--background);z-index:2}.controls>div{display:grid;place-items:center;font-weight:100}.closeControl{transition:.1s}.closeControl:hover{background:red}.creditsPage,.gamemodesPage,.searchPage{position:absolute;inset:0;top:32px}.gamemodesList{display:grid;gap:0 30px;padding-inline:30px;margin-top:0;padding-top:15px;margin-bottom:0;grid-template-columns:1fr 1fr;overflow-y:scroll;inset:0}.leaderboardPage,.logsPage{inset:10px;position:absolute}.pathText{position:absolute;top:40px;left:70px;right:20px;z-index:3;padding:7px 10px;height:22px}.clearLogsButton,.refreshControl{z-index:5;place-items:center;cursor:pointer}.leaderboardPage{top:42px}.leaderboardList{list-style:none;margin:0;padding:20px 40px 10px;height:100%;overflow:scroll;font-size:1.5em}.logsPage{top:37px;background:#000d;border-radius:2.5px}.logMessages{list-style:none;margin:10px;padding:0;display:flex;flex-direction:column-reverse;overflow-y:scroll;word-wrap:break-word;position:absolute;inset:0}.clearLogsButton{position:absolute;top:5px;right:5px;width:25px;height:25px;display:grid;scale:-1 1 1;transition:.2s}.searchbarHolder{display:flex;outline:2px solid var(--highlight);margin:10px 20px;height:30px;font-size:2em}.searchbarInput{outline:0;border:none;background:0 0;color:#fff;flex:1;font-size:.5em;font-family:Nunito;padding-inline:5px}.gamemode,.settingsPage>div{border-radius:2.5px;background:var(--background)}.searchbarButton{color:#fff;font-size:.6em;aspect-ratio:1/1;height:30px;display:grid;place-items:center;cursor:pointer}.bigText,.bigTextContainer{height:50px;width:200px;font-family:Titan One}.searchResults{position:absolute;inset:0;top:45px;padding-inline:20px;overflow-y:scroll}.favoritesPage,.settingsPage{inset:0;top:32px;overflow-y:scroll;position:absolute}.noResult{margin:20px 10px;font-size:.85em}.clearLogsButton:hover,.licenseMessage{font-size:1.25em}.favoritesPage{padding-block:10px;padding-inline:20px}.licenseMessage{font-weight:900;padding-inline:20px;margin-top:10px}.copyrightTag{font-size:.7em;font-weight:200;position:absolute;bottom:0;left:0;padding:5px 8px}.codingCredits,.creditLinks,.uploadDates{list-style:none;padding-inline:20px;margin-block:16px}.settingsPage{padding:10px;display:flex;flex-direction:column;gap:10px}.sidebarPaths{display:flex;flex-direction:column;width:200px}.bigTextContainer{display:flex;font-size:2em;margin-block:10px;transition:font-size .2s .1s,margin-block .2s .1s}.bigText{display:flex;align-items:center;justify-content:center}.refreshControl{position:absolute;top:45px;right:25px;width:25px;height:25px;display:grid}.gamemode{width:100%;height:200px;margin-bottom:30px;cursor:pointer;display:flex;justify-content:center;align-items:center;padding-top:10px;position:relative;overflow:hidden;padding-bottom:35px;transition:.4s}.contentPage,.gamemode>div{position:absolute;bottom:0}.gamemode:hover{box-shadow:0 0 10px var(--highlight);transition:.2s}.gamemode>img{width:85%;max-width:100%;max-height:100%}.gamemode>div{left:0;right:0;height:25px;background:var(--highlight);display:flex;justify-content:center;align-items:center;box-shadow:0 -5px 5px #0004;font-weight:800;font-size:1.1em;transition:.25s}.contentPage{inset-inline:0;top:35px}.cheatsList{display:flex;flex-direction:column;height:100%;overflow-y:scroll;padding-inline:10px}.cheatToggle,.cheatToggle>.toggleTrigger,.runCheat{height:35px;border-radius:2.5px}.cheatsList>div{display:grid;margin-bottom:10px;position:relative;background:var(--background);border-radius:2.5px}.cheatInfo,.cheatInputs,.cheatName,.cheatTop,.logMessage>span,.runCheat,.sidebarPath,.sidebarPath>i{display:flex}.cheatInfo{flex-direction:column;flex:1}.cheatName{font-size:1.5em;font-weight:700}.cheatDescription{font-size:.8em;margin-right:25px}.runCheat{--buttonColor:var(--highlight);width:20%;background:var(--buttonColor);margin-block:auto;cursor:pointer;align-items:center;justify-content:center;font-weight:800;transition:.5s;color:#fff!important}.runCheat:hover{box-shadow:0 0 10px 0 var(--buttonColor);transition:.3s}.runCheat:active{box-shadow:0 0 0 0 var(--buttonColor);transition:50ms}.cheatInputs{margin:5px 0 5px 5px;flex-direction:column;gap:5px}.searchResult,.standing{margin-bottom:10px;transition:.2s}.creditsPage>ul>li>strong,.logMessage img,.standingBlook{margin-right:5px}.cheatInputs>div{display:flex;flex-direction:row;font-size:.8rem;color:var(--highlight);font-weight:700;align-items:center}.cheatInputs>div>span{flex:1}.cheatToggle{width:20%;background:var(--highlight2);margin-block:auto;cursor:pointer;position:relative}.cheatToggle>.toggleTrigger{width:45px;position:absolute;top:0;left:0;background:var(--highlight);pointer-events:none;transition:left .2s,box-shadow .5s;z-index:1}.cheatToggle:hover>.toggleTrigger{box-shadow:0 0 10px 0 var(--highlight);transition:left .2s,box-shadow .2s}.toggleTrigger.active{left:calc(100% - 45px)}.toggleColor{position:absolute;inset:10px 20px;background:rgb(from var(--toggleOff) r g b / 25%);border-radius:2.5px;transition:.2s}.toggleTrigger.active+.toggleColor{background:rgb(from var(--toggleOn) r g b / 25%)}input[data-type],select[data-type]{width:20%;height:25px;outline:0;border:2px solid var(--highlight);box-sizing:border-box;background:0 0;color:#fff;font-size:.9em;padding-left:5px;font-family:Nunito;border-radius:2px;font-weight:800}.logo,.sidebarPath>i{width:50px;height:50px}select[data-type]{-webkit-appearance:none;-moz-appearance:none;text-indent:1px;text-overflow:''}input::placeholder{color:rgb(from var(--textColor) r g b / 50%)}input[data-type]::-webkit-inner-spin-button,input[data-type]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[data-type][type=number]{-moz-appearance:textfield}select[data-type] option{border-radius:0}select[data-type]::-ms-expand{display:none}.sidebarPath{align-items:center;cursor:pointer;transition:.2s 0.1s}.searchResult:hover,.sidebarPath:hover{color:var(--highlight);text-shadow:0 0 5px var(--highlight)}.sidebarPath>i{justify-content:center;align-items:center;font-size:1.5em}.sidebarPath>span{padding-left:5px}.sidebar:hover .sidebarPath{padding-left:20px;transition-delay:0s}.logo{left:0;transition:left .2s .1s;display:grid;place-items:center;min-width:50px;position:absolute}.sidebar:hover .logo{left:28px;transition:left .2s}.bigText{margin-top:-150px;transition:margin-top .1s}.sidebar:hover .bigText{margin-top:0;transition:margin-top .4s 0.1s}.sidebar:hover .bigTextContainer{font-size:2.5em;margin-block:20px;transition:font-size .2s,margin-block .2s}.creditsPage>ul>li>span{color:var(--textColor2);font-weight:800}.creditsPage>ul>li i{margin-inline:2px;line-height:1}.creditsPage a{color:var(--highlight);text-decoration:none}.creditsPage a:hover,.pathPage:hover{text-decoration:underline}.warning{color:var(--highlight2);font-size:.85em}.searchResult{cursor:pointer}.searchResultName{font-weight:800}.searchResultDescription{font-size:.8em}.searchResultSeparator{font-size:1.5em;font-weight:800;margin-block:10px;cursor:pointer;transition:.2s;border-bottom:2px solid #fff;padding-inline:5px;filter:drop-shadow(0px 0px 0px var(--highlight))}.searchResultSeparator:hover{color:var(--highlight);border-bottom:2px solid var(--highlight);filter:drop-shadow(0px 0px 2.5px var(--highlight))}.toggleCheat{--buttonColor:var(--toggleOff)}.toggleCheat.active{--buttonColor:var(--toggleOn)}.logMessage img{height:1em;align-self:center}.standing{display:flex;font-weight:800;align-items:center;position:relative;padding:5px 10px 5px 50px;border-radius:2.5px;background:var(--highlight2)}.standing:before{content:attr(data-place) ".";margin-right:10px}.standing::after{content:attr(data-value);flex:1;text-align:right;font-weight:100}.standing:hover{background:var(--standingColor);box-shadow:0 0 7.5px var(--standingColor)}.standingBlook{height:1.25em;align-self:center;position:absolute;left:10px}.favoriteButton,.favoriteButton>i{transition:.2s;display:grid;place-items:center;width:32px;height:32px}.favoriteButton{font-size:.8em;padding-left:5px;cursor:pointer}.favoriteButton:hover{color:#ff0}.favoriteButton>i{position:absolute;scale:0;transform-origin:50% 55%}.favoriteButton>i.filled{scale:1}.pathPage{cursor:pointer;color:var(--highlight)}[data-favorited=false],[data-favorites="0"]{display:none}
  74. [data-mode][data-name][data-description] {}`
  75. .replace(/\.([^0-9][\w-]+)/gm, (x, y) => "." + (classes[y] ??= randString(10)))
  76. .replace(/data-(\w+)/gm, (x, y) => "data-" + (datasets[y] ??= randString(10)));
  77.  
  78. gui.className = classes.gui;
  79.  
  80. gui.append(styles);
  81. const sidebarShadow = document.createElement("div");
  82. sidebarShadow.className = classes.sidebarShadow;
  83.  
  84. gui.appendChild(sidebarShadow);
  85. const credit = document.createElement("div");
  86. credit.className = classes.credit;
  87.  
  88. credit.innerText = "Created by Adrian";
  89. const sidebar = document.createElement("div");
  90. sidebar.className = classes.sidebar;
  91.  
  92. sidebar.append(credit);
  93. const guiContent = document.createElement("div");
  94. guiContent.className = classes.guiContent;
  95.  
  96. const guiTopBar = document.createElement("div");
  97. guiTopBar.className = classes.guiTopBar;
  98.  
  99. const version = document.createElement("span");
  100. version.className = classes.version;
  101. version.innerText = "Adrian - Blooket GUI " + versionName;
  102. guiTopBar.append(version);
  103.  
  104. const controls = document.createElement("div");
  105. controls.className = classes.controls;
  106.  
  107. const moveControl = document.createElement("div");
  108. moveControl.style.cursor = "grab";
  109.  
  110. moveControl.innerHTML = '<i class="fas fa-arrows-alt-h" style="line-height: 1"></i>';
  111. const minimizeControl = document.createElement("div");
  112.  
  113. minimizeControl.innerHTML = '<i class="fas fa-compress" style="line-height: 1"></i>';
  114. let hideAnimation = false;
  115. minimizeControl.onclick = () => {
  116. if (hideAnimation == (hideAnimation = true)) return;
  117. const hidden = minimizeControl.minimized;
  118. if (hidden) {
  119. minimizeControl.innerHTML = '<i class="fas fa-compress" style="line-height: 1"></i>';
  120. gui.animate(
  121. [
  122. {
  123. width: "122px",
  124. height: "27px",
  125. left: gui.style.left,
  126. },
  127. {
  128. width: "800px",
  129. height: "500px",
  130. left: `${parseInt(gui.style.left) + (hidden ? -678 : 678)}px`,
  131. },
  132. ],
  133. { duration: 200, easing: "ease" }
  134. );
  135. gui.style.width = "800px";
  136. gui.style.height = "500px";
  137. } else {
  138. minimizeControl.innerHTML = '<i class="fas fa-expand" style="line-height: 1"></i>';
  139. gui.animate(
  140. [
  141. {
  142. width: "800px",
  143. height: "500px",
  144. left: gui.style.left,
  145. },
  146. {
  147. width: "122px",
  148. height: "27px",
  149. left: `${parseInt(gui.style.left) + (hidden ? -678 : 678)}px`,
  150. },
  151. ],
  152. { duration: 200, easing: "ease" }
  153. );
  154. gui.style.width = "122px";
  155. gui.style.height = "27px";
  156. }
  157. setTimeout(
  158. () => {
  159. for (let child of [...gui.children]) {
  160. if (child == controls) continue;
  161. if (hidden) child.style.display = child.style._display;
  162. else {
  163. child.style._display = child.style.display;
  164. child.style.display = "none";
  165. }
  166. }
  167. hideAnimation = false;
  168. },
  169. hidden ? 200 : 0
  170. );
  171. gui.style.left = `${parseInt(gui.style.left) + (hidden ? -678 : 678)}px`;
  172. minimizeControl.minimized = !hidden;
  173. };
  174. const closeControl = document.createElement("div");
  175. closeControl.className = classes.closeControl;
  176. closeControl.innerHTML = '<i class="fas fa-times" style="line-height: 1"></i>';
  177. closeControl.onclick = () => gui.remove();
  178. controls.append(moveControl, minimizeControl, closeControl);
  179. dragElement(moveControl, gui);
  180.  
  181. const gamemodesPage = document.createElement("div");
  182. gamemodesPage.className = classes.gamemodesPage;
  183.  
  184. const gamemodesList = document.createElement("div");
  185. gamemodesList.className = classes.noScroll + " " + classes.gamemodesList;
  186.  
  187. const path = [["Gamemodes", gamemodesPage]];
  188.  
  189. const pathText = document.createElement("div");
  190. pathText.className = classes.pathText;
  191.  
  192. path.createPage = function (name, index, current) {
  193. const page = document.createElement("span");
  194.  
  195. page.innerText = name;
  196. if (!current) page.className = classes.pathPage;
  197. page.onclick = () => this.goto(index);
  198. return page;
  199. };
  200. path.updatePath = function () {
  201. pathText.innerHTML = "";
  202. pathText.append(this.createPage(this[0][0], 0, this.length == 1));
  203. for (let i = 1; i < this.length; i++) {
  204. pathText.append(" > ");
  205. pathText.append(this.createPage(this[i][0], i, this.length - 1 == i));
  206. }
  207. guiContent.innerHTML = "";
  208. guiContent.append(this[this.length - 1][1]);
  209. this[this.length - 1][1]?.onPath?.();
  210. };
  211. path.push = function (key, page) {
  212. Array.prototype.push.call(this, [key, page]);
  213. this.updatePath();
  214. return this.length;
  215. };
  216.  
  217. path.goto = function (index) {
  218. while (this.length - 1 > index) this.pop();
  219. this.updatePath();
  220. };
  221.  
  222. path.sidebar = function (key, page) {
  223. while (this.length > 0) this.pop();
  224. return this.push(key, page);
  225. };
  226.  
  227. const leaderboardPage = document.createElement("div");
  228. leaderboardPage.className = classes.leaderboardPage;
  229.  
  230. const leaderboardList = document.createElement("ul");
  231. leaderboardList.className = classes.noScroll + " " + classes.leaderboardList;
  232.  
  233. leaderboardPage.append(leaderboardList);
  234.  
  235. const logsPage = document.createElement("div");
  236. logsPage.className = classes.logsPage;
  237.  
  238. const logMessages = document.createElement("ul");
  239. logMessages.className = classes.noScroll + " " + classes.logMessages;
  240.  
  241. const clearLogsButton = document.createElement("div");
  242. clearLogsButton.className = classes.clearLogsButton;
  243. clearLogsButton.innerHTML = `<i class="fas fa-ban" style="line-height: 1"></i>`;
  244.  
  245. logsPage.append(logMessages, clearLogsButton);
  246.  
  247. let leaderboardPath;
  248. const Logs = {
  249. connection: null,
  250. standings: [],
  251. data: {},
  252. gamemodeData: {
  253. gold: {
  254. sort: "g",
  255. },
  256. hack: {
  257. sort: "cr",
  258. },
  259. fish: {
  260. sort: "w",
  261. },
  262. pirate: {
  263. sort: "d",
  264. },
  265. defense2: {
  266. sort: "d",
  267. },
  268. brawl: {
  269. sort: "xp",
  270. upgrades: {
  271. egg: "Rapid Eggs",
  272. nut: "Crazy Acorns",
  273. slime: "Bouncing Slime",
  274. jesterBall: "Juggling Spheres",
  275. horseshoe: "Revolving Horseshoes",
  276. shell: "Rebounding Shell",
  277. pizza: "Boomerang Pizza",
  278. banana: "Curving Banana",
  279. arrow: "Speeding Arrows",
  280. peacock: "Peacock Feathers",
  281. bone: "Whirling Bones",
  282. bee: "Buzzing Bees",
  283. bubble: "Booming Bubbles",
  284. card: "Slicing Cards",
  285. laser: "Rapid-fire Lasers",
  286. darkEnergy: "Dark Energy",
  287. syrup: "Sticky Syrup",
  288. birdFeather: "Flying Feathers",
  289. },
  290. },
  291. dino: {
  292. sort: "f",
  293. },
  294. royale: {
  295. sort: "e",
  296. },
  297. defense: {
  298. sort: "d",
  299. },
  300. cafe: {
  301. sort: "ca",
  302. },
  303. factory: {
  304. sort: "ca",
  305. glitches: { lb: "Lunch Break", as: "Ad Spam", e37: "Error 37", nt: "Night Time", lo: "#LOL", j: "Jokester", sm: "Slow Mo", dp: "Dance Party", v: "Vortex", r: "Reverse", f: "Flip", m: "Micro" },
  306. },
  307. racing: {
  308. sort: "pr",
  309. },
  310. rush: {
  311. sort: "bs",
  312. },
  313. classic: {
  314. sort: "p",
  315. },
  316. tower: {},
  317. kingdom: {},
  318. toy: {
  319. sort: "t",
  320. sabotages: { c: "Oh Canada", b: "Blizzard", f: "Fog Spell", d: "Dark & Dusk", w: "Howling Wind", g: "Gift Time!", t: "TREES", s: "Snow Plow", fr: "Use The Force" },
  321. },
  322. },
  323. exponents: ["⁰", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹"],
  324. formatNumber(input) {
  325. const [number, exponent] = (input = parseFloat(input)).toLocaleString(undefined, { notation: "engineering" }).toLowerCase().split("e");
  326. if (exponent < 15) return number + ["", "k", "M", "B", "T"][exponent / 3];
  327. const [num, exp] = input.toLocaleString(undefined, { notation: "scientific" }).toLowerCase().split("e");
  328. return num + " \xd7 10" + exp.split("").reduce((a, b) => a + Logs.exponents[b], "");
  329. },
  330. leaderboardCache: {},
  331. createStandingElement(name) {
  332. const element = document.createElement("li");
  333. element.className = classes.standing;
  334. element.innerText = name;
  335. const blook = document.createElement("img");
  336. blook.className = classes.standingBlook;
  337. element.prepend(blook);
  338. return (Logs.leaderboardCache[name] = element);
  339. },
  340. setLeaderboard(standings) {
  341. if (standings.length > 0) leaderboardPath.style.display = "flex";
  342. leaderboardList.innerHTML = "";
  343. let place = 1;
  344. let blookInfo;
  345. for (let i = 0; i < standings.length; i++) {
  346. const standing = standings[i];
  347. const standingEl = Logs.leaderboardCache[standing.name] || Logs.createStandingElement(standing.name);
  348. standingEl.firstChild.src = (blookInfo = Logs.blookData[Logs.data[standing.name]?.b || "Black"]).url;
  349. standingEl.style.setProperty("--standingColor", blookInfo.color);
  350. standingEl.dataset[datasets.value] = Logs.formatNumber(standing.value);
  351. if (standings[i - 1]?.value != standings[i].value) place = i + 1;
  352. standingEl.dataset[datasets.place] = place;
  353. leaderboardList.append(standingEl);
  354. }
  355. },
  356. blookData: null,
  357. fetchBlooks() {
  358. return (
  359. Logs.blookData ??
  360. new Promise((r) => {
  361. var i = document.createElement("iframe");
  362. i.style.display = "none";
  363. var s = document.createElement("script");
  364. s.type = "module";
  365. s.src = document.querySelector("script[src*='ac.blooket.com']").src + "?" + Date.now();
  366. const a = document.createElement("div");
  367. a.id = "app";
  368. let blooks = {};
  369. document.body.appendChild(i);
  370. let finish;
  371. i.contentWindow.Object.prototype.hasOwnProperty.call = function (a, b) {
  372. if (a[b]?.rarity && a in blooks == false) Object.assign(blooks, a);
  373. finish ??= setTimeout(() => {
  374. document.body.removeChild(i);
  375. r((Logs.blookData = blooks));
  376. });
  377. return Object.prototype.hasOwnProperty.call(a, b);
  378. };
  379. i.contentDocument.body.appendChild(a);
  380. i.contentDocument.body.appendChild(s);
  381. })
  382. );
  383. },
  384. async connect() {
  385. try {
  386. const stateNode = getStateNode();
  387. if (!stateNode?.props?.liveGameController?._liveGameCode) return false;
  388. Logs.connection = await stateNode.props.liveGameController.getDatabaseRef("c");
  389. if (!Logs.connection) return false;
  390. await Logs.fetchBlooks();
  391. const gamemode = Logs.getGamemode();
  392. Logs.connection.on("value", (snapshot) => {
  393. const players = snapshot.val() || {};
  394. let added;
  395. if (!players || !(added = Logs.diffObjects(Logs.data, players))) return;
  396. Logs.data = players;
  397. if (Logs.gamemodeData[gamemode].sort) {
  398. Logs.standings = Object.entries(players)
  399. .map(([name, data]) => ({ name, blook: data.b, value: data[Logs.gamemodeData[gamemode].sort] || 0 }))
  400. .sort((a, b) => b.value - a.value);
  401. Logs.setLeaderboard(Logs.standings);
  402. }
  403. try {
  404. let addedPlayer;
  405. switch (gamemode) {
  406. case "brawl":
  407. for (const player in added) {
  408. if (!(addedPlayer = added[player]).up) continue;
  409. const upgrade = addedPlayer.up.split(":");
  410. if (upgrade.length == 2 && upgrade[0] in Logs.gamemodeData.brawl.upgrades) Logs.addAlert(player, `upgraded ${Logs.gamemodeData.brawl.upgrades[upgrade[0]]} to level ${upgrade[1]}`);
  411. }
  412. break;
  413. case "gold":
  414. for (const player in added) {
  415. if (!(addedPlayer = added[player]).tat) continue;
  416. const [tat, amount] = addedPlayer.tat.split(":");
  417. if (amount == "swap") Logs.addAlert(player, `just swapped ${document.querySelector("[src*='assets/candy']") ? "candy" : "gold"} with ${tat}`);
  418. else Logs.addAlert(player, `just took ${Logs.formatNumber(parseInt(amount))} ${document.querySelector("[src*='assets/candy']") ? "candy" : "gold"} from ${tat}`);
  419. }
  420. break;
  421. case "toy":
  422. for (const player in added) {
  423. if ((addedPlayer = added[player]).s) Logs.addAlert(player, `sabotaged with "${Logs.gamemodeData.toy.sabotages[addedPlayer.s]}"`);
  424. else if (addedPlayer.tat) {
  425. const [tat, amount] = addedPlayer.tat.split(":");
  426. if (amount == "swap") Logs.addAlert(player, `just swapped toys with ${tat}`);
  427. else Logs.addAlert(player, `just took ${Logs.formatNumber(parseInt(amount))} toy${amount == 1 ? "" : "s"} from ${tat}`);
  428. }
  429. }
  430. break;
  431. case "hack":
  432. for (const player in added) {
  433. if (!(addedPlayer = added[player]).tat) continue;
  434. const [tat, amount] = addedPlayer.tat.split(":");
  435. Logs.addAlert(player, `just took ${Logs.formatNumber(parseInt(amount))} crypto from ${tat}`);
  436. }
  437. break;
  438. case "pirate":
  439. for (const player in added) {
  440. if (!(addedPlayer = added[player]).tat) continue;
  441. const [tat, amount] = addedPlayer.tat.split(":");
  442. Logs.addAlert(player, `just took ${Logs.formatNumber(parseInt(amount))} doubloons from ${tat}`);
  443. }
  444. break;
  445. case "defense2":
  446. for (const player in added) {
  447. if (!(addedPlayer = added[player]).r) continue;
  448. Logs.addAlert(player, `just completed Round ${addedPlayer.r}!`);
  449. }
  450. break;
  451. case "fishing":
  452. for (const player in added) {
  453. if ((addedPlayer = added[player]).f == "Frenzy") Logs.addAlert(player, `just started a frenzy`);
  454. else if (addedPlayer.s) Logs.addAlert(player, `just sent a ${addedPlayer.f} distraction`);
  455. }
  456. break;
  457. case "dino":
  458. for (const player in added) {
  459. if (!(addedPlayer = added[player]).tat) continue;
  460. const [tat, caught] = addedPlayer.tat.split(":");
  461. if (caught == "true") Logs.addAlert(player, `just caught ${tat} CHEATING!`);
  462. else Logs.addAlert(player, `investigated ${tat}`);
  463. }
  464. break;
  465. case "cafe":
  466. for (const player in added) {
  467. if (!(addedPlayer = added[player]).up) continue;
  468. const [upgrade, level] = addedPlayer.up.split(":");
  469. if (level) Logs.addAlert(player, `upgraded ${upgrade} to level ${level}`);
  470. }
  471. break;
  472. case "factory":
  473. for (const player in added) {
  474. if ((addedPlayer = added[player]).g) Logs.addAlert(player, `activated the ${Logs.gamemodeData.factory.glitches[addedPlayer.g]} glitch!`);
  475. else if (addedPlayer.s) {
  476. const [amount, synergy] = addedPlayer.s.split("-");
  477. Logs.addAlert(player, `has a ${amount} ${synergy} synergy!`);
  478. } else if (addedPlayer.t) Logs.addAlert(player, `now has 10 Blooks!`);
  479. }
  480. break;
  481. }
  482. } catch (e) {
  483. console.error(e);
  484. Logs.addLog("Error adding an alert", "red");
  485. }
  486. });
  487. return true;
  488. } catch (e) {
  489. console.warn(e);
  490. return false;
  491. }
  492. },
  493. diffObjects(obj1, obj2) {
  494. const changed = {};
  495.  
  496. for (const key in obj1) {
  497. if (!(key in obj2)) continue;
  498. if (typeof obj1[key] === "object" && typeof obj2[key] === "object") {
  499. const recChanged = Logs.diffObjects(obj1[key], obj2[key]);
  500. if (recChanged && Object.keys(recChanged).length !== 0) changed[key] = recChanged;
  501. } else if (JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) changed[key] = obj2[key];
  502. }
  503.  
  504. for (const key in obj2) if (!(key in obj1)) changed[key] = obj2[key];
  505.  
  506. if (Object.keys(changed).length == 0) return null;
  507. return changed;
  508. },
  509. getGamemode() {
  510. const gamemode = getStateNode().props?.client?.type;
  511. if (typeof gamemode == "string") return gamemode.toLowerCase();
  512. switch (window.location.pathname) {
  513. case "/play/gold":
  514. case "/play/gold/final":
  515. case "/gold/play/landing":
  516. return "gold";
  517. case "/play/hack":
  518. case "/play/hack/final":
  519. case "/hack/play/landing":
  520. return "hack";
  521. case "/play/fishing":
  522. case "/play/fishing/final":
  523. case "/fish/play/landing":
  524. return "fish";
  525. case "/play/pirate":
  526. case "/play/pirate/final":
  527. case "/pirate/play/landing":
  528. return "pirate";
  529. case "/play/defense2/load":
  530. case "/play/defense2":
  531. case "/play/defense2/final":
  532. case "/defense2/play/landing":
  533. return "defense2";
  534. case "/play/brawl/start":
  535. case "/play/brawl/settings":
  536. case "/play/brawl":
  537. case "/play/brawl/final":
  538. case "/brawl/play/landing":
  539. return "brawl";
  540. case "/play/dino":
  541. case "/play/dino/final":
  542. case "/dino/play/landing":
  543. return "dino";
  544. case "/play/battle-royale/match/preview":
  545. case "/play/battle-royale/question":
  546. case "/play/battle-royale/answer/sent":
  547. case "/play/battle-royale/answer/result":
  548. case "/play/battle-royale/match/result":
  549. case "/play/battle-royale/final":
  550. case "/royale/play/landing":
  551. return "royale";
  552. case "/defense/load":
  553. case "/defense":
  554. case "/defense/final":
  555. case "/defense/play/landing":
  556. return "defense";
  557. case "/cafe/load":
  558. case "/cafe":
  559. case "/cafe/shop":
  560. case "/cafe/final":
  561. case "/cafe/play/landing":
  562. return "cafe";
  563. case "/play/factory":
  564. case "/play/factory/settings":
  565. case "/play/factory/start":
  566. case "/play/factory/final":
  567. case "/factory/play/landing":
  568. return "factory";
  569. case "/play/racing":
  570. case "/play/racing/final":
  571. case "/racing/play/landing":
  572. return "racing";
  573. case "/play/rush":
  574. case "/play/rush/final":
  575. case "/rush/play/landing":
  576. return "rush";
  577. case "/play/classic/get-ready":
  578. case "/play/classic/question":
  579. case "/play/classic/answer/sent":
  580. case "/play/classic/answer/result":
  581. case "/play/classic/standings":
  582. case "/play/classic/final":
  583. case "/classic/play/landing":
  584. return "classic";
  585. case "/tower/load":
  586. case "/tower/start":
  587. case "/tower/map":
  588. case "/tower/battle":
  589. case "/tower/rest":
  590. case "/tower/risk":
  591. case "/tower/shop":
  592. case "/tower/victory":
  593. case "/tower/final":
  594. case "/tower/play/landing":
  595. return "tower";
  596. case "/kingdom/start":
  597. case "/kingdom":
  598. case "/kingdom/final":
  599. case "/kingdom/play/landing":
  600. return "kingdom";
  601. case "/play/toy":
  602. case "/play/toy/final":
  603. case "/toy/play/landing":
  604. return "toy";
  605. }
  606. return "";
  607. },
  608. sanitizer: document.createElement("div"),
  609. sanitizeText(text) {
  610. Logs.sanitizer.textContent = text;
  611. return Logs.sanitizer.innerHTML;
  612. },
  613. addAlert(name, message) {
  614. const element = document.createElement("li");
  615. element.className = classes.logMessage;
  616. const span = document.createElement("span");
  617. Logs.lastLog.setTime(Date.now());
  618. span.innerHTML = `<strong>${Logs.sanitizeText(name)}</strong>&nbsp;${Logs.sanitizeText(message)}<span style="opacity: 50%; flex: 1; text-align: right;">${parseTime(Logs.lastLog)}</span>`;
  619. let blook;
  620. if ((blook = Logs.blookData?.[Logs.data[name].b])) {
  621. const img = document.createElement("img");
  622. img.src = blook.url;
  623. span.prepend(img);
  624. }
  625. element.append(span);
  626. logMessages.prepend(element);
  627. },
  628. lastLog: new Date(),
  629. addLog(message, color) {
  630. const element = document.createElement("li");
  631. element.className = classes.logMessage;
  632. const span = document.createElement("span");
  633. if (color) span.style.color = color;
  634. span.style.display = "flex";
  635. Logs.lastLog.setTime(Date.now());
  636. span.innerHTML = "[LOG] " + Logs.sanitizeText(message) + `<span style="opacity: 50%; flex: 1; text-align: right;">${parseTime(Logs.lastLog)}</span>`;
  637. element.append(span);
  638. logMessages.prepend(element);
  639. },
  640. interval: null,
  641. };
  642.  
  643. if (window.location.host != "dashboard.blooket.com" && window.location.host != "blooket.com") Logs.interval = setInterval(() => Logs.connect().then((connected) => connected && clearInterval(Logs.interval)), 5000);
  644.  
  645. clearLogsButton.onclick = () => {
  646. clearLogsButton.animate([{ rotate: "0deg" }, { rotate: "360deg" }], { duration: 750, easing: "ease" });
  647. logMessages.innerHTML = "";
  648. Logs.addLog("Cleared Logs");
  649. };
  650.  
  651. const cheats = {
  652. global: {
  653. name: "Global",
  654. cheats: [
  655. {
  656. name: "Auto Answer",
  657. description: "Toggles auto answer on",
  658. type: "toggle",
  659. enabled: false,
  660. data: null,
  661. run: function () {
  662. if (!this.enabled) {
  663. this.enabled = true;
  664. this.data = setInterval(() => {
  665. const stateNode = getStateNode();
  666. const Question = stateNode.state.question || stateNode.props.client.question;
  667. if (stateNode.state.question.qType != "typing") {
  668. if (stateNode.state.stage != "feedback" && !stateNode.state.feedback) {
  669. let ind;
  670. for (ind = 0; ind < Question.answers.length; ind++) {
  671. let found = false;
  672. for (let j = 0; j < Question.correctAnswers.length; j++)
  673. if (Question.answers[ind] == Question.correctAnswers[j]) {
  674. found = true;
  675. break;
  676. }
  677. if (found) break;
  678. }
  679. document.querySelectorAll("[class*='answerContainer']")[ind].click();
  680. } else document.querySelector("[class*='feedback'], [id*='feedback']").firstChild.click();
  681. } else Object.values(document.querySelector("[class*='typingAnswerWrapper']"))[1].children._owner.stateNode.sendAnswer(Question.answers[0]);
  682. }, 50);
  683. } else {
  684. this.enabled = false;
  685. clearInterval(this.data);
  686. this.data = null;
  687. }
  688. },
  689. },
  690. {
  691. name: "Highlight Answers",
  692. description: "Toggles highlight answers on",
  693. type: "toggle",
  694. enabled: false,
  695. data: null,
  696. run: function () {
  697. if (!this.enabled) {
  698. this.enabled = true;
  699. this.data = setInterval(() => {
  700. const stateNode = getStateNode();
  701. const Question = stateNode.state.question || stateNode.props.client.question;
  702. let ind = 0;
  703. while (ind < Question.answers.length) {
  704. let found = false;
  705. for (let j = 0; j < Question.correctAnswers.length; j++)
  706. if (Question.answers[ind] == Question.correctAnswers[j]) {
  707. found = true;
  708. break;
  709. }
  710. ind++;
  711. document.querySelector("[class*='answersHolder'] :nth-child(" + ind + ") > div").style.backgroundColor = found ? "rgb(0, 207, 119)" : "rgb(189, 15, 38)";
  712. }
  713. }, 50);
  714. } else {
  715. this.enabled = false;
  716. clearInterval(this.data);
  717. this.data = null;
  718. }
  719. },
  720. },
  721. {
  722. name: "Subtle Highlight Answers",
  723. description: "Toggles subtle highlight answers on",
  724. type: "toggle",
  725. enabled: false,
  726. data: null,
  727. run: function () {
  728. if (!this.enabled) {
  729. this.enabled = true;
  730. this.data = setInterval(() => {
  731. const stateNode = getStateNode();
  732. const Question = stateNode.state.question || stateNode.props.client.question;
  733. let ind = 0;
  734. while (ind < Question.answers.length) {
  735. let j = 0;
  736. let found = false;
  737. while (j < Question.correctAnswers.length) {
  738. if (Question.answers[ind] == Question.correctAnswers[j]) {
  739. found = true;
  740. break;
  741. }
  742. j++;
  743. }
  744. ind++;
  745. if (found) document.querySelector("[class*='answersHolder'] :nth-child(" + ind + ") > div").style.boxShadow = "unset";
  746. }
  747. }, 50);
  748. } else {
  749. this.enabled = false;
  750. clearInterval(this.data);
  751. this.data = null;
  752. }
  753. },
  754. },
  755. {
  756. name: "Percent Auto Answer",
  757. description: "Answers questions correctly or incorrectly depending on the goal grade given (Disable and re-enable to update goal)",
  758. inputs: [
  759. {
  760. name: "Target Grade",
  761. type: "number",
  762. },
  763. ],
  764. type: "toggle",
  765. enabled: false,
  766. data: null,
  767. run: function (target) {
  768. if (!this.enabled) {
  769. this.enabled = true;
  770. const stateNode = getStateNode();
  771. this.data = setInterval(
  772. (TARGET) => {
  773. try {
  774. const question = stateNode.state.question || stateNode.props.client.question;
  775. if (stateNode.state.stage == "feedback" || stateNode.state.feedback) return document.querySelector('[class*="feedback"], [id*="feedback"]')?.firstChild?.click?.();
  776. else if (document.querySelector("[class*='answerContainer']") || document.querySelector("[class*='typingAnswerWrapper']")) {
  777. let correct = 0,
  778. total = 0;
  779. for (let corrects in stateNode.corrects) correct += stateNode.corrects[corrects];
  780. for (let incorrect in stateNode.incorrects) total += stateNode.incorrects[incorrect];
  781. total += correct;
  782. const yes = total == 0 || Math.abs(correct / (total + 1) - TARGET) >= Math.abs((correct + 1) / (total + 1) - TARGET);
  783. if (stateNode.state.question.qType != "typing") {
  784. const answerContainers = document.querySelectorAll("[class*='answerContainer']");
  785. for (let i = 0; i < answerContainers.length; i++) {
  786. const contains = question.correctAnswers.includes(question.answers[i]);
  787. if (yes == contains) return answerContainers[i]?.click?.();
  788. }
  789. answerContainers[0].click();
  790. } else Object.values(document.querySelector("[class*='typingAnswerWrapper']"))[1].children._owner.stateNode.sendAnswer(yes ? question.answers[0] : Math.random().toString(36).substring(2));
  791. }
  792. } catch {}
  793. },
  794. 100,
  795. (target ?? 100) / 100
  796. );
  797. } else {
  798. this.enabled = false;
  799. clearInterval(this.data);
  800. this.data = null;
  801. }
  802. },
  803. },
  804. {
  805. name: "Auto Answer",
  806. description: "Click the correct answer for you",
  807. run: function () {
  808. const stateNode = getStateNode();
  809. const Question = stateNode.state.question || stateNode.props.client.question;
  810. if (stateNode.state.question.qType != "typing") {
  811. if (stateNode.state.stage != "feedback" && !stateNode.state.feedback) {
  812. let ind;
  813. for (ind = 0; ind < Question.answers.length; ind++) {
  814. let found = false;
  815. for (let j = 0; j < Question.correctAnswers.length; j++)
  816. if (Question.answers[ind] == Question.correctAnswers[j]) {
  817. found = true;
  818. break;
  819. }
  820. if (found) break;
  821. }
  822. document.querySelectorAll("[class*='answerContainer']")[ind].click();
  823. } else document.querySelector("[class*='feedback'], [id*='feedback']").firstChild.click();
  824. } else Object.values(document.querySelector("[class*='typingAnswerWrapper']"))[1].children._owner.stateNode.sendAnswer(Question.answers[0]);
  825. },
  826. },
  827. {
  828. name: "Highlight Answers",
  829. description: "Colors answers to be red or green highlighting the correct ones",
  830. run: function () {
  831. const stateNode = getStateNode();
  832. const Question = stateNode.state.question || stateNode.props.client.question;
  833. let ind = 0;
  834. while (ind < Question.answers.length) {
  835. let found = false;
  836. for (let j = 0; j < Question.correctAnswers.length; j++)
  837. if (Question.answers[ind] == Question.correctAnswers[j]) {
  838. found = true;
  839. break;
  840. }
  841. ind++;
  842. document.querySelector("[class*='answersHolder'] :nth-child(" + ind + ") > div").style.backgroundColor = found ? "rgb(0, 207, 119)" : "rgb(189, 15, 38)";
  843. }
  844. },
  845. },
  846. {
  847. name: "Spam Buy Blooks",
  848. description: "Opens a box an amount of times",
  849. inputs: [
  850. {
  851. name: "Box",
  852. type: "options",
  853. options: () =>
  854. Array.from(document.querySelectorAll("[class*='packsWrapper'] > div")).reduce((a, b) => {
  855. b.querySelector("[class*='blookContainer'] > img") || a.push(b.querySelector("[class*='packImgContainer'] > img").alt);
  856. return a;
  857. }, []),
  858. },
  859. {
  860. name: "Amount",
  861. type: "number",
  862. },
  863. {
  864. name: "Show Unlocks",
  865. type: "options",
  866. options: [
  867. {
  868. name: "Show Unlocks",
  869. value: true,
  870. },
  871. {
  872. name: "Don't Show Unlocks",
  873. value: false,
  874. },
  875. ],
  876. },
  877. ],
  878. run: async function (box, amountToOpen, alertBlooks) {
  879. if (window.location.pathname.startsWith("/market")) {
  880. const stateNode = getStateNode();
  881. const prices = Array.prototype.reduce.call(
  882. document.querySelectorAll("[class*='packsWrapper'] > div"),
  883. (a, b) => {
  884. b.querySelector("[class*='blookContainer'] > img") || (a[b.querySelector("[class*='packImgContainer'] > img").alt] = parseInt(b.querySelector("[class*='packBottom']").textContent));
  885. return a;
  886. },
  887. {}
  888. );
  889. box = box
  890. .split(" ")
  891. .map((str) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase())
  892. .join(" ");
  893. const cost = prices[box];
  894. if (!cost) return alert("I couldn't find that box!");
  895.  
  896. const canOpen = Math.floor(stateNode.state.tokens / cost);
  897. if (canOpen <= 0) return alert("You do not have enough tokens!");
  898. const amount = Math.min(canOpen, amountToOpen || 0);
  899.  
  900. const blooks = {},
  901. now = Date.now();
  902.  
  903. for (let i = 0; i < amount; i++) {
  904. await stateNode.buyPack(true, box);
  905.  
  906. blooks[stateNode.state.unlockedBlook] ||= 0;
  907. blooks[stateNode.state.unlockedBlook]++;
  908.  
  909. stateNode.startOpening();
  910. clearTimeout(stateNode.openTimeout);
  911. const rarity = stateNode.state.purchasedBlookRarity;
  912.  
  913. stateNode.setState({ canOpen: true, currentPack: "", opening: alertBlooks, doneOpening: alertBlooks, openPack: alertBlooks });
  914. clearTimeout(stateNode.canOpenTimeout);
  915. if (rarity == "Chroma") break;
  916. }
  917. await new Promise((r) => setTimeout(r));
  918. alert(
  919. `(${Date.now() - now}ms) Results:\n${Object.entries(blooks)
  920. .map(([blook, amount]) => ` ${blook} ${amount}`)
  921. .join(`\n`)}`
  922. );
  923. } else alert("This can only be ran in the Market page.");
  924. },
  925. },
  926. {
  927. name: "Host Any Gamemode",
  928. description: "Change the selected gamemode on the host settings page",
  929. inputs: [
  930. {
  931. name: "Gamemode",
  932. type: "options",
  933. options: ["Racing", "Classic", "Factory", "Cafe", "Defense2", "Defense", "Royale", "Gold", "Candy", "Brawl", "Hack", "Pirate", "Fish", "Dino", "Toy", "Rush"],
  934. },
  935. ],
  936. run: function (type) {
  937. if (location.pathname != "/host/settings") return alert("Run this script on the host settings page");
  938. getStateNode().setState({ settings: { type } });
  939. },
  940. },
  941. {
  942. name: "Change Blook Ingame",
  943. description: "Changes your blook",
  944. inputs: [
  945. {
  946. name: "Blook (case sensitive)",
  947. type: "string",
  948. },
  949. ],
  950. run: function (blook) {
  951. let { props } = getStateNode();
  952. props.liveGameController.setVal({ path: `c/${props.client.name}/b`, val: (props.client.blook = blook) });
  953. },
  954. },
  955. {
  956. name: "Get Daily Rewards",
  957. description: "Gets max daily tokens and xp",
  958. run: async function () {
  959. if (!window.location.href.includes("play.blooket.com")) alert("This cheat only works on play.blooket.com, opening a new tab."), window.open("https://play.blooket.com/";);
  960. else {
  961. const gameId = [
  962. "60101da869e8c70013913b59",
  963. "625db660c6842334835cb4c6",
  964. "60268f8861bd520016eae038",
  965. "611e6c804abdf900668699e3",
  966. "60ba5ff6077eb600221b7145",
  967. "642467af9b704783215c1f1b",
  968. "605bd360e35779001bf57c5e",
  969. "6234cc7add097ff1c9cff3bd",
  970. "600b1491d42a140004d5215a",
  971. "5db75fa3f1fa190017b61c0c",
  972. "5fac96fe2ca0da00042b018f",
  973. "600b14d8d42a140004d52165",
  974. "5f88953cdb209e00046522c7",
  975. "600b153ad42a140004d52172",
  976. "5fe260e72a505b00040e2a11",
  977. "5fe3d085a529560004cd3076",
  978. "5f5fc017aee59500041a1456",
  979. "608b0a5863c4f2001eed43f4",
  980. "5fad491512c8620004918ace",
  981. "5fc91a9b4ea2e200046bd49a",
  982. "5c5d06a7deebc70017245da7",
  983. "5ff767051b68750004a6fd21",
  984. "5fdcacc85d465a0004b021b9",
  985. "5fb7eea20bd44300045ba495",
  986. ][Math.floor(Math.random() * 24)];
  987. const rand = (l, h) => Math.floor(Math.random() * (h - l + 1)) + l;
  988. body: JSON.stringify({ gameMode: "Factory", questionSetId: gameId }),
  989. method: "POST",
  990. credentials: "include",
  991. })
  992. .then((x) => x.json())
  993. .catch(() => alert("There was an error creating a solo game."));
  994. body: JSON.stringify({ t }),
  995. method: "POST",
  996. credentials: "include",
  997. }).catch(() => alert("There was an error when landing."));
  998. await fetch("https://play.blooket.com/api/playersessions/questions?t="; + t, { credentials: "include" });
  999. await fetch("https://play.blooket.com/api/gamequestionsets?gameId="; + gameId, { credentials: "include" });
  1000. body: JSON.stringify({ t, place: 1, cash: rand(10000000, 100000000), playersDefeated: 0, correctAnswers: rand(500, 2000), upgrades: rand(250, 750), blookUsed: "Chick", nameUsed: "You", mode: "Time-Solo" }),
  1001. method: "PUT",
  1002. credentials: "include",
  1003. }).catch(() => alert("There was an error when spoofing stats."));
  1004. body: JSON.stringify({ t, addedTokens: 500, addedXp: 300 }),
  1005. method: "PUT",
  1006. credentials: "include",
  1007. })
  1008. .then((x) => x.json())
  1009. .then(({ dailyReward }) => alert(`Added max tokens and xp, and got ${dailyReward} daily wheel tokens!`))
  1010. .catch(() => alert("There was an error when adding rewards."));
  1011. }
  1012. },
  1013. },
  1014. {
  1015. name: "Use Any Blook",
  1016. description: "Allows you to play as any blook",
  1017. data: null,
  1018. getBlooks(isLobby, stateNode) {
  1019. if (this.data?.Black) return;
  1020. isLobby = isLobby ? "keys" : "entries";
  1021. const old = Object[isLobby];
  1022. const scope = this;
  1023. Object[isLobby] = function (obj) {
  1024. if (!obj.Chick) return old.call(this, obj);
  1025. scope.data = obj;
  1026. return (Object[isLobby] = old).call(this, obj);
  1027. };
  1028. stateNode.render();
  1029. },
  1030. run: function () {
  1031. const stateNode = getStateNode();
  1032. const lobby = window.location.pathname.startsWith("/play/lobby"),
  1033. blooks = !lobby && window.location.pathname.startsWith("/blooks");
  1034. if (!blooks && !lobby) return alert("This only works in lobbies or the dashboard blooks page.");
  1035. this.getBlooks(lobby, stateNode);
  1036. if (lobby) return stateNode.setState({ unlocks: Object.keys(this.data) });
  1037. stateNode.setState({
  1038. blookData: Object.keys(this.data).reduce((a, b) => ((a[b] = stateNode.state.blookData[b] || 1), a), {}),
  1039. allSets: Object.values(this.data).reduce((a, b) => (b.set && a.includes(b.set) ? a : a.concat(b.set)), []),
  1040. });
  1041. },
  1042. },
  1043. {
  1044. name: "Every Answer Correct",
  1045. description: "Sets every answer to be correct",
  1046. run: function () {
  1047. const stateNode = getStateNode();
  1048. for (let i = 0; i < stateNode.freeQuestions.length; i++) {
  1049. stateNode.freeQuestions[i].correctAnswers = stateNode.freeQuestions[i].answers;
  1050. stateNode.questions[i].correctAnswers = stateNode.questions[i].answers;
  1051. stateNode.props.client.questions[i].correctAnswers = stateNode.questions[i].answers;
  1052. }
  1053. try {
  1054. stateNode.forceUpdate();
  1055. } catch {}
  1056. },
  1057. },
  1058. {
  1059. name: "Subtle Highlight Answers",
  1060. description: "Removes the shadow from correct answers",
  1061. run: function () {
  1062. const stateNode = getStateNode();
  1063. const Question = stateNode.state.question || stateNode.props.client.question;
  1064. let ind = 0;
  1065. while (ind < Question.answers.length) {
  1066. let j = 0;
  1067. let found = false;
  1068. while (j < Question.correctAnswers.length) {
  1069. if (Question.answers[ind] == Question.correctAnswers[j]) {
  1070. found = true;
  1071. break;
  1072. }
  1073. j++;
  1074. }
  1075. ind++;
  1076. if (found) document.querySelector("[class*='answersHolder'] :nth-child(" + ind + ") > div").style.boxShadow = "unset";
  1077. }
  1078. },
  1079. },
  1080. {
  1081. name: "Remove Random Name",
  1082. description: "Allows you to put a custom name",
  1083. run: function () {
  1084. getStateNode().setState({ isRandom: false, client: { name: "" } });
  1085. document.querySelector('[class*="nameInput"]')?.focus?.();
  1086. },
  1087. },
  1088. {
  1089. name: "Sell Duplicate Blooks",
  1090. description: "Sell all duplicate blooks leaving you with 1 each",
  1091. run: async function () {
  1092. if (window.location.pathname.startsWith("/blooks")) {
  1093. if (confirm(`Are you sure you want to sell your dupes? (Legendaries and rarer will not be sold)`)) {
  1094. let stateNode = getStateNode();
  1095. let now = Date.now(),
  1096. results = "";
  1097. for (const blook in stateNode.state.blookData)
  1098. if (stateNode.state.blookData[blook] > 1) {
  1099. stateNode.setState({ blook, numToSell: stateNode.state.blookData[blook] - 1 });
  1100. if (!["Uncommon", "Rare", "Epic"].includes(document.querySelector("[class*='highlightedRarity']").innerText.trim())) continue;
  1101. results += ` ${blook} ${stateNode.state.blookData[blook] - 1}\n`;
  1102. await stateNode.sellBlook({ preventDefault: () => {} }, true);
  1103. }
  1104. alert(`(${Date.now() - now}ms) Results:\n${results.trim()}`);
  1105. }
  1106. } else alert("This can only be ran in the Blooks page.");
  1107. },
  1108. },
  1109. ],
  1110. },
  1111. gold: {
  1112. name: "Gold Quest",
  1113. cheats: [
  1114. {
  1115. name: "Always Triple",
  1116. description: "Always get triple gold",
  1117. type: "toggle",
  1118. enabled: false,
  1119. data: { type: "multiply", val: 3, text: "Triple Gold!", blook: "Unicorn" },
  1120. run: function () {
  1121. let stateNode = getStateNode();
  1122. stateNode._choosePrize ||= stateNode.choosePrize;
  1123. if (!this.enabled) {
  1124. this.enabled = true;
  1125. stateNode.choosePrize = (i) => {
  1126. stateNode.state.choices[i] = this.data;
  1127. stateNode._choosePrize(i);
  1128. };
  1129. } else {
  1130. this.enabled = false;
  1131. if (stateNode._choosePrize) stateNode.choosePrize = stateNode._choosePrize;
  1132. }
  1133. },
  1134. },
  1135. {
  1136. name: "Auto Choose",
  1137. description: "Automatically picks the option that would give you the most gold",
  1138. type: "toggle",
  1139. enabled: false,
  1140. data: null,
  1141. run: function () {
  1142. if (!this.enabled) {
  1143. this.enabled = true;
  1144. this.data = setInterval(async () => {
  1145. let stateNode = getStateNode();
  1146. if (stateNode.state.stage == "prize") {
  1147. stateNode.props.liveGameController.getDatabaseVal("c", (players) => {
  1148. try {
  1149. if (players == null) return;
  1150. players = Object.entries(players);
  1151. let most = 0,
  1152. max = 0,
  1153. index = -1;
  1154. for (let i = 0; i < players.length; i++) if (players[i][0] != stateNode.props.client.name && players[i][1] > most) most = players[i][1];
  1155. for (let i = 0; i < stateNode.state.choices.length; i++) {
  1156. const choice = stateNode.state.choices[i];
  1157. let value = stateNode.state.gold;
  1158. if (choice.type == "gold") value = stateNode.state.gold + choice.val || stateNode.state.gold;
  1159. else if (choice.type == "multiply" || choice.type == "divide") value = Math.round(stateNode.state.gold * choice.val) || stateNode.state.gold;
  1160. else if (choice.type == "swap") value = most || stateNode.state.gold;
  1161. else if (choice.type == "take") value = stateNode.state.gold + most * choice.val || stateNode.state.gold;
  1162. if ((value || 0) <= max) continue;
  1163. max = value;
  1164. index = i + 1;
  1165. }
  1166. document.querySelector("div[class*='choice" + index + "']")?.click();
  1167. } catch {}
  1168. });
  1169. }
  1170. }, 50);
  1171. } else {
  1172. this.enabled = false;
  1173. clearInterval(this.data);
  1174. this.data = null;
  1175. }
  1176. },
  1177. },
  1178. {
  1179. name: "Chest ESP",
  1180. description: "Shows what each chest will give you",
  1181. type: "toggle",
  1182. enabled: false,
  1183. data: null,
  1184. run: function () {
  1185. if (!this.enabled) {
  1186. this.enabled = true;
  1187. this.data = setInterval(() => {
  1188. getStateNode().state.choices.forEach(({ text }, index) => {
  1189. let chest = document.querySelector(`div[class*='choice${index + 1}']`);
  1190. if (!chest || chest.querySelector("div")) return;
  1191. let choice = document.createElement("div");
  1192. choice.style.color = "white";
  1193. choice.style.fontFamily = "Eczar";
  1194. choice.style.fontSize = "2em";
  1195. choice.style.display = "flex";
  1196. choice.style.justifyContent = "center";
  1197. choice.style.transform = "translateY(200px)";
  1198. choice.innerText = text;
  1199. chest.append(choice);
  1200. });
  1201. }, 50);
  1202. } else {
  1203. this.enabled = false;
  1204. clearInterval(this.data);
  1205. this.data = null;
  1206. }
  1207. },
  1208. },
  1209. {
  1210. name: "Remove Bad Choices",
  1211. description: "Removes the chance of getting Lose 25%, Lose 50%, and Nothing",
  1212. run: function () {
  1213. let iterator = Array.prototype[Symbol.iterator];
  1214. Array.prototype[Symbol.iterator] = function* values() {
  1215. if (this[0]?.type == "gold") {
  1216. Array.prototype[Symbol.iterator] = iterator;
  1217. console.log(this);
  1218. for (let i = 0; i < this.length; i++) if (this[i].type == "divide" || this[i].type == "nothing") this.splice(i--, 1);
  1219. }
  1220. yield* iterator.apply(this);
  1221. };
  1222.  
  1223. getStateNode().constructor.prototype.answerNext.call({ nextReady: true, here: true, state: { correct: true }, setState() {} });
  1224. },
  1225. },
  1226. {
  1227. name: "Reset Players Gold",
  1228. description: "Sets a player's gold to 0",
  1229. inputs: [
  1230. {
  1231. name: "Player",
  1232. type: "options",
  1233. options: () => {
  1234. let stateNode = getStateNode();
  1235. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1236. },
  1237. },
  1238. ],
  1239. run: function (target) {
  1240. let stateNode = getStateNode();
  1241. stateNode.props.liveGameController.setVal({
  1242. path: "c/" + stateNode.props.client.name + "/tat",
  1243. val: target + ":swap:0",
  1244. });
  1245. },
  1246. },
  1247. {
  1248. name: "Set Gold",
  1249. description: "Sets amount of gold",
  1250. inputs: [
  1251. {
  1252. name: "Gold",
  1253. type: "number",
  1254. },
  1255. ],
  1256. run: function (gold) {
  1257. let stateNode = getStateNode();
  1258. stateNode.setState({ gold, gold2: gold });
  1259. stateNode.props.liveGameController.setVal({
  1260. path: "c/" + stateNode.props.client.name + "/g",
  1261. val: gold,
  1262. });
  1263. },
  1264. },
  1265. {
  1266. name: "Set Player's Gold",
  1267. description: "Sets another player's gold",
  1268. inputs: [
  1269. {
  1270. name: "Player",
  1271. type: "options",
  1272. options: () => {
  1273. let stateNode = getStateNode();
  1274. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1275. },
  1276. },
  1277. {
  1278. name: "Gold",
  1279. type: "number",
  1280. },
  1281. ],
  1282. run: function (player, gold) {
  1283. let stateNode = getStateNode();
  1284. stateNode.props.liveGameController.setVal({
  1285. path: "c/" + stateNode.props.client.name + "/tat",
  1286. val: player + ":swap:" + gold
  1287. });
  1288. }
  1289. },
  1290. {
  1291. name: "Swap Gold",
  1292. description: "Swaps gold with someone",
  1293. inputs: [
  1294. {
  1295. name: "Player",
  1296. type: "options",
  1297. options: () => {
  1298. let stateNode = getStateNode();
  1299. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1300. },
  1301. },
  1302. ],
  1303. run: function (player) {
  1304. let stateNode = getStateNode();
  1305. stateNode.props.liveGameController.getDatabaseVal("c", (players) => {
  1306. if (!players || players[player] == null) return;
  1307. const gold = players[player].g || 0;
  1308. stateNode.props.liveGameController.setVal({
  1309. path: "c/" + stateNode.props.client.name,
  1310. val: {
  1311. b: stateNode.props.client.blook,
  1312. tat: player + ":swap:" + (stateNode.state.gold || 0),
  1313. g: gold,
  1314. },
  1315. });
  1316. stateNode.setState({ gold, gold2: gold });
  1317. });
  1318. },
  1319. },
  1320. ],
  1321. },
  1322. hack: {
  1323. name: "Crypto Hack",
  1324. cheats: [
  1325. {
  1326. name: "Choice ESP",
  1327. description: "Shows what each choice will give you",
  1328. type: "toggle",
  1329. enabled: false,
  1330. data: null,
  1331. run: function () {
  1332. if (!this.enabled) {
  1333. this.enabled = true;
  1334. this.data = setInterval(() => {
  1335. let chest = document.querySelector("[class*=feedbackContainer]");
  1336. if (chest.children.length <= 4) {
  1337. let choice = document.createElement("div");
  1338. choice.style.color = "white";
  1339. choice.style.fontFamily = "Inconsolata,Helvetica,monospace,sans-serif";
  1340. choice.style.fontSize = "2em";
  1341. choice.style.display = "flex";
  1342. choice.style.justifyContent = "center";
  1343. choice.style.marginTop = "675px";
  1344. choice.innerText = getStateNode().state.choices[0].text;
  1345. chest.append(choice);
  1346. }
  1347. }, 50);
  1348. } else {
  1349. this.enabled = false;
  1350. clearInterval(this.data);
  1351. this.data = null;
  1352. }
  1353. },
  1354. },
  1355. {
  1356. name: "Password ESP",
  1357. description: "Highlights the correct password",
  1358. type: "toggle",
  1359. enabled: false,
  1360. data: null,
  1361. run: function () {
  1362. if (!this.enabled) {
  1363. this.enabled = true;
  1364. this.data = setInterval(() => {
  1365. let { state } = getStateNode();
  1366. if (state.stage == "hack")
  1367. for (const button of document.querySelector("div[class*=buttonContainer]").children) {
  1368. if (button.innerText == state.correctPassword) continue;
  1369. button.style.outlineColor = "rgba(255, 64, 64, 0.8)";
  1370. button.style.backgroundColor = "rgba(255, 64, 64, 0.8)";
  1371. button.style.textShadow = "0 0 1px #f33";
  1372. }
  1373. }, 50);
  1374. } else {
  1375. this.enabled = false;
  1376. clearInterval(this.data);
  1377. this.data = null;
  1378. }
  1379. },
  1380. },
  1381. {
  1382. name: "Always Triple",
  1383. description: "Always get triple crypto",
  1384. type: "toggle",
  1385. enabled: false,
  1386. data: null,
  1387. run: function () {
  1388. if (!this.enabled) {
  1389. this.enabled = true;
  1390. this.data = setInterval((state) => getStateNode().setState(state), 25, { choices: [{ type: "mult", val: 3, rate: 0.075, blook: "Brainy Bot", text: "Triple Crypto" }] });
  1391. } else {
  1392. this.enabled = false;
  1393. clearInterval(this.data);
  1394. this.data = null;
  1395. }
  1396. },
  1397. },
  1398. {
  1399. name: "Auto Guess",
  1400. description: "Automatically guess the correct password",
  1401. type: "toggle",
  1402. enabled: false,
  1403. data: null,
  1404. run: function () {
  1405. if (!this.enabled) {
  1406. this.enabled = true;
  1407. this.data = setInterval(() => {
  1408. let { state } = getStateNode();
  1409. if (state.stage == "hack") for (const button of document.querySelector("div[class*=buttonContainer]").children) button.innerText == state.correctPassword && button.click();
  1410. }, 50);
  1411. } else {
  1412. this.enabled = false;
  1413. clearInterval(this.data);
  1414. this.data = null;
  1415. }
  1416. },
  1417. },
  1418. {
  1419. name: "Remove Hack",
  1420. description: "Removes an attacking hack",
  1421. run: function () {
  1422. getStateNode().setState({ hack: "" });
  1423. },
  1424. },
  1425. {
  1426. name: "Set Crypto",
  1427. description: "Sets crypto",
  1428. inputs: [
  1429. {
  1430. name: "Amount",
  1431. type: "number",
  1432. },
  1433. ],
  1434. run: function (amount) {
  1435. let stateNode = getStateNode();
  1436. stateNode.setState({ crypto: amount, crypto2: amount });
  1437. stateNode.props.liveGameController.setVal({
  1438. path: `c/${stateNode.props.client.name}/cr`,
  1439. val: amount,
  1440. });
  1441. },
  1442. },
  1443. {
  1444. name: "Set Password",
  1445. description: "Sets hacking password",
  1446. inputs: [
  1447. {
  1448. name: "Custom Password",
  1449. type: "string",
  1450. },
  1451. ],
  1452. run: function (password) {
  1453. let stateNode = getStateNode();
  1454. stateNode.setState({ password });
  1455. stateNode.props.liveGameController.setVal({
  1456. path: `c/${stateNode.props.client.name}/p`,
  1457. val: password,
  1458. });
  1459. },
  1460. },
  1461. {
  1462. name: "Steal Player's Crypto",
  1463. description: "Steals all of someone's crypto",
  1464. inputs: [
  1465. {
  1466. name: "Player",
  1467. type: "options",
  1468. options: () => {
  1469. let stateNode = getStateNode();
  1470. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1471. },
  1472. },
  1473. ],
  1474. run: function (target) {
  1475. let stateNode = getStateNode();
  1476. stateNode.props.liveGameController.getDatabaseVal("c", (players) => {
  1477. let player;
  1478. if (players && (player = Object.entries(players).find((x) => x[0].toLowerCase() == target.toLowerCase()))) {
  1479. const cr = player[1].cr;
  1480. stateNode.setState({
  1481. crypto: stateNode.state.crypto + cr,
  1482. crypto2: stateNode.state.crypto + cr,
  1483. });
  1484. stateNode.props.liveGameController.setVal({
  1485. path: "c/" + stateNode.props.client.name,
  1486. val: {
  1487. b: stateNode.props.client.blook,
  1488. p: stateNode.state.password,
  1489. cr: stateNode.state.crypto + cr,
  1490. tat: player[0] + ":" + cr,
  1491. },
  1492. });
  1493. }
  1494. });
  1495. },
  1496. },
  1497. ],
  1498. },
  1499. fish: {
  1500. name: "Fishing Frenzy",
  1501. cheats: [
  1502. {
  1503. name: "Remove Distractions",
  1504. description: "Removes distractions",
  1505. type: "toggle",
  1506. enabled: false,
  1507. data: null,
  1508. run: function () {
  1509. if (!this.enabled) {
  1510. this.enabled = true;
  1511. this.data = setInterval(() => {
  1512. getStateNode().setState({ party: "" });
  1513. }, 50);
  1514. } else {
  1515. this.enabled = false;
  1516. clearInterval(this.data);
  1517. this.data = null;
  1518. }
  1519. },
  1520. },
  1521. {
  1522. name: "Frenzy",
  1523. description: "Sets everyone to frenzy mode",
  1524. run: function () {
  1525. let stateNode = getStateNode();
  1526. stateNode.props.liveGameController.setVal({
  1527. path: `c/${stateNode.props.client.name}`,
  1528. val: {
  1529. b: stateNode.props.client.blook,
  1530. w: stateNode.state.weight,
  1531. f: "Frenzy",
  1532. s: true,
  1533. },
  1534. });
  1535. },
  1536. },
  1537. {
  1538. name: "Send Distraction",
  1539. description: "Sends a distraction to everyone",
  1540. inputs: [
  1541. {
  1542. name: "Distraction",
  1543. type: "options",
  1544. options: ["Crab", "Jellyfish", "Frog", "Pufferfish", "Octopus", "Narwhal", "Megalodon", "Blobfish", "Baby Shark"],
  1545. },
  1546. ],
  1547. run: function (f) {
  1548. let stateNode = getStateNode();
  1549. stateNode.safe = true;
  1550. stateNode.props.liveGameController.setVal({
  1551. path: `c/${stateNode.props.client.name}`,
  1552. val: {
  1553. b: stateNode.props.client.blook,
  1554. w: stateNode.state.weight,
  1555. f,
  1556. s: true,
  1557. },
  1558. });
  1559. },
  1560. },
  1561. {
  1562. name: "Set Lure",
  1563. description: "Sets fishing lure (range 1 - 5)",
  1564. inputs: [
  1565. {
  1566. name: "Lure (1 - 5)",
  1567. type: "number",
  1568. min: 1,
  1569. max: 5,
  1570. },
  1571. ],
  1572. run: function (lure) {
  1573. getStateNode().setState({ lure: Math.max(Math.min(lure - 1, 4), 0) });
  1574. },
  1575. },
  1576. {
  1577. name: "Set Weight",
  1578. description: "Sets weight",
  1579. inputs: [
  1580. {
  1581. name: "Weight",
  1582. type: "number",
  1583. },
  1584. ],
  1585. run: function (weight) {
  1586. let stateNode = getStateNode();
  1587. stateNode.setState({ weight, weight2: weight });
  1588. stateNode.props.liveGameController.setVal({
  1589. path: `c/${stateNode.props.client.name}`,
  1590. val: {
  1591. b: stateNode.props.client.blook,
  1592. w: weight,
  1593. f: ["Crab", "Jellyfish", "Frog", "Pufferfish", "Octopus", "Narwhal", "Megalodon", "Blobfish", "Baby Shark"][Math.floor(Math.random() * 9)],
  1594. },
  1595. });
  1596. },
  1597. },
  1598. ],
  1599. },
  1600. pirate: {
  1601. name: "Pirate's Voyage",
  1602. cheats: [
  1603. {
  1604. name: "Heist ESP",
  1605. description: "Shows you what's under each chest during a heist",
  1606. type: "toggle",
  1607. enabled: false,
  1608. data: null,
  1609. imgs: null,
  1610. run: function () {
  1611. if (!this.enabled) {
  1612. this.enabled = true;
  1613. this.data = setInterval(() => {
  1614. const stateNode = getStateNode();
  1615. if (stateNode.state.stage != "heist") return;
  1616. if (this.imgs == null) this.imgs = Array.prototype.map.call(Array.prototype.slice.call(document.querySelector("[class*=prizesList]").children, 1, 4), (x) => x.querySelector("img").src);
  1617. const esp = Object.values(document.querySelector("[class*=modal]"))[0].return.memoizedState.memoizedState;
  1618. for (const e of document.querySelectorAll("[class*=boxContent] > div")) e.remove();
  1619. const open = Object.values(document.querySelector("[class*=modal]"))[0].return.memoizedState.next.next.memoizedState;
  1620. Array.prototype.forEach.call(document.querySelector("[class*=chestsWrapper]").children, (container, i) => {
  1621. const box = container.firstChild.firstChild;
  1622. if (open.includes(i)) return (box.style.opacity = "");
  1623. box.style.opacity = "0.5";
  1624. let d = document.createElement("div");
  1625. d.innerHTML = "<img src='" + this.imgs[2 - esp[i]] + "' style='max-width: 75%; max-height: 75%'></img>";
  1626. d.className = "chestESP";
  1627. d.style.position = "absolute";
  1628. d.style.inset = "0";
  1629. d.style.display = "grid";
  1630. d.style.placeItems = "center";
  1631. d.style.pointerEvents = "none";
  1632. container.onclick = () => {
  1633. d.remove();
  1634. box.style.opacity = "";
  1635. };
  1636. container.firstChild.prepend(d);
  1637. });
  1638. }, 50);
  1639. } else {
  1640. this.enabled = false;
  1641. clearInterval(this.data);
  1642. this.data = null;
  1643. }
  1644. },
  1645. },
  1646. {
  1647. name: "Max Levels",
  1648. description: "Maxes out all islands and your boat",
  1649. run: function () {
  1650. let stateNode = getStateNode();
  1651. stateNode.setState({ islandLevels: new Array(stateNode.state.islandLevels.length).fill(5) }, stateNode.updateBoatLevel);
  1652. },
  1653. },
  1654. {
  1655. name: "Set Doubloons",
  1656. description: "Sets Doubloons",
  1657. inputs: [
  1658. {
  1659. name: "Amount",
  1660. type: "number",
  1661. },
  1662. ],
  1663. run: function (doubloons) {
  1664. let stateNode = getStateNode();
  1665. stateNode.setState({ doubloons });
  1666. stateNode.props.liveGameController.setVal({
  1667. path: `c/${stateNode.props.client.name}/d`,
  1668. val: doubloons,
  1669. });
  1670. },
  1671. },
  1672. {
  1673. name: "Start Heist",
  1674. description: "Starts a heist on someone",
  1675. inputs: [
  1676. {
  1677. name: "Player",
  1678. type: "options",
  1679. options: () => {
  1680. let stateNode = getStateNode();
  1681. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1682. },
  1683. },
  1684. ],
  1685. run: function (target) {
  1686. let stateNode = getStateNode();
  1687. stateNode.props.liveGameController.getDatabaseVal("c", function (val) {
  1688. if (val?.[target])
  1689. stateNode.setState({
  1690. stage: "heist",
  1691. heistInfo: { name: target, blook: val[target].b },
  1692. prizeAmount: Math.max(1000, val[target].d || 0),
  1693. });
  1694. });
  1695. },
  1696. },
  1697. {
  1698. name: "Swap Doubloons",
  1699. description: "Swaps Doubloons with someone",
  1700. inputs: [
  1701. {
  1702. name: "Player",
  1703. type: "options",
  1704. options: () => {
  1705. let stateNode = getStateNode();
  1706. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1707. },
  1708. },
  1709. ],
  1710. run: async function (target) {
  1711. let stateNode = getStateNode();
  1712. stateNode.props.liveGameController.getDatabaseVal("c", function (val) {
  1713. if (!val?.[target]) return;
  1714. stateNode.props.liveGameController.setVal({
  1715. path: `c/${stateNode.props.client.name}`,
  1716. val: {
  1717. b: stateNode.props.client.blook,
  1718. d: val[target].d,
  1719. tat: `${target}:${val[target].d - stateNode.state.doubloons}`,
  1720. },
  1721. });
  1722. stateNode.setState({ doubloons: val[target].d });
  1723. });
  1724. },
  1725. },
  1726. {
  1727. name: "Take Doubloons",
  1728. description: "Takes Doubloons from someone",
  1729. inputs: [
  1730. {
  1731. name: "Player",
  1732. type: "options",
  1733. options: () => {
  1734. let stateNode = getStateNode();
  1735. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  1736. },
  1737. },
  1738. ],
  1739. run: async function (target) {
  1740. let stateNode = getStateNode();
  1741. stateNode.props.liveGameController.getDatabaseVal("c", function (val) {
  1742. if (!val?.[target]) return;
  1743. stateNode.props.liveGameController.setVal({
  1744. path: `c/${stateNode.props.client.name}`,
  1745. val: {
  1746. b: stateNode.props.client.blook,
  1747. d: stateNode.state.doubloons + val[target].d,
  1748. tat: `${target}:${val[target].d}`,
  1749. },
  1750. });
  1751. stateNode.setState({ doubloons: stateNode.state.doubloons + val[target].d });
  1752. });
  1753. },
  1754. },
  1755. ],
  1756. },
  1757. defense2: {
  1758. name: "Tower Defense 2",
  1759. cheats: [
  1760. {
  1761. name: "Max Tower Stats",
  1762. description: "Makes all placed towers overpowered",
  1763. run: function () {
  1764. getStateNode().state.towers.forEach((tower) => {
  1765. tower.stats.dmg = 1e6;
  1766. tower.stats.fireRate = 50;
  1767. tower.stats.ghostDetect = true;
  1768. tower.stats.maxTargets = 1e6;
  1769. tower.stats.numProjectiles &&= 100;
  1770. tower.stats.range = 100;
  1771. if (tower.stats.auraBuffs) for (const buff in tower.stats.auraBuffs) tower.stats.auraBuffs[buff] *= 100;
  1772. });
  1773. },
  1774. },
  1775. {
  1776. name: "Kill Enemies",
  1777. description: "Kills all the enemies",
  1778. run: function () {
  1779. let stateNode = getStateNode();
  1780. stateNode.game.current.config.sceneConfig.enemyQueue.length = 0;
  1781. stateNode.game.current.config.sceneConfig.physics.world.bodies.entries.forEach((x) => x?.gameObject?.receiveDamage?.(x.gameObject.hp, 1));
  1782. },
  1783. },
  1784. {
  1785. name: "Set Coins",
  1786. description: "Sets coins",
  1787. inputs: [
  1788. {
  1789. name: "Coins",
  1790. type: "number",
  1791. },
  1792. ],
  1793. run: function (coins) {
  1794. getStateNode().setState({ coins });
  1795. },
  1796. },
  1797. {
  1798. name: "Set Health",
  1799. description: "Sets the amount of health you have",
  1800. inputs: [
  1801. {
  1802. name: "Health",
  1803. type: "number",
  1804. },
  1805. ],
  1806. run: function (health) {
  1807. getStateNode().setState({ health });
  1808. },
  1809. },
  1810. {
  1811. name: "Set Round",
  1812. description: "Sets the current round",
  1813. inputs: [
  1814. {
  1815. name: "Round",
  1816. type: "number",
  1817. },
  1818. ],
  1819. run: function (round) {
  1820. getStateNode().setState({ round });
  1821. },
  1822. },
  1823. ],
  1824. },
  1825. brawl: {
  1826. name: "Monster Brawl",
  1827. cheats: [
  1828. {
  1829. name: "Double Enemy XP",
  1830. description: "Doubles enemy XP drop value",
  1831. run: function () {
  1832. const colliders = getStateNode().game.current.config.sceneConfig.physics.world.colliders._active.filter((x) => x.callbackContext?.toString?.()?.includes?.("dmgCd"));
  1833. for (let i = 0; i < colliders.length; i++) {
  1834. const enemies = colliders[i].object2;
  1835. let _start = enemies.classType.prototype.start;
  1836. enemies.classType.prototype.start = function () {
  1837. _start.apply(this, arguments);
  1838. this.val *= 2;
  1839. };
  1840. enemies.children.entries.forEach((e) => (e.val *= 2));
  1841. }
  1842. },
  1843. },
  1844. {
  1845. name: "Half Enemy Speed",
  1846. description: "Makes enemies move 2x slower",
  1847. run: function () {
  1848. const colliders = getStateNode().game.current.config.sceneConfig.physics.world.colliders._active.filter((x) => x.callbackContext?.toString?.()?.includes?.("dmgCd"));
  1849. for (let i = 0; i < colliders.length; i++) {
  1850. const enemies = colliders[i].object2;
  1851. let _start = enemies.classType.prototype.start;
  1852. enemies.classType.prototype.start = function () {
  1853. _start.apply(this, arguments);
  1854. this.speed *= 0.5;
  1855. };
  1856. enemies.children.entries.forEach((e) => (e.speed *= 0.5));
  1857. }
  1858. },
  1859. },
  1860. {
  1861. name: "Instant Kill",
  1862. description: "Sets all enemies health to 1",
  1863. run: function () {
  1864. const colliders = getStateNode().game.current.config.sceneConfig.physics.world.colliders._active.filter((x) => x.callbackContext?.toString?.()?.includes?.("dmgCd"));
  1865. for (let i = 0; i < colliders.length; i++) {
  1866. const enemies = colliders[i].object2;
  1867. let _start = enemies.classType.prototype.start;
  1868. enemies.classType.prototype.start = function () {
  1869. _start.apply(this, arguments);
  1870. this.hp = 1;
  1871. };
  1872. enemies.children.entries.forEach((e) => (e.hp = 1));
  1873. }
  1874. },
  1875. },
  1876. {
  1877. name: "Invincibility",
  1878. description: "Makes you invincible",
  1879. run: function () {
  1880. for (const collider of getStateNode().game.current.config.sceneConfig.physics.world.colliders._active.filter(
  1881. (x) => x.callbackContext?.toString().includes("invulnerableTime") || x.callbackContext?.toString().includes("dmgCd")
  1882. ))
  1883. collider.collideCallback = () => {};
  1884. },
  1885. },
  1886. {
  1887. name: "Kill Enemies",
  1888. description: "Kills all current enemies",
  1889. run: function () {
  1890. getStateNode().game.current.config.sceneConfig.physics.world.bodies.entries.forEach((x) => x?.gameObject?.receiveDamage?.(x.gameObject.hp, 1));
  1891. },
  1892. },
  1893. {
  1894. name: "Magnet",
  1895. description: "Pulls all xp towards you",
  1896. run: function () {
  1897. getStateNode()
  1898. .game.current.config.sceneConfig.physics.world.colliders._active.find((x) => x.collideCallback?.toString().includes("magnetTime"))
  1899. .collideCallback({ active: true }, { active: true, setActive() {}, setVisible() {} });
  1900. },
  1901. },
  1902. {
  1903. name: "Max Current Abilities",
  1904. description: "Maxes out all your current abilities",
  1905. run: function () {
  1906. const stateNode = getStateNode();
  1907. for (const [ability, level] of Object.entries(stateNode.state.abilities))
  1908. for (let i = 0; i < 10 - level; i++) stateNode.game.current.config.sceneConfig.game.events.emit("level up", ability, stateNode.state.abilities[ability]++);
  1909. stateNode.setState({
  1910. level: (stateNode.game.current.config.sceneConfig.level = [1, 3, 5, 10, 15, 25, 35].sort((a, b) => Math.abs(a - stateNode.state.level) - Math.abs(b - stateNode.state.level))[0] - 1),
  1911. });
  1912. },
  1913. },
  1914. {
  1915. name: "Next Level",
  1916. description: "Skips to the next level",
  1917. run: function () {
  1918. let stateNode = getStateNode();
  1919. let { object1: player, object2: xp } = stateNode.game.current.config.sceneConfig.physics.world.colliders._active.find((x) => x.collideCallback?.toString().includes('emit("xp'));
  1920. xp.get().spawn(player.x, player.y, ((e) => (1 === e ? 1 : e < 5 ? 5 : e < 10 ? 10 : e < 20 ? 20 : e < 30 ? 30 : e < 40 ? 40 : e < 50 ? 50 : 100))(stateNode.state.level) - stateNode.xp);
  1921. },
  1922. },
  1923. {
  1924. name: "Remove Obstacles",
  1925. description: "Removes all rocks and obstacles",
  1926. run: function () {
  1927. getStateNode().game.current.config.sceneConfig.physics.world.bodies.entries.forEach((body) => {
  1928. try {
  1929. if (body.gameObject.frame.texture.key.includes("obstacle")) body.gameObject.destroy();
  1930. } catch {}
  1931. });
  1932. },
  1933. },
  1934. {
  1935. name: "Reset Health",
  1936. description: "Resets health and gives invincibility for 3 seconds",
  1937. run: function () {
  1938. getStateNode().game.current.events._events.respawn.fn();
  1939. },
  1940. },
  1941. ],
  1942. },
  1943. dino: {
  1944. name: "Deceptive Dinos",
  1945. cheats: [
  1946. {
  1947. name: "Auto Choose",
  1948. description: "Automatically choose the best fossil when excavating",
  1949. type: "toggle",
  1950. enabled: false,
  1951. data: null,
  1952. rand(e, t) {
  1953. const s = [];
  1954. while (s.length < t) {
  1955. const i = Math.random();
  1956. let r = 0,
  1957. g = null;
  1958. for (let o = 0; o < e.length; o++) {
  1959. r += e[o].rate;
  1960. if (r >= i) {
  1961. g = e[o];
  1962. break;
  1963. }
  1964. }
  1965. g && !s.includes(g) && s.push(g);
  1966. }
  1967. return s;
  1968. },
  1969. run: function () {
  1970. if (!this.enabled) {
  1971. this.enabled = true;
  1972. this.data = setInterval(() => {
  1973. try {
  1974. let stateNode = getStateNode();
  1975. if (stateNode.state.stage === "excavate") {
  1976. stateNode.state.choices.length ||
  1977. (stateNode.state.choices = this.rand(
  1978. [
  1979. { type: "fossil", val: 10, rate: 0.1, blook: "Amber" },
  1980. { type: "fossil", val: 25, rate: 0.1, blook: "Dino Egg" },
  1981. { type: "fossil", val: 50, rate: 0.175, blook: "Dino Fossil" },
  1982. { type: "fossil", val: 75, rate: 0.175, blook: "Stegosaurus" },
  1983. { type: "fossil", val: 100, rate: 0.15, blook: "Velociraptor" },
  1984. { type: "fossil", val: 125, rate: 0.125, blook: "Brontosaurus" },
  1985. { type: "fossil", val: 250, rate: 0.075, blook: "Triceratops" },
  1986. { type: "fossil", val: 500, rate: 0.025, blook: "Tyrannosaurus Rex" },
  1987. { type: "mult", val: 1.5, rate: 0.05 },
  1988. { type: "mult", val: 2, rate: 0.025 },
  1989. ],
  1990. 3
  1991. ));
  1992. let max = 0,
  1993. index = -1;
  1994. for (let i = 0; i < stateNode.state.choices.length; i++) {
  1995. const { type, val } = stateNode.state.choices[i];
  1996. const value = (type == "fossil" ? stateNode.state.fossils + val * stateNode.state.fossilMult : stateNode.state.fossils * val) || 0;
  1997. if (value <= max && type != "mult") continue;
  1998. (max = value), (index = i + 1);
  1999. }
  2000. document.querySelector('div[class*=rockRow] > div[role="button"]:nth-child(' + index + ")").click();
  2001. }
  2002. } catch {}
  2003. }, 50);
  2004. } else {
  2005. this.enabled = false;
  2006. clearInterval(this.data);
  2007. this.data = null;
  2008. }
  2009. },
  2010. },
  2011. {
  2012. name: "Rock ESP",
  2013. description: "Shows what is under the rocks",
  2014. type: "toggle",
  2015. enabled: false,
  2016. data: null,
  2017. run: (() => {
  2018. function rand(e, t) {
  2019. const s = [];
  2020. while (s.length < t) {
  2021. const i = Math.random();
  2022. let r = 0;
  2023. let g;
  2024. for (let o = 0; o < e.length; o++) {
  2025. r += e[o].rate;
  2026. if (r >= i) {
  2027. g = e[o];
  2028. break;
  2029. }
  2030. }
  2031. if (g && !s.includes(g)) s.push(g);
  2032. }
  2033. return s;
  2034. }
  2035. const exps = ["⁰", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹"];
  2036. const getExpAscii = (num) => {
  2037. let res = "";
  2038. while (num > 0) {
  2039. res = exps[num % 10] + res;
  2040. num = ~~(num / 10);
  2041. }
  2042. return res;
  2043. };
  2044.  
  2045. function shortNum(value) {
  2046. let newValue = value.toString();
  2047. if (value >= 1000) {
  2048. const suffixes = ["", "K", "M", "B", "T"];
  2049. const suffixNum = Math.floor(Math.floor((Math.log(value) / Math.log(10)).toPrecision(14)) / 3);
  2050. if (suffixNum < suffixes.length) {
  2051. let shortValue = "";
  2052. for (let precision = 3; precision >= 1; precision--) {
  2053. shortValue = parseFloat((suffixNum != 0 ? value / Math.pow(1000, suffixNum) : value).toPrecision(precision)).toString();
  2054. const dotLessShortValue = shortValue.replace(/[^a-zA-Z 0-9]+/g, "");
  2055. if (dotLessShortValue.length <= 3) break;
  2056. }
  2057. if (Number(shortValue) % 1 != 0) shortValue = Number(shortValue).toFixed(1);
  2058. newValue = shortValue + suffixes[suffixNum];
  2059. } else {
  2060. let num = value;
  2061. let exp = 0;
  2062. while (num >= 100) {
  2063. num = Math.floor(num / 10);
  2064. exp += 1;
  2065. }
  2066. newValue = num / 10 + " × 10" + getExpAscii(exp + 1);
  2067. }
  2068. }
  2069. return newValue;
  2070. }
  2071. return function () {
  2072. if (!this.enabled) {
  2073. this.enabled = true;
  2074. this.data = setInterval(() => {
  2075. let stateNode = getStateNode();
  2076. const rocks = document.querySelector('[class*="rockButton"]').parentElement.children;
  2077.  
  2078. if (!Array.prototype.every.call(rocks, (element) => element.querySelector("div")))
  2079. stateNode.setState(
  2080. {
  2081. choices: rand(
  2082. [
  2083. { type: "fossil", val: 10, rate: 0.1, blook: "Amber" },
  2084. { type: "fossil", val: 25, rate: 0.1, blook: "Dino Egg" },
  2085. { type: "fossil", val: 50, rate: 0.175, blook: "Dino Fossil" },
  2086. { type: "fossil", val: 75, rate: 0.175, blook: "Stegosaurus" },
  2087. { type: "fossil", val: 100, rate: 0.15, blook: "Velociraptor" },
  2088. { type: "fossil", val: 125, rate: 0.125, blook: "Brontosaurus" },
  2089. { type: "fossil", val: 250, rate: 0.075, blook: "Triceratops" },
  2090. { type: "fossil", val: 500, rate: 0.025, blook: "Tyrannosaurus Rex" },
  2091. { type: "mult", val: 1.5, rate: 0.05 },
  2092. { type: "mult", val: 2, rate: 0.025 },
  2093. ],
  2094. 3
  2095. ),
  2096. },
  2097. () => {
  2098. Array.prototype.forEach.call(rocks, (element, index) => {
  2099. const rock = stateNode.state.choices[index];
  2100. if (element.querySelector("div")) element.querySelector("div").remove();
  2101. const choice = document.createElement("div");
  2102. choice.style.color = "white";
  2103. choice.style.fontFamily = "Macondo";
  2104. choice.style.fontSize = "1em";
  2105. choice.style.display = "flex";
  2106. choice.style.justifyContent = "center";
  2107. choice.style.transform = "translateY(25px)";
  2108. choice.innerText =
  2109. rock.type === "fossil"
  2110. ? `+${
  2111. Math.round(rock.val * stateNode.state.fossilMult) > 99999999 ? shortNum(Math.round(rock.val * stateNode.state.fossilMult)) : Math.round(rock.val * stateNode.state.fossilMult)
  2112. } Fossils`
  2113. : `x${rock.val} Fossils Per Excavation`;
  2114. element.append(choice);
  2115. });
  2116. }
  2117. );
  2118. }, 50);
  2119. } else {
  2120. this.enabled = false;
  2121. clearInterval(this.data);
  2122. this.data = null;
  2123. }
  2124. };
  2125. })(),
  2126. },
  2127. {
  2128. name: "Set Fossils",
  2129. description: "Sets the amount of fossils you have",
  2130. inputs: [
  2131. {
  2132. name: "Fossils",
  2133. type: "number",
  2134. },
  2135. ],
  2136. run: function (fossils) {
  2137. let stateNode = getStateNode();
  2138. stateNode.setState({ fossils });
  2139. stateNode.props.liveGameController.setVal({
  2140. path: `c/${stateNode.props.client.name}/f`,
  2141. val: fossils,
  2142. });
  2143. },
  2144. },
  2145. {
  2146. name: "Set Multiplier",
  2147. description: "Sets fossil multiplier",
  2148. inputs: [
  2149. {
  2150. name: "Multiplier",
  2151. type: "number",
  2152. },
  2153. ],
  2154. run: function (fossilMult) {
  2155. let stateNode = getStateNode();
  2156. stateNode.setState({ fossilMult });
  2157. },
  2158. },
  2159. {
  2160. name: "Stop Cheating",
  2161. description: "Undoes cheating so that you can't be caught",
  2162. run: function () {
  2163. let stateNode = getStateNode();
  2164. stateNode.setState({ isCheating: false });
  2165. stateNode.props.liveGameController.setVal({
  2166. path: `c/${stateNode.props.client.name}/ic`,
  2167. val: false,
  2168. });
  2169. },
  2170. },
  2171. ],
  2172. },
  2173. royale: {
  2174. name: "Battle Royale",
  2175. cheats: [
  2176. {
  2177. name: "Auto Answer (Toggle)",
  2178. description: "Toggles auto answer on",
  2179. type: "toggle",
  2180. enabled: false,
  2181. data: null,
  2182. run: function () {
  2183. if (!this.enabled) {
  2184. this.enabled = true;
  2185. this.data = setInterval(() => {
  2186. let stateNode = getStateNode();
  2187. stateNode?.onAnswer?.(true, stateNode.props.client.question.correctAnswers[0]);
  2188. }, 50);
  2189. } else {
  2190. this.enabled = false;
  2191. clearInterval(this.data);
  2192. this.data = null;
  2193. }
  2194. },
  2195. },
  2196. {
  2197. name: "Auto Answer",
  2198. description: "Chooses the correct answer for you",
  2199. run: function () {
  2200. let stateNode = getStateNode();
  2201. stateNode?.onAnswer?.(true, stateNode.props.client.question.correctAnswers[0]);
  2202. },
  2203. },
  2204. ],
  2205. },
  2206. defense: {
  2207. name: "Tower Defense",
  2208. cheats: [
  2209. {
  2210. name: "Earthquake",
  2211. description: "Shuffles around towers",
  2212. run: function () {
  2213. let stateNode = getStateNode();
  2214. stateNode.setState(
  2215. {
  2216. eventName: "Earthquake",
  2217. event: {
  2218. short: "e",
  2219. color: "#805500",
  2220. icon: "fas fa-mountain",
  2221. desc: "All of your towers get mixed up",
  2222. rate: 0.02,
  2223. },
  2224. buyTowerName: "",
  2225. buyTower: {},
  2226. },
  2227. () => (stateNode.eventTimeout = setTimeout(() => stateNode.setState({ event: {}, eventName: "" }), 6e3))
  2228. );
  2229. stateNode.tiles.forEach((row) => row.forEach((col, i) => col == 3 && (row[i] = 0)));
  2230. let tiles = [];
  2231. for (let y = 0; y < stateNode.tiles.length; y++) for (let x = 0; x < stateNode.tiles[y].length; x++) if (stateNode.tiles[y][x] == 0) tiles.push({ x, y });
  2232. tiles.sort(() => Math.random() - Math.random());
  2233. stateNode.towers.forEach((tower) => {
  2234. let { x, y } = tiles.pop();
  2235. tower.move(x, y, stateNode.tileSize);
  2236. stateNode.tiles[y][x] = 3;
  2237. });
  2238. },
  2239. },
  2240. {
  2241. name: "Max Tower Stats",
  2242. description: "Makes all placed towers overpowered",
  2243. run: function () {
  2244. getStateNode().towers.forEach((tower) => {
  2245. tower.range = 100;
  2246. tower.fullCd = tower.cd = 0;
  2247. tower.damage = 1e6;
  2248. });
  2249. },
  2250. },
  2251. {
  2252. name: "Remove Ducks",
  2253. description: "Removes ducks",
  2254. run: function () {
  2255. let { ducks, tiles } = getStateNode();
  2256. ducks.forEach((x) => (tiles[x.y][x.x] = 0));
  2257. ducks.length = 0;
  2258. },
  2259. },
  2260. {
  2261. name: "Remove Enemies",
  2262. description: "Removes all the enemies",
  2263. run: function () {
  2264. let stateNode = getStateNode();
  2265. stateNode.enemies = stateNode.futureEnemies = [];
  2266. },
  2267. },
  2268. {
  2269. name: "Remove Obstacles",
  2270. description: "Lets you place towers anywhere",
  2271. run: function () {
  2272. let stateNode = getStateNode();
  2273. stateNode.tiles = stateNode.tiles.map((row) => row.fill(0));
  2274. },
  2275. },
  2276. {
  2277. name: "Set Damage",
  2278. description: "Sets damage",
  2279. inputs: [
  2280. {
  2281. name: "Damage",
  2282. type: "number",
  2283. },
  2284. ],
  2285. run: function (dmg) {
  2286. getStateNode().dmg = dmg;
  2287. },
  2288. },
  2289. {
  2290. name: "Set Round",
  2291. description: "Sets the current round",
  2292. inputs: [
  2293. {
  2294. name: "Round",
  2295. type: "number",
  2296. },
  2297. ],
  2298. run: function (round) {
  2299. getStateNode().setState({ round });
  2300. },
  2301. },
  2302. {
  2303. name: "Set Tokens",
  2304. description: "Sets the amount of tokens you have",
  2305. inputs: [
  2306. {
  2307. name: "Tokens",
  2308. type: "number",
  2309. },
  2310. ],
  2311. run: function (tokens) {
  2312. getStateNode().setState({ tokens });
  2313. },
  2314. },
  2315. ],
  2316. },
  2317. cafe: {
  2318. name: "Café",
  2319. cheats: [
  2320. {
  2321. name: "Max Items",
  2322. description: "Maxes out items in the shop (Only usable in the shop)",
  2323. run: function () {
  2324. if (window.location.pathname !== "/cafe/shop") alert("This can only be run in the shop");
  2325. else {
  2326. const stateNode = getStateNode();
  2327. stateNode.setState({ items: Object.keys(stateNode.state.items).reduce((obj, item) => ((obj[item] = 5), obj), {}) });
  2328. }
  2329. },
  2330. },
  2331. {
  2332. name: "Remove Customers",
  2333. description: "Skips the current customers (Not usable in the shop)",
  2334. run: function () {
  2335. const stateNode = getStateNode();
  2336. stateNode.state.customers.forEach((customer, i) => window.setTimeout(() => customer.blook && stateNode.removeCustomer(i, true), i * 250));
  2337. },
  2338. },
  2339. {
  2340. name: "Reset Abilities",
  2341. description: "Resets used abilities in shop (Only usable in the shop)",
  2342. run: function () {
  2343. if (window.location.pathname !== "/cafe/shop") alert("This can only be run in the shop");
  2344. else {
  2345. const stateNode = getStateNode();
  2346. stateNode.setState({ abilities: Object.keys(stateNode.state.abilities).reduce((obj, item) => ((obj[item] = 5), obj), {}) });
  2347. }
  2348. },
  2349. },
  2350. {
  2351. name: "Set Cash",
  2352. description: "Sets cafe cash",
  2353. inputs: [
  2354. {
  2355. name: "Amount",
  2356. type: "number",
  2357. },
  2358. ],
  2359. run: function (cafeCash) {
  2360. let stateNode = getStateNode();
  2361. stateNode.setState({ cafeCash });
  2362. stateNode.props.liveGameController.setVal({
  2363. path: `c/${stateNode.props.client.name}/ca`,
  2364. val: cafeCash,
  2365. });
  2366. },
  2367. },
  2368. {
  2369. name: "Stock Food",
  2370. description: "Stocks all food to 99 (Not usable in the shop)",
  2371. run: function () {
  2372. if (window.location.pathname !== "/cafe") alert("This can't be run in the shop");
  2373. else {
  2374. const stateNode = getStateNode();
  2375. stateNode.setState({ foods: stateNode.state.foods.map((e) => ({ ...e, stock: 99, level: 5 })) });
  2376. }
  2377. },
  2378. },
  2379. ],
  2380. },
  2381. factory: {
  2382. name: "Factory",
  2383. cheats: [
  2384. {
  2385. name: "Choose Blook",
  2386. description: "Gives you a blook",
  2387. inputs: [
  2388. {
  2389. name: "Blook",
  2390. type: "options",
  2391. options: [
  2392. { name: "Chick", color: "#ffcd05", class: "\uD83C\uDF3D", rarity: "Common", cash: [3, 7, 65, 400, 2500], time: [1, 1, 1, 1, 1], price: [300, 3e3, 3e4, 2e5] },
  2393. { name: "Chicken", color: "#ed1c24", class: "\uD83C\uDF3D", rarity: "Common", cash: [10, 40, 200, 1400, 1e4], time: [5, 4, 3, 2, 1], price: [570, 4e3, 5e4, 8e5] },
  2394. { name: "Cow", color: "#58595b", class: "\uD83C\uDF3D", rarity: "Common", cash: [25, 75, 1500, 25e3, 25e4], time: [15, 10, 10, 10, 5], price: [500, 9500, 16e4, 4e6] },
  2395. { name: "Duck", color: "#4ab96d", class: "\uD83C\uDF3D", rarity: "Common", cash: [4, 24, 200, 3e3, 4e4], time: [3, 3, 3, 3, 3], price: [450, 4200, 7e4, 11e5] },
  2396. { name: "Goat", color: "#c59a74", class: "\uD83C\uDF3D", rarity: "Common", cash: [5, 28, 200, 1300, 12e3], time: [3, 3, 2, 2, 2], price: [500, 6400, 45e3, 5e5] },
  2397. { name: "Horse", color: "#995b3c", class: "\uD83C\uDF3D", rarity: "Common", cash: [5, 20, 270, 1800, 15e3], time: [2, 2, 2, 2, 2], price: [550, 8200, 65e3, 6e5] },
  2398. { name: "Pig", color: "#f6a9cb", class: "\uD83C\uDF3D", rarity: "Common", cash: [20, 50, 1300, 8e3, 8e4], time: [7, 7, 7, 7, 5], price: [400, 11e3, 8e4, 13e5] },
  2399. { name: "Sheep", color: "#414042", class: "\uD83C\uDF3D", rarity: "Common", cash: [6, 25, 250, 1500, 11e3], time: [3, 3, 3, 2, 2], price: [500, 5e3, 5e4, 43e4] },
  2400. { name: "Cat", color: "#f49849", class: "\uD83D\uDC3E", rarity: "Common", cash: [5, 18, 170, 1700, 13e3], time: [2, 2, 2, 2, 2], price: [480, 5500, 6e4, 5e5] },
  2401. { name: "Dog", color: "#995b3c", class: "\uD83D\uDC3E", rarity: "Common", cash: [7, 25, 220, 1900, 9e3], time: [3, 3, 2, 2, 1], price: [460, 6600, 7e4, 73e4] },
  2402. { name: "Goldfish", color: "#f18221", class: "\uD83D\uDC3E", rarity: "Common", cash: [5, 40, 350, 3500, 35e3], time: [3, 3, 3, 3, 3], price: [750, 7200, 84e3, 95e4] },
  2403. { name: "Rabbit", color: "#e7bf9a", class: "\uD83D\uDC3E", rarity: "Common", cash: [3, 18, 185, 800, 7e3], time: [2, 2, 2, 1, 1], price: [500, 5800, 56e3, 55e4] },
  2404. { name: "Hamster", color: "#ce9176", class: "\uD83D\uDC3E", rarity: "Common", cash: [10, 45, 450, 4500, 45e3], time: [4, 4, 4, 4, 4], price: [650, 6500, 8e4, 93e4] },
  2405. { name: "Turtle", color: "#619a3c", class: "\uD83D\uDC3E", rarity: "Common", cash: [23, 120, 1400, 15e3, 17e4], time: [10, 10, 10, 10, 10], price: [700, 8500, 11e4, 13e5] },
  2406. { name: "Puppy", color: "#414042", class: "\uD83D\uDC3E", rarity: "Common", cash: [4, 10, 75, 500, 3e3], time: [1, 1, 1, 1, 1], price: [450, 4e3, 35e3, 25e4] },
  2407. { name: "Kitten", color: "#58595b", class: "\uD83D\uDC3E", rarity: "Common", cash: [4, 8, 60, 400, 2e3], time: [1, 1, 1, 1, 1], price: [350, 3500, 26e3, 17e4] },
  2408. { name: "Bear", color: "#995b3c", class: "\uD83C\uDF32", rarity: "Common", cash: [12, 70, 550, 4500, 1e5], time: [7, 7, 6, 5, 5], price: [550, 5500, 63e3, 16e5] },
  2409. { name: "Moose", color: "#995b3c", class: "\uD83C\uDF32", rarity: "Common", cash: [8, 45, 400, 3500, 26e3], time: [5, 5, 4, 4, 3], price: [520, 6500, 58e3, 7e5] },
  2410. { name: "Fox", color: "#f49849", class: "\uD83C\uDF32", rarity: "Common", cash: [7, 15, 80, 550, 3e3], time: [2, 2, 1, 1, 1], price: [400, 4e3, 36e3, 24e4] },
  2411. { name: "Raccoon", color: "#6d6e71", class: "\uD83C\uDF32", rarity: "Common", cash: [5, 14, 185, 1900, 19e3], time: [2, 2, 2, 2, 2], price: [400, 5e3, 71e3, 8e5] },
  2412. { name: "Squirrel", color: "#d25927", class: "\uD83C\uDF32", rarity: "Common", cash: [3, 10, 65, 470, 2600], time: [1, 1, 1, 1, 1], price: [420, 3600, 32e3, 21e4] },
  2413. { name: "Owl", color: "#594a42", class: "\uD83C\uDF32", rarity: "Common", cash: [4, 17, 155, 1500, 15e3], time: [2, 2, 2, 2, 2], price: [500, 4800, 55e3, 58e4] },
  2414. { name: "Hedgehog", color: "#3f312b", class: "\uD83C\uDF32", rarity: "Common", cash: [11, 37, 340, 2200, 3e4], time: [5, 4, 3, 2, 2], price: [540, 7e3, 77e3, 12e5] },
  2415. { name: "Seal", color: "#7ca1d5", class: "❄️", rarity: "Common", cash: [6, 17, 150, 1200, 13e3], time: [2, 2, 2, 2, 2], price: [480, 4500, 43e3, 52e4] },
  2416. { name: "Arctic Fox", color: "#7ca1d5", class: "❄️", rarity: "Common", cash: [5, 18, 180, 850, 8500], time: [2, 2, 2, 1, 1], price: [520, 550, 61e3, 68e4] },
  2417. { name: "Snowy Owl", color: "#feda3f", class: "❄️", rarity: "Common", cash: [5, 20, 190, 1900, 16e3], time: [3, 3, 2, 2, 2], price: [370, 5300, 76e3, 62e4] },
  2418. { name: "Arctic Hare", color: "#7ca1d5", class: "❄️", rarity: "Common", cash: [6, 19, 85, 900, 7e3], time: [2, 2, 1, 1, 1], price: [540, 5200, 66e3, 55e4] },
  2419. { name: "Penguin", color: "#fb8640", class: "❄️", rarity: "Common", cash: [4, 21, 310, 3200, 33e3], time: [3, 3, 3, 3, 3], price: [400, 6500, 76e3, 87e4] },
  2420. { name: "Baby Penguin", color: "#414042", class: "❄️", rarity: "Common", cash: [3, 8, 70, 450, 2700], time: [1, 1, 1, 1, 1], price: [420, 3300, 33e3, 23e4] },
  2421. { name: "Polar Bear", color: "#7ca1d5", class: "❄️", rarity: "Common", cash: [12, 75, 700, 6500, 85e3], time: [8, 7, 6, 5, 5], price: [630, 7e3, 91e3, 14e5] },
  2422. { name: "Walrus", color: "#7d4f33", class: "❄️", rarity: "Common", cash: [11, 46, 420, 3700, 51e3], time: [5, 5, 4, 4, 4], price: [550, 6200, 68e3, 1e6] },
  2423. { name: "Tiger", color: "#f18221", class: "\uD83C\uDF34", rarity: "Common", cash: [6, 20, 100, 975, 7500], time: [3, 3, 1, 1, 1], price: [390, 6e3, 7e4, 61e4] },
  2424. { name: "Jaguar", color: "#fbb040", class: "\uD83C\uDF34", rarity: "Common", cash: [8, 28, 230, 1600, 17e3], time: [3, 3, 2, 2, 2], price: [390, 6e3, 7e4, 61e4] },
  2425. { name: "Toucan", color: "#ffca34", class: "\uD83C\uDF34", rarity: "Common", cash: [9, 20, 175, 625, 3800], time: [2, 2, 2, 1, 1], price: [520, 4800, 42e3, 3e5] },
  2426. { name: "Cockatoo", color: "#7ca1d5", class: "\uD83C\uDF34", rarity: "Common", cash: [6, 35, 160, 1700, 18e3], time: [4, 4, 2, 2, 2], price: [500, 5e3, 63e3, 7e5] },
  2427. { name: "Macaw", color: "#00aeef", class: "\uD83C\uDF34", rarity: "Common", cash: [3, 8, 85, 850, 8500], time: [1, 1, 1, 1, 1], price: [480, 5400, 62e3, 63e4] },
  2428. { name: "Parrot", color: "#ed1c24", class: "\uD83C\uDF34", rarity: "Common", cash: [3, 9, 90, 900, 9e3], time: [1, 1, 1, 1, 1], price: [540, 5700, 65e3, 69e4] },
  2429. { name: "Panther", color: "#2f2c38", class: "\uD83C\uDF34", rarity: "Common", cash: [12, 28, 215, 2100, 21e3], time: [5, 3, 2, 2, 2], price: [530, 6500, 76e3, 87e4] },
  2430. { name: "Anaconda", color: "#8a9143", class: "\uD83C\uDF34", rarity: "Common", cash: [3, 15, 85, 1500, 7600], time: [1, 2, 1, 2, 1], price: [410, 5100, 58e3, 59e4] },
  2431. { name: "Orangutan", color: "#bc6234", class: "\uD83C\uDF34", rarity: "Common", cash: [13, 52, 570, 4300, 7e4], time: [5, 5, 5, 4, 4], price: [600, 7e3, 8e4, 14e5] },
  2432. { name: "Capuchin", color: "#e0b0a6", class: "\uD83C\uDF34", rarity: "Common", cash: [4, 14, 160, 780, 8200], time: [2, 2, 2, 1, 1], price: [390, 4700, 57e3, 68e4] },
  2433. { name: "Elf", color: "#a7d054", class: "⚔️", rarity: "Uncommon", cash: [5e3, 15e3, 15e4, 15e5, 1e7], time: [1, 1, 1, 1, 1], price: [8e5, 9e6, 11e7, 8e8] },
  2434. { name: "Witch", color: "#4ab96d", class: "⚔️", rarity: "Uncommon", cash: [18e3, 6e4, 4e4, 4e6, 35e6], time: [3, 3, 2, 2, 2], price: [11e5, 12e6, 15e7, 14e8] },
  2435. { name: "Wizard", color: "#5a459c", class: "⚔️", rarity: "Uncommon", cash: [19500, 65e3, 44e4, 46e5, 4e6], time: [3, 3, 2, 2, 2], price: [13e5, 135e5, 16e7, 16e8] },
  2436. { name: "Fairy", color: "#df6d9c", class: "⚔️", rarity: "Uncommon", cash: [18500, 6e4, 62e4, 44e5, 38e6], time: [3, 3, 3, 2, 2], price: [12e5, 125e5, 15e6, 15e8] },
  2437. { name: "Slime Monster", color: "#2fa04a", class: "⚔️", rarity: "Uncommon", cash: [35e3, 14e4, 1e6, 11e6, 11e7], time: [5, 5, 4, 4, 4], price: [16e5, 15e6, 2e8, 23e8] },
  2438. { name: "Jester", color: "#be1e2d", class: "⚔️", rarity: "Rare", cash: [25e3, 1e5, 68e4, 65e5, 32e6], time: [3, 3, 2, 2, 1], price: [2e6, 21e6, 23e7, 26e8] },
  2439. { name: "Dragon", color: "#2fa04a", class: "⚔️", rarity: "Rare", cash: [36e3, 15e4, 15e5, 15e6, 15e7], time: [4, 4, 4, 4, 4], price: [23e5, 24e6, 27e7, 3e9] },
  2440. { name: "Unicorn", color: "#f6afce", class: "⚔️", rarity: "Epic", cash: [24e3, 15e4, 14e5, 7e6, 75e6], time: [2, 2, 2, 1, 1], price: [45e5, 45e6, 55e7, 65e8] },
  2441. { name: "Queen", color: "#9e1f63", class: "⚔️", rarity: "Rare", cash: [24e3, 95e3, 95e4, 97e5, 95e6], time: [3, 3, 3, 3, 3], price: [19e5, 2e7, 23e7, 25e8] },
  2442. { name: "King", color: "#ee2640", class: "⚔️", rarity: "Legendary", cash: [75e3, 4e5, 6e6, 9e7, 125e7], time: [5, 5, 5, 5, 5], price: [6e6, 95e6, 16e8, 25e9] },
  2443. { name: "Two of Spades", color: "#414042", class: "\uD83C\uDFF0", rarity: "Uncommon", cash: [4500, 14e3, 14e4, 14e5, 9e6], time: [1, 1, 1, 1, 1], price: [77e4, 83e5, 98e6, 71e7] },
  2444. { name: "Eat Me", color: "#d58c55", class: "\uD83C\uDFF0", rarity: "Uncommon", cash: [13e3, 45e3, 45e4, 45e5, 5e7], time: [2, 2, 2, 2, 2], price: [13e5, 14e6, 16e7, 2e9] },
  2445. { name: "Drink Me", color: "#dd7399", class: "\uD83C\uDFF0", rarity: "Uncommon", cash: [12e3, 4e4, 4e5, 4e6, 45e6], time: [2, 2, 2, 2, 2], price: [12e5, 12e6, 14e7, 18e8] },
  2446. { name: "Alice", color: "#4cc9f5", class: "\uD83C\uDFF0", rarity: "Uncommon", cash: [13e3, 42e3, 21e4, 21e5, 23e6], time: [2, 2, 1, 1, 1], price: [12e5, 13e6, 15e7, 19e8] },
  2447. { name: "Queen of Hearts", color: "#d62027", class: "\uD83C\uDFF0", rarity: "Uncommon", cash: [23e3, 87e3, 62e4, 75e5, 9e7], time: [4, 4, 3, 3, 3], price: [13e5, 13e6, 18e7, 24e8] },
  2448. { name: "Dormouse", color: "#89d6f8", class: "\uD83C\uDFF0", rarity: "Rare", cash: [17e3, 68e3, 7e5, 35e5, 35e6], time: [2, 2, 1, 1, 1], price: [2e6, 22e6, 25e7, 28e8] },
  2449. { name: "White Rabbit", color: "#ffcd05", class: "\uD83C\uDFF0", rarity: "Rare", cash: [26e3, 105e3, 11e6, 77e5, 72e6], time: [3, 3, 3, 2, 2], price: [2e6, 23e6, 28e7, 29e8] },
  2450. { name: "Cheshire Cat", color: "#dd7399", class: "\uD83C\uDFF0", rarity: "Rare", cash: [32e3, 1e5, 9e5, 9e6, 6e7], time: [4, 3, 3, 3, 2], price: [18e5, 19e6, 22e7, 24e8] },
  2451. { name: "Caterpillar", color: "#00c0f3", class: "\uD83C\uDFF0", rarity: "Epic", cash: [1e4, 7e4, 65e4, 75e5, 85e6], time: [1, 1, 1, 1, 1], price: [42e5, 42e6, 54e7, 69e8] },
  2452. { name: "Mad Hatter", color: "#914f93", class: "\uD83C\uDFF0", rarity: "Epic", cash: [38e3, 25e4, 15e5, 14e6, 8e7], time: [3, 3, 2, 2, 1], price: [48e5, 48e6, 52e7, 66e8] },
  2453. { name: "King of Hearts", color: "#c62127", class: "\uD83C\uDFF0", rarity: "Legendary", cash: [8e4, 42e4, 68e5, 1e8, 15e8], time: [5, 5, 5, 5, 5], price: [7e6, 11e7, 18e8, 3e10] },
  2454. { name: "Earth", color: "#416eb5", class: "\uD83D\uDE80", rarity: "Uncommon", cash: [15e3, 45e3, 6e5, 65e5, 65e6], time: [3, 3, 3, 3, 3], price: [1e6, 11e6, 15e7, 17e8] },
  2455. { name: "Meteor", color: "#c68c3c", class: "\uD83D\uDE80", rarity: "Uncommon", cash: [23e3, 65e3, 7e5, 45e5, 2e7], time: [5, 4, 3, 2, 1], price: [95e4, 13e6, 16e7, 16e8] },
  2456. { name: "Stars", color: "#19184d", class: "\uD83D\uDE80", rarity: "Uncommon", cash: [1e4, 4e4, 2e5, 2e6, 18e6], time: [2, 2, 1, 1, 1], price: [14e5, 14e6, 15e7, 15e8] },
  2457. { name: "Alien", color: "#8dc63f", class: "\uD83D\uDE80", rarity: "Uncommon", cash: [3e4, 1e5, 1e6, 11e6, 85e6], time: [4, 4, 4, 4, 4], price: [15e5, 17e6, 19e7, 17e8] },
  2458. { name: "Planet", color: "#9dc6ea", class: "\uD83D\uDE80", rarity: "Rare", cash: [25e3, 1e5, 9e5, 9e6, 9e7], time: [3, 3, 3, 3, 3], price: [2e6, 21e6, 21e7, 24e8] },
  2459. { name: "UFO", color: "#a15095", class: "\uD83D\uDE80", rarity: "Rare", cash: [17e3, 7e4, 7e5, 7e6, 7e7], time: [2, 2, 2, 2, 2], price: [21e5, 23e6, 25e7, 28e8] },
  2460. { name: "Spaceship", color: "#ffcb29", class: "\uD83D\uDE80", rarity: "Epic", cash: [6e4, 32e4, 21e5, 15e6, 85e6], time: [5, 4, 3, 2, 1], price: [48e5, 46e6, 54e7, 68e8] },
  2461. { name: "Astronaut", color: "#9bd4ee", class: "\uD83D\uDE80", rarity: "Legendary", cash: [45e3, 26e4, 25e5, 38e6, 55e7], time: [3, 3, 2, 2, 2], price: [65e5, 1e8, 17e8, 27e9] },
  2462. { name: "Lil Bot", color: "#3e564a", class: "\uD83E\uDD16", rarity: "Uncommon", cash: [4e3, 12e3, 18e4, 19e5, 25e6], time: [1, 1, 1, 1, 1], price: [73e4, 12e6, 13e7, 19e8] },
  2463. { name: "Lovely Bot", color: "#f179af", class: "\uD83E\uDD16", rarity: "Uncommon", cash: [16e3, 65e3, 65e4, 48e5, 42e6], time: [3, 3, 3, 2, 2], price: [13e5, 14e6, 17e7, 16e8] },
  2464. { name: "Angry Bot", color: "#f1613a", class: "\uD83E\uDD16", rarity: "Uncommon", cash: [22e3, 85e3, 8e5, 62e5, 65e6], time: [4, 4, 4, 3, 3], price: [12e5, 13e6, 15e7, 17e8] },
  2465. { name: "Happy Bot", color: "#51ba6b", class: "\uD83E\uDD16", rarity: "Uncommon", cash: [11e3, 45e3, 5e5, 25e5, 3e7], time: [2, 2, 2, 1, 1], price: [14e5, 15e6, 18e7, 24e8] },
  2466. { name: "Watson", color: "#d69b5a", class: "\uD83E\uDD16", rarity: "Rare", cash: [24e3, 1e5, 1e6, 1e7, 1e8], time: [3, 3, 3, 3, 3], price: [2e6, 22e6, 24e7, 26e8] },
  2467. { name: "Buddy Bot", color: "#9dc6ea", class: "\uD83E\uDD16", rarity: "Rare", cash: [22e3, 95e3, 65e4, 65e5, 65e6], time: [3, 3, 2, 2, 2], price: [19e5, 21e6, 23e7, 25e8] },
  2468. { name: "Brainy Bot", color: "#9ecf7a", class: "\uD83E\uDD16", rarity: "Epic", cash: [5e4, 25e4, 21e5, 21e6, 17e7], time: [4, 3, 3, 3, 2], price: [5e6, 46e6, 5e8, 67e8] },
  2469. { name: "Mega Bot", color: "#d71f27", class: "\uD83E\uDD16", rarity: "Legendary", cash: [8e4, 43e4, 42e5, 62e6, 1e9], time: [5, 5, 3, 3, 3], price: [7e6, 12e7, 19e8, 35e9] },
  2470. ].map((x) => ({ name: x.name, value: JSON.stringify(x) })),
  2471. },
  2472. ],
  2473. run: function (blook) {
  2474. const stateNode = getStateNode();
  2475. if (stateNode.state.blooks.length >= 10) alert("Choose a blook to replace");
  2476. stateNode.waiting = false;
  2477. stateNode.chooseBlook(JSON.parse(blook));
  2478. },
  2479. },
  2480. {
  2481. name: "Free Upgrades",
  2482. description: "Sets upgrade prices to 0 for all current blooks",
  2483. run: function () {
  2484. const prices = [0, 0, 0, 0];
  2485. let stateNode = getStateNode();
  2486. stateNode.setState({ blooks: stateNode.state.blooks.map((blook) => ((blook.price = prices), blook)) });
  2487. },
  2488. },
  2489. {
  2490. name: "Max Blooks",
  2491. description: "Maxes out all your blooks' levels",
  2492. run: function () {
  2493. getStateNode().state.blooks.forEach((blook) => (blook.level = 4));
  2494. },
  2495. },
  2496. {
  2497. name: "Remove Glitches",
  2498. description: "Removes all enemy glitches",
  2499. run: function () {
  2500. let stateNode = getStateNode();
  2501. stateNode.setState({
  2502. bits: 0,
  2503. ads: [],
  2504. hazards: [],
  2505. color: "",
  2506. lol: false,
  2507. joke: false,
  2508. slow: false,
  2509. dance: false,
  2510. glitch: "",
  2511. glitcherName: "",
  2512. glitcherBlook: "",
  2513. });
  2514. clearTimeout(stateNode.adTimeout);
  2515. clearInterval(stateNode.hazardInterval);
  2516. clearTimeout(stateNode.nightTimeout);
  2517. clearTimeout(stateNode.glitchTimeout);
  2518. clearTimeout(stateNode.lolTimeout);
  2519. clearTimeout(stateNode.jokeTimeout);
  2520. clearTimeout(stateNode.slowTimeout);
  2521. clearTimeout(stateNode.danceTimeout);
  2522. clearTimeout(stateNode.nameTimeout);
  2523. },
  2524. },
  2525. {
  2526. name: "Send Glitch",
  2527. description: "Sends a glitch to everyone else playing",
  2528. inputs: [
  2529. {
  2530. name: "Glitch",
  2531. type: "options",
  2532. options: Object.entries({ lb: "Lunch Break", as: "Ad Spam", e37: "Error 37", nt: "Night Time", lo: "#LOL", j: "Jokester", sm: "Slow Mo", dp: "Dance Party", v: "Vortex", r: "Reverse", f: "Flip", m: "Micro" }).map(
  2533. ([value, name]) => ({ name, value })
  2534. ),
  2535. },
  2536. ],
  2537. run: function (val) {
  2538. let stateNode = getStateNode();
  2539. stateNode.safe = true;
  2540. stateNode.props.liveGameController.setVal({ path: `c/${stateNode.props.client.name}/tat`, val });
  2541. },
  2542. },
  2543. {
  2544. name: "Set All MegaBot",
  2545. description: "Sets all your blooks to maxed out Mega Bots",
  2546. run: function () {
  2547. getStateNode().setState({
  2548. blooks: Array.from({ length: 10 }, () => ({
  2549. name: "Mega Bot",
  2550. color: "#d71f27",
  2551. class: "🤖",
  2552. rarity: "Legendary",
  2553. cash: [8e4, 43e4, 42e5, 62e6, 1e9],
  2554. time: [5, 5, 3, 3, 3],
  2555. price: [7e6, 12e7, 19e8, 35e9],
  2556. active: false,
  2557. level: 4,
  2558. bonus: 5.5,
  2559. })),
  2560. });
  2561. },
  2562. },
  2563. {
  2564. name: "Set Cash",
  2565. description: "Sets amount of cash you have",
  2566. inputs: [
  2567. {
  2568. name: "Cash",
  2569. type: "number",
  2570. },
  2571. ],
  2572. run: function (cash) {
  2573. getStateNode().setState({ cash });
  2574. },
  2575. },
  2576. ],
  2577. },
  2578. racing: {
  2579. name: "Racing",
  2580. cheats: [
  2581. {
  2582. name: "Instant Win",
  2583. description: "Instantly Wins the race",
  2584. run: function () {
  2585. const stateNode = getStateNode();
  2586. stateNode.setState({ progress: stateNode.state.goalAmount });
  2587. stateNode.props.liveGameController.setVal({
  2588. path: "c/" + stateNode.props.client.name + "/pr",
  2589. val: stateNode.state.goalAmount,
  2590. });
  2591. },
  2592. },
  2593. {
  2594. name: "Set Questions",
  2595. description: "Sets the number of questions left",
  2596. inputs: [
  2597. {
  2598. name: "Questions",
  2599. type: "number",
  2600. },
  2601. ],
  2602. run: function (progress) {
  2603. let stateNode = getStateNode();
  2604. progress = stateNode.props.client.amount - progress;
  2605. stateNode.setState({ progress });
  2606. stateNode.props.liveGameController.setVal({
  2607. path: "c/" + stateNode.props.client.name + "/pr",
  2608. val: progress,
  2609. });
  2610. },
  2611. },
  2612. ],
  2613. },
  2614. rush: {
  2615. name: "Blook Rush",
  2616. cheats: [
  2617. {
  2618. name: "Set Blooks",
  2619. description: "Sets amount of blooks you or your team has",
  2620. inputs: [
  2621. {
  2622. name: "Blooks",
  2623. type: "number",
  2624. },
  2625. ],
  2626. run: function (numBlooks) {
  2627. let stateNode = getStateNode();
  2628. stateNode.setState({ numBlooks });
  2629. stateNode.props.liveGameController.setVal({
  2630. path: (stateNode.isTeam ? "a/" : "c/") + stateNode.props.client.name + "/bs",
  2631. val: numBlooks,
  2632. });
  2633. },
  2634. },
  2635. {
  2636. name: "Set Defense",
  2637. description: "Sets amount of defense you or your team has (Max 4)",
  2638. inputs: [
  2639. {
  2640. name: "Defense (max 4)",
  2641. type: "number",
  2642. max: 4,
  2643. },
  2644. ],
  2645. run: function (defense) {
  2646. let numDefense = Math.min(defense, 4);
  2647. let stateNode = getStateNode();
  2648. stateNode.setState({ numDefense });
  2649. stateNode.props.liveGameController.setVal({
  2650. path: (stateNode.isTeam ? "a/" : "c/") + stateNode.props.client.name + "/d",
  2651. val: numDefense,
  2652. });
  2653. },
  2654. },
  2655. ],
  2656. },
  2657. tower: {
  2658. name: "Tower of Doom",
  2659. cheats: [
  2660. {
  2661. name: "Fill Deck",
  2662. description: "Fills your deck with every maxed out card and artifact (Only works on towers page)",
  2663. run: function () {
  2664. if (window.location.pathname == "/tower/map") {
  2665. const stateNode = getStateNode();
  2666. stateNode.props.tower.artifacts =
  2667. "Medical Kit|Fury Relic|Survival Guide|Steel Socks|Piggy Bank|Lucky Feather|Coupon|Cheese|Tasty Egg|Training Weights|Mighty Shield|Toxic Waste|Lifeline Totem|Cursed Hourglass|Band-Aid|Elder Coins|Captain's Anchor|Chess Pieces|Pink Hippo|Anorak's Wizard Cap|Dave's Doggo|Anubis' Obelisk|Farm Tractor|Magic Seedling|Just A Bone|Cozy Igloo|King's Crown|Sacred Scroll".split(
  2668. "|"
  2669. );
  2670. stateNode.props.tower.cards =
  2671. "Chick,🌽|Chicken,🌽|Cow,🌽|Goat,🌽|Horse,🌽|Pig,🌽|Sheep,🌽|Duck,🌽|Dog,🌽|Cat,🐾|Rabbit,🐾|Goldfish,🐾|Hamster,🐾|Turtle,🐾|Kitten,🐾|Puppy,🐾|Bear,🌲|Moose,🌲|Fox,🌲|Raccoon,🌲|Squirrel,🌲|Owl,🌲|Hedgehog,🌲|Baby Penguin,❄️|Penguin,❄️|Arctic Fox,❄️|Snowy Owl,❄️|Polar Bear,❄️|Arctic Hare,❄️|Seal,❄️|Walrus,❄️|Tiger,🌴|Panther,🌴|Cockatoo,🌴|Orangutan,🌴|Anaconda,🌴|Macaw,🌴|Jaguar,🌴|Capuchin,🌴|Toucan,🌴|Parrot,🌴|Elf,⚔️|Witch,⚔️|Wizard,⚔️|Fairy,⚔️|Slime Monster,⚔️|Jester,⚔️|Dragon,⚔️|Unicorn,⚔️|Queen,⚔️|King,⚔️|Snow Globe,☃️|Holiday Gift,☃️|Hot Chocolate,☃️|Gingerbread Man,☃️|Gingerbread House,☃️|Holiday Wreath,☃️|Snowman,☃️|Santa Claus,☃️|Two of Spades,🏰|Eat Me,🏰|Drink Me,🏰|Alice,🏰|Queen of Hearts,🏰|Dormouse,🏰|White Rabbit,🏰|Cheshire Cat,🏰|Caterpillar,🏰|Mad Hatter,🏰|King of Hearts,🏰"
  2672. .split("|")
  2673. .map((x) => {
  2674. const [blook, c] = x.split(",");
  2675. return { strength: 20, charisma: 20, wisdom: 20, class: c, blook };
  2676. });
  2677. try {
  2678. stateNode.props.addTowerNode();
  2679. } catch {}
  2680. stateNode.setState({ showDeck: false });
  2681. } else alert("You need to be on the map to run this cheat!");
  2682. },
  2683. },
  2684. {
  2685. name: "Max Cards",
  2686. description: "Maxes out all the cards in your deck",
  2687. run: function () {
  2688. if (window.location.pathname == "/tower/map") {
  2689. const stateNode = getStateNode();
  2690. stateNode.props.tower.cards.forEach((card) => {
  2691. card.strength = 20;
  2692. card.charisma = 20;
  2693. card.wisdom = 20;
  2694. });
  2695. try {
  2696. stateNode.forceUpdate();
  2697. } catch {}
  2698. } else alert("You need to be on the map to run this cheat!");
  2699. },
  2700. },
  2701. {
  2702. name: "Max Health",
  2703. description: "Fills the player's health",
  2704. run: function () {
  2705. if (window.location.pathname == "/tower/battle") getStateNode().setState({ myHealth: 100, myLife: 100 });
  2706. else alert("You need to be in battle to run this cheat!");
  2707. },
  2708. },
  2709. {
  2710. name: "Max Card Stats",
  2711. description: "Maxes out player's current card (Only works on attribute select page)",
  2712. run: function () {
  2713. const stateNode = getStateNode();
  2714. if (stateNode.state.phase !== "select") alert("You must be on the attribute selection page!");
  2715. else stateNode.setState({ myCard: { ...stateNode.state.myCard, strength: 20, charisma: 20, wisdom: 20 } });
  2716. },
  2717. },
  2718. {
  2719. name: "Min Enemy Stats",
  2720. description: "Makes the enemy card stats all 0 (Only works on attribute select page)",
  2721. run: function () {
  2722. const stateNode = getStateNode();
  2723. if (stateNode.state.phase !== "select") alert("You must be on the attribute selection page!");
  2724. else stateNode.setState({ enemyCard: { ...stateNode.state.enemyCard, strength: 0, charisma: 0, wisdom: 0 } });
  2725. },
  2726. },
  2727. {
  2728. name: "Set Coins",
  2729. description: "Try's to set amount of tower coins you have",
  2730. inputs: [
  2731. {
  2732. name: "Coins",
  2733. type: "number",
  2734. },
  2735. ],
  2736. run: function (coins) {
  2737. if (window.location.pathname == "/tower/battle")
  2738. try {
  2739. getStateNode().props.setTowerCoins(coins);
  2740. } catch {}
  2741. else alert("You need to be in battle to run this cheat!");
  2742. },
  2743. },
  2744. ],
  2745. },
  2746. kingdom: {
  2747. name: "Crazy Kingdom",
  2748. cheats: [
  2749. {
  2750. name: "Choice ESP",
  2751. description: "Shows you what will happen if you say Yes or No",
  2752. type: "toggle",
  2753. enabled: false,
  2754. data: null,
  2755. run: function () {
  2756. if (!this.enabled) {
  2757. this.enabled = true;
  2758. this.data = setInterval(
  2759. (stats) => {
  2760. let stateNode = getStateNode();
  2761. let elements = Array.prototype.reduce.call(document.querySelectorAll("[class*=statContainer]"), (obj, container, i) => ((obj[stats[i]] = container), obj), {});
  2762. if (stateNode.state.phase == "choice") {
  2763. Array.prototype.forEach.call(document.querySelectorAll(".choiceESP"), (x) => x.remove());
  2764. Object.keys(stateNode.state.guest.yes || {}).forEach((x) => {
  2765. if (elements[x] == null) return;
  2766. let element = document.createElement("div");
  2767. element.className = "choiceESP";
  2768. element.style = "font-size: 24px; color: rgb(75, 194, 46); font-weight: bolder;";
  2769. element.innerText = String(stateNode.state.guest.yes[x]);
  2770. elements[x].appendChild(element);
  2771. });
  2772. Object.keys(stateNode.state.guest.no || {}).forEach((x) => {
  2773. if (elements[x] == null) return;
  2774. let element = document.createElement("div");
  2775. element.className = "choiceESP";
  2776. element.style = "font-size: 24px; color: darkred; font-weight: bolder;";
  2777. element.innerText = String(stateNode.state.guest.no[x]);
  2778. elements[x].appendChild(element);
  2779. });
  2780. Array.prototype.forEach.call(
  2781. document.querySelectorAll("[class*=guestButton][role=button]"),
  2782. (x) => (x.onclick = () => Array.prototype.forEach.call(document.querySelectorAll(".choiceESP"), (x) => x.remove()))
  2783. );
  2784. }
  2785. },
  2786. 50,
  2787. ["materials", "people", "happiness", "gold"]
  2788. );
  2789. } else {
  2790. this.enabled = false;
  2791. clearInterval(this.data);
  2792. Array.prototype.forEach.call(document.querySelectorAll(".choiceESP"), (x) => x.remove());
  2793. this.data = null;
  2794. }
  2795. },
  2796. },
  2797. {
  2798. name: "Disable Tax Toucan",
  2799. description: "Tax evasion",
  2800. run: function () {
  2801. getStateNode().taxCounter = Number.MAX_VALUE;
  2802. },
  2803. },
  2804. {
  2805. name: "Max Stats",
  2806. description: "Sets all resources to the max",
  2807. run: function () {
  2808. getStateNode().setState({ materials: 100, people: 100, happiness: 100, gold: 100 });
  2809. },
  2810. },
  2811. {
  2812. name: "Set Guests",
  2813. description: "Sets the amount of guests you've seen",
  2814. inputs: [
  2815. {
  2816. name: "Guests",
  2817. type: "number",
  2818. },
  2819. ],
  2820. run: function (guestScore) {
  2821. getStateNode().setState({ guestScore });
  2822. },
  2823. },
  2824. {
  2825. name: "Skip Guest",
  2826. description: "Skips the current guest",
  2827. run: function () {
  2828. getStateNode().nextGuest();
  2829. },
  2830. },
  2831. ],
  2832. },
  2833. toy: {
  2834. name: "Santa's Workshop",
  2835. cheats: [
  2836. {
  2837. name: "Remove Distractions",
  2838. description: "Removes all enemy distractions",
  2839. run: function () {
  2840. getStateNode().setState({ fog: !1, dusk: !1, wind: !1, plow: !1, blizzard: !1, force: !1, canada: !1, trees: [!1, !1, !1, !1, !1, !1, !1, !1, !1, !1] });
  2841. },
  2842. },
  2843. {
  2844. name: "Send Distraction",
  2845. description: "Sends a distraction to everyone else playing",
  2846. inputs: [
  2847. {
  2848. name: "Distraction",
  2849. type: "options",
  2850. options: Object.entries({ c: "Oh Canada", b: "Blizzard", f: "Fog Spell", d: "Dark & Dusk", w: "Howling Wind", g: "Gift Time!", t: "TREES", s: "Snow Plow", fr: "Use The Force" }).map(([value, name]) => ({
  2851. name,
  2852. value,
  2853. })),
  2854. },
  2855. ],
  2856. run: function (val) {
  2857. let stateNode = getStateNode();
  2858. stateNode.safe = true;
  2859. stateNode.props.liveGameController.setVal({ path: `c/${stateNode.props.client.name}/tat`, val });
  2860. },
  2861. },
  2862. {
  2863. name: "Set Toys",
  2864. description: "Sets amount of toys",
  2865. inputs: [
  2866. {
  2867. name: "Toys",
  2868. type: "number",
  2869. },
  2870. ],
  2871. run: function (toys) {
  2872. let stateNode = getStateNode();
  2873. stateNode.setState({ toys });
  2874. stateNode.props.liveGameController.setVal({
  2875. path: "c/" + stateNode.props.client.name + "/t",
  2876. val: toys,
  2877. });
  2878. },
  2879. },
  2880. {
  2881. name: "Set Toys Per Question",
  2882. description: "Sets amount of toys per question",
  2883. inputs: [
  2884. {
  2885. name: "Toys Per Question",
  2886. type: "number",
  2887. },
  2888. ],
  2889. run: function (toysPerQ) {
  2890. getStateNode().setState({ toysPerQ });
  2891. },
  2892. },
  2893. {
  2894. name: "Swap Toys",
  2895. description: "Swaps toys with someone",
  2896. inputs: [
  2897. {
  2898. name: "Player",
  2899. type: "options",
  2900. options: () => {
  2901. let stateNode = getStateNode();
  2902. return stateNode.props.liveGameController._liveApp ? new Promise((res) => stateNode.props.liveGameController.getDatabaseVal("c", (players) => players && res(Object.keys(players)))) : [];
  2903. },
  2904. },
  2905. ],
  2906. run: function (target) {
  2907. let stateNode = getStateNode();
  2908. stateNode.props.liveGameController.getDatabaseVal("c", (players) => {
  2909. if (!players || players[target] == null) return;
  2910. stateNode.props.liveGameController.setVal({
  2911. path: "c/" + stateNode.props.client.name + "/tat",
  2912. val: `${target}:swap:${stateNode.state.toys}`,
  2913. });
  2914. stateNode.setState({ toys: players[target].t });
  2915. });
  2916. },
  2917. },
  2918. ],
  2919. },
  2920. flappy: {
  2921. name: "Flappy Blook",
  2922. cheats: [
  2923. {
  2924. name: "Toggle Ghost",
  2925. description: "Lets you go through the pipes",
  2926. type: "toggle",
  2927. enabled: false,
  2928. run: function () {
  2929. this.enabled = !this.enabled;
  2930. for (const body of Object.values(document.querySelector("#phaser-bouncy"))[0].return.updateQueue.lastEffect.deps[0].current.config.sceneConfig.physics.world.bodies.entries) {
  2931. if (!body.gameObject.frame.texture.key.startsWith("blook")) continue;
  2932. body.checkCollision.none = this.enabled;
  2933. body.gameObject.setAlpha(this.enabled ? 0.5 : 1);
  2934. break;
  2935. }
  2936. },
  2937. },
  2938. {
  2939. name: "Set Score",
  2940. description: "Sets flappy blook score",
  2941. inputs: [
  2942. {
  2943. name: "Score",
  2944. type: "number",
  2945. },
  2946. ],
  2947. run: function (score) {
  2948. Object.values(document.querySelector("#phaser-bouncy"))[0].return.updateQueue.lastEffect.deps[1](score || 0);
  2949. },
  2950. },
  2951. ],
  2952. },
  2953. };
  2954.  
  2955. const searchPage = document.createElement("div");
  2956. searchPage.className = classes.searchPage;
  2957.  
  2958. const searchbarHolder = document.createElement("form");
  2959. searchbarHolder.className = classes.searchbarHolder;
  2960.  
  2961. const searchbarInput = document.createElement("input");
  2962. searchbarInput.placeholder = "Search Cheats";
  2963. searchbarInput.className = classes.searchbarInput;
  2964.  
  2965. const searchbarButton = document.createElement("div");
  2966. searchbarButton.onclick = () => (searchbarInput.value = "");
  2967. searchbarButton.innerHTML = '<i class="fas fa-times" style="line-height: 1;"></i>';
  2968. searchbarButton.className = classes.searchbarButton;
  2969.  
  2970. searchbarHolder.append(searchbarInput, searchbarButton);
  2971.  
  2972. const searchResults = document.createElement("div");
  2973. searchResults.className = classes.noScroll + " " + classes.searchResults;
  2974.  
  2975. const noResult = document.createElement("div");
  2976. noResult.className = classes.noResult;
  2977.  
  2978. searchPage.append(searchbarHolder, searchResults);
  2979.  
  2980. let searchThrottle,
  2981. gamemodeResults = {};
  2982. searchPage.onPath = searchbarHolder.onsubmit = (e) => {
  2983. clearTimeout(searchThrottle);
  2984. e?.preventDefault?.();
  2985. const query = searchbarInput.value.toLowerCase();
  2986. let hasResults = false;
  2987. for (const child of searchResults.children) {
  2988. if (child != noResult) {
  2989. if (child.dataset[datasets.mode]?.includes?.(query) || child.dataset[datasets.name].includes(query) || child.dataset[datasets.description]?.includes?.(query)) {
  2990. hasResults = true;
  2991. child.style.display = "block";
  2992. if (child.dataset[datasets.mode]) gamemodeResults[child.dataset[datasets.mode]].style.display = "block";
  2993. } else child.style.display = "none";
  2994. }
  2995. }
  2996. if (!hasResults) {
  2997. noResult.innerText = `No results found for "${query}"`;
  2998. noResult.style.display = "block";
  2999. } else noResult.style.display = "none";
  3000. };
  3001.  
  3002. searchbarInput.oninput = (e) => {
  3003. clearTimeout(searchThrottle);
  3004. searchThrottle = setTimeout(searchbarHolder.onsubmit, 1000);
  3005. };
  3006.  
  3007. const favoritesPage = document.createElement("div");
  3008. favoritesPage.className = classes.noScroll + " " + classes.favoritesPage;
  3009.  
  3010. const noFavorites = document.createElement("span");
  3011. noFavorites.innerText = "You have no favorites.";
  3012.  
  3013. favoritesPage.append(noFavorites);
  3014.  
  3015. favoritesPage.onPath = () => {
  3016. noFavorites.style.display = favoritesPage.querySelector("[data-" + datasets.favorited + "='true']") == null ? "block" : "none";
  3017. };
  3018.  
  3019. gamemodesList.innerHTML = "";
  3020. searchResults.innerHTML = "";
  3021. searchResults.append(noResult);
  3022. for (const mode in cheats) {
  3023. const gamemode = document.createElement("div");
  3024. gamemode.className = classes.gamemode;
  3025. const image = document.createElement("img");
  3026. image.src = cheats[mode].img;
  3027. const name = document.createElement("div");
  3028. image.alt = name.innerText = cheats[mode].name;
  3029. gamemode.append(image, name);
  3030.  
  3031. const cheatsPage = document.createElement("div");
  3032. cheatsPage.className = classes.contentPage;
  3033.  
  3034. const cheatsList = document.createElement("div");
  3035. cheatsList.className = classes.cheatsList + " " + classes.noScroll;
  3036.  
  3037. const inputElements = [];
  3038. cheatsPage.onPath = () => inputElements.forEach((x) => x());
  3039.  
  3040. const searchResultSeparator = document.createElement("div");
  3041. searchResultSeparator.onclick = () => path.push(cheats[mode].name, cheatsPage);
  3042. searchResultSeparator.className = classes.searchResultSeparator;
  3043. searchResultSeparator.dataset[datasets.name] = (searchResultSeparator.innerText = cheats[mode].name).toLowerCase();
  3044. gamemodeResults[cheats[mode].name.toLowerCase()] = searchResultSeparator;
  3045. searchResults.append(searchResultSeparator);
  3046.  
  3047. const favoritesSeparator = searchResultSeparator.cloneNode(true);
  3048. favoritesSeparator.dataset[datasets.favorites] = 0;
  3049. favoritesSeparator.onclick = searchResultSeparator.onclick;
  3050. favoritesPage.append(favoritesSeparator);
  3051.  
  3052. for (const cheat of cheats[mode].cheats) {
  3053. const cheatId = `${mode}.${cheat.name.toLowerCase()}.${cheat.type == "toggle" ? "toggle" : "execute"}`;
  3054. const cheatElement = document.createElement("div");
  3055.  
  3056. const searchResult = document.createElement("div");
  3057. searchResult.className = classes.searchResult;
  3058.  
  3059. const searchResultInfo = document.createElement("div");
  3060. searchResultInfo.className = classes.searchResultInfo;
  3061.  
  3062. const searchResultName = document.createElement("div");
  3063. searchResultName.className = classes.searchResultName;
  3064. searchResult.dataset[datasets.name] = (searchResultName.innerText = cheat.name + (cheat.type == "toggle" && !cheat.name.includes("toggle") ? " (Toggle)" : "")).toLowerCase();
  3065. searchResult.dataset[datasets.mode] = cheats[mode].name.toLowerCase();
  3066. const searchResultDescription = document.createElement("div");
  3067. searchResultDescription.className = classes.searchResultDescription;
  3068. searchResult.dataset[datasets.description] = (searchResultDescription.innerText = cheat.description).toLowerCase();
  3069.  
  3070. searchResultInfo.append(searchResultName, searchResultDescription);
  3071.  
  3072. searchResult.onclick = () => {
  3073. path.push(searchResultName.innerText, cheatsPage);
  3074. cheatElement.scrollIntoView();
  3075. cheatElement.animate(
  3076. [
  3077. {
  3078. color: "var(--textColor)",
  3079. textShadow: "0 0 0px var(--highlight)",
  3080. },
  3081. {
  3082. color: "var(--highlight)",
  3083. textShadow: "0 0 5px var(--highlight)",
  3084. offset: 0.25,
  3085. },
  3086. {
  3087. color: "var(--textColor)",
  3088. textShadow: "0 0 0px var(--highlight)",
  3089. },
  3090. ],
  3091. 1500
  3092. );
  3093. };
  3094.  
  3095. searchResult.append(searchResultInfo);
  3096.  
  3097. searchResults.append(searchResult);
  3098.  
  3099. const cheatTop = document.createElement("div");
  3100. cheatTop.className = classes.cheatTop;
  3101. const cheatInfo = document.createElement("div");
  3102. cheatInfo.className = classes.cheatInfo;
  3103. const cheatName = document.createElement("span");
  3104. cheatName.innerText = cheat.name;
  3105. cheatName.className = classes.cheatName;
  3106.  
  3107. const favoriteButton = document.createElement("i");
  3108. favoriteButton.className = "far fa-star " + classes.favoriteButton;
  3109.  
  3110. const favoriteInner = document.createElement("i");
  3111. favoriteInner.className = "fas fa-star";
  3112. favoriteButton.append(favoriteInner);
  3113.  
  3114. let favoritesPageCopy = searchResult.cloneNode(true);
  3115. favoritesPageCopy.dataset[datasets.favorited] = false;
  3116. favoritesPageCopy.onclick = searchResult.onclick;
  3117. favoritesPage.append(favoritesPageCopy);
  3118.  
  3119. favoriteButton.onclick = () => {
  3120. const favorited = cheatId in Settings.data.favorites;
  3121. favoriteInner.classList.toggle(classes.filled, !favorited);
  3122. if (favorited) {
  3123. delete Settings.data.favorites[cheatId];
  3124. favoritesPageCopy.dataset[datasets.favorited] = false;
  3125. favoritesSeparator.dataset[datasets.favorites]--;
  3126. } else {
  3127. Settings.data.favorites[cheatId] = 1;
  3128. favoritesPageCopy.dataset[datasets.favorited] = true;
  3129. favoritesSeparator.dataset[datasets.favorites]++;
  3130. }
  3131. favoritesPage.onPath();
  3132. Settings.setData(Settings.data);
  3133. };
  3134.  
  3135. if (cheatId in (Settings.data.favorites ??= {})) {
  3136. favoriteInner.classList.toggle(classes.filled, true);
  3137. favoritesPageCopy.dataset[datasets.favorited] = true;
  3138. favoritesSeparator.dataset[datasets.favorites]++;
  3139. }
  3140.  
  3141. cheatName.append(favoriteButton);
  3142.  
  3143. const cheatDescription = document.createElement("span");
  3144. cheatDescription.innerText = cheat.description;
  3145. cheatDescription.className = classes.cheatDescription;
  3146. cheatInfo.append(cheatName, cheatDescription);
  3147. cheatElement.append(cheatTop);
  3148. const inputs = [];
  3149. if (Array.isArray(cheat.inputs)) {
  3150. const cheatInputs = document.createElement("div");
  3151. cheatInputs.className = classes.cheatInputs;
  3152. for (const input of cheat.inputs) {
  3153. const inputElement = document.createElement("div");
  3154. const inputName = document.createElement("span");
  3155. inputName.innerText = input.name;
  3156. inputElement.append(inputName);
  3157. cheatInputs.append(inputElement);
  3158.  
  3159. if (input.type == "options") {
  3160. const inputField = document.createElement("select");
  3161. inputField.dataset[datasets.type] = "options";
  3162. inputElement.append(inputField);
  3163. inputs.push(inputField);
  3164. let curField = inputField;
  3165. const updateOptions = () => {
  3166. let choose = input.options;
  3167.  
  3168. const newInputField = document.createElement("select");
  3169. newInputField.dataset[datasets.type] = "options";
  3170. inputs[inputs.indexOf(curField)] = newInputField;
  3171. curField.replaceWith(newInputField);
  3172. curField = newInputField;
  3173.  
  3174. if (typeof choose == "function")
  3175. try {
  3176. choose = choose();
  3177. } catch {
  3178. choose = [];
  3179. }
  3180. if (choose instanceof Promise) {
  3181. const waiting = document.createElement("option");
  3182. waiting.value = '""';
  3183. waiting.innerHTML = "Loading Options...";
  3184. curField.append(waiting);
  3185. choose.then((choices) => {
  3186. if (choices?.length > 0) {
  3187. curField.innerHTML = "";
  3188. for (const choice of choices) {
  3189. const option = document.createElement("option");
  3190. option.value = JSON.stringify(choice?.value ?? choice);
  3191. option.innerHTML = choice?.name || choice;
  3192. curField.append(option);
  3193. }
  3194. } else {
  3195. const newInputField = document.createElement("input");
  3196. inputs[inputs.indexOf(curField)] = newInputField;
  3197. curField.replaceWith(newInputField);
  3198. newInputField.dataset[datasets.type] = "string";
  3199. newInputField.placeholder = input.name;
  3200. curField = newInputField;
  3201. }
  3202. });
  3203. } else {
  3204. if (choose?.length > 0) {
  3205. for (const choice of choose) {
  3206. const option = document.createElement("option");
  3207. option.value = JSON.stringify(choice?.value ?? choice);
  3208. option.innerHTML = choice?.name || choice;
  3209. curField.append(option);
  3210. }
  3211. } else {
  3212. const newInputField = document.createElement("input");
  3213. inputs[inputs.indexOf(curField)] = newInputField;
  3214. curField.replaceWith(newInputField);
  3215. newInputField.dataset[datasets.type] = "string";
  3216. newInputField.placeholder = input.name;
  3217. curField = newInputField;
  3218. }
  3219. }
  3220. };
  3221. updateOptions();
  3222. inputElements.push(updateOptions);
  3223. } else {
  3224. const inputField = document.createElement("input");
  3225. inputField.dataset[datasets.type] = input.type;
  3226. if (input.type == "number") {
  3227. inputField.type = "number";
  3228. inputField.min = input.min;
  3229. inputField.max = input.max;
  3230. inputField.value = input.value || (input.min ?? 0);
  3231. }
  3232. inputField.placeholder = input.name;
  3233. inputElement.append(inputField);
  3234. inputs.push(inputField);
  3235. }
  3236. }
  3237. cheatElement.append(cheatInputs);
  3238. }
  3239. cheatTop.append(cheatInfo);
  3240. const runButton = document.createElement("div");
  3241. runButton.className = classes.runCheat;
  3242. if (cheat.type == "toggle") {
  3243. runButton.innerText = "Toggle On";
  3244. runButton.classList.add(classes.toggleCheat);
  3245. } else runButton.innerText = "Execute";
  3246. runButton.onclick = () => {
  3247. cheat.run.apply(
  3248. cheat,
  3249. inputs.map((x) => (x.dataset[datasets.type] == "number" ? parseFloat("0" + x.value) : x.dataset[datasets.type] == "options" ? JSON.parse(x.value) : x.value))
  3250. );
  3251. if (cheat.type == "toggle") {
  3252. runButton.innerText = "Toggle " + (cheat.enabled ? "Off" : "On");
  3253. runButton.classList.toggle(classes.active, cheat.enabled);
  3254. Logs.addLog(`Toggled "${cheat.name}" ${cheat.enabled ? "on" : "off"}`, cheat.enabled ? "var(--toggleOn)" : "var(--toggleOff)");
  3255. }
  3256. Logs.addLog(`Ran "${cheat.name}"`, "var(--highlight)");
  3257. };
  3258. cheatTop.append(runButton);
  3259. cheatsList.append(cheatElement);
  3260. }
  3261.  
  3262. cheatsPage.append(cheatsList);
  3263.  
  3264. gamemode.onclick = () => path.push(cheats[mode].name, cheatsPage);
  3265. gamemodesList.append(gamemode);
  3266. }
  3267. gamemodesPage.append(gamemodesList);
  3268.  
  3269. const creditsPage = document.createElement("div");
  3270. creditsPage.className = classes.creditsPage;
  3271.  
  3272. const licenseMessage = document.createElement("div");
  3273. licenseMessage.className = classes.licenseMessage;
  3274.  
  3275. const copyrightTag = document.createElement("span");
  3276. copyrightTag.className = classes.copyrightTag;
  3277.  
  3278. copyrightTag.innerText = `Dont steal my ui pls :D`;
  3279.  
  3280. const codingCredits = document.createElement("ul");
  3281. codingCredits.className = classes.codingCredits;
  3282.  
  3283. codingCredits.append(createCredit("By Adrian"));
  3284.  
  3285. const creditLinks = document.createElement("ul");
  3286. creditLinks.className = classes.creditLinks;
  3287.  
  3288.  
  3289. function parseTime(d) {
  3290. const hour = d.getHours() % 12 == 0 ? 12 : d.getHours() % 12;
  3291. const minutes = d.getMinutes().toString().padStart(2, "0");
  3292. return `${hour}:${minutes} ${d.getHours() >= 12 ? "PM" : "AM"}`;
  3293. }
  3294.  
  3295. function parseDate(d) {
  3296. const month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][d.getMonth()];
  3297. return `${month} ${d.getDate()}${getOrdinal(d.getDate())}, ${d.getFullYear()} - ${parseTime(d)}`;
  3298. }
  3299.  
  3300. const uploadDates = document.createElement("ul");
  3301. uploadDates.className = classes.uploadDates;
  3302.  
  3303. try {
  3304. let currentDate = new Date(timeProcessed),
  3305. latestDate = new Date(latestProcess);
  3306. uploadDates.append(createCredit("Current GUI Upload Date", parseDate(currentDate)));
  3307. if (latestProcess != -1) uploadDates.append(createCredit("Latest GUI Upload Date", parseDate(latestDate)));
  3308. if (currentDate < latestDate) {
  3309. const warning = document.createElement("span");
  3310. warning.className = classes.warning;
  3311. warning.innerText = "You are using an outdated version of AA-Gui, check out the GitHub / GitLab for a newer version.";
  3312. uploadDates.append(warning);
  3313. }
  3314. } catch {
  3315. const warning = document.createElement("span");
  3316. warning.className = classes.warning;
  3317. warning.innerText = "Unable to check update information.";
  3318. uploadDates.append(warning);
  3319. }
  3320.  
  3321. creditsPage.append(codingCredits, copyrightTag);
  3322.  
  3323. function getOrdinal(n) {
  3324. if (n % 10 == 1 && n % 100 != 11) return "st";
  3325. if (n % 10 == 2 && n % 100 != 12) return "nd";
  3326. if (n % 10 == 3 && n % 100 != 13) return "rd";
  3327. return "th";
  3328. }
  3329.  
  3330. function createCredit(contribution, html) {
  3331. const listItem = document.createElement("li");
  3332. const contributionText = document.createElement("strong");
  3333. contributionText.innerText = contribution + ":";
  3334. const right = document.createElement("span");
  3335. right.innerHTML = html;
  3336. listItem.append(contributionText, right);
  3337. return listItem;
  3338. }
  3339.  
  3340. const settingsPage = document.createElement("div");
  3341. settingsPage.className = classes.noScroll + " " + classes.settingsPage;
  3342.  
  3343. const searchResultSeparator = document.createElement("div");
  3344. searchResultSeparator.onclick = () => path.push("Settings", settingsPage);
  3345. searchResultSeparator.className = classes.searchResultSeparator;
  3346. searchResultSeparator.innerText = "Settings";
  3347. searchResultSeparator.dataset[datasets.name] = "settings";
  3348. gamemodeResults.settings = searchResultSeparator;
  3349. searchResults.append(searchResultSeparator);
  3350.  
  3351. const settingRefresh = [];
  3352. function addSetting(name, description, input, onUpdate) {
  3353. const settingElement = document.createElement("div");
  3354.  
  3355. const searchResult = document.createElement("div");
  3356. searchResult.className = classes.searchResult;
  3357.  
  3358. const searchResultInfo = document.createElement("div");
  3359. searchResultInfo.className = classes.searchResultInfo;
  3360.  
  3361. const searchResultName = document.createElement("div");
  3362. searchResultName.className = classes.searchResultName;
  3363. searchResult.dataset[datasets.name] = (searchResultName.innerText = name).toLowerCase();
  3364. searchResult.dataset[datasets.mode] = "settings";
  3365. const searchResultDescription = document.createElement("div");
  3366. searchResultDescription.className = classes.searchResultDescription;
  3367. searchResult.dataset[datasets.description] = (searchResultDescription.innerText = description).toLowerCase();
  3368.  
  3369. searchResultInfo.append(searchResultName, searchResultDescription);
  3370.  
  3371. searchResult.onclick = () => {
  3372. path.push(name, settingsPage);
  3373. settingElement.scrollIntoView();
  3374. settingElement.animate(
  3375. [
  3376. {
  3377. color: "var(--textColor)",
  3378. textShadow: "0 0 0px var(--highlight)",
  3379. },
  3380. {
  3381. color: "var(--highlight)",
  3382. textShadow: "0 0 5px var(--highlight)",
  3383. offset: 0.25,
  3384. },
  3385. {
  3386. color: "var(--textColor)",
  3387. textShadow: "0 0 0px var(--highlight)",
  3388. },
  3389. ],
  3390. 1500
  3391. );
  3392. };
  3393.  
  3394. searchResult.append(searchResultInfo);
  3395.  
  3396. searchResults.append(searchResult);
  3397.  
  3398. const settingTop = document.createElement("div");
  3399. settingTop.className = classes.cheatTop;
  3400. const settingInfo = document.createElement("div");
  3401. settingInfo.className = classes.cheatInfo;
  3402. const settingName = document.createElement("span");
  3403. settingName.innerText = name;
  3404. settingName.className = classes.cheatName;
  3405. const settingDescription = document.createElement("span");
  3406. settingDescription.innerText = description;
  3407. settingDescription.className = classes.cheatDescription;
  3408. settingInfo.append(settingName, settingDescription);
  3409. settingElement.append(settingTop);
  3410.  
  3411. const settingInputs = document.createElement("div");
  3412. settingInputs.className = classes.cheatInputs;
  3413.  
  3414. const inputElement = document.createElement("div");
  3415. const inputName = document.createElement("span");
  3416. inputName.innerText = input.name;
  3417. inputElement.append(inputName);
  3418. settingInputs.append(inputElement);
  3419.  
  3420. let inputField = document.createElement("input");
  3421. inputField.dataset[datasets.type] = input.type;
  3422. if (input.type == "keybind") {
  3423. inputField.readOnly = true;
  3424. let locked = false;
  3425. inputField.data = input.data;
  3426. inputField.onclick = async () => {
  3427. if (locked) return;
  3428. inputField.value = "Waiting for input...";
  3429. locked = true;
  3430. inputField.data = await input.listen((e) => (inputField.value = e + "..."));
  3431. locked = false;
  3432. inputField.value = inputField.value.slice(0, -3);
  3433. };
  3434. (settingRefresh[settingRefresh.length] = () => (inputField.value = input.value()))();
  3435. } else if (input.type == "options") {
  3436. inputField = document.createElement("select");
  3437. inputField.dataset[datasets.type] = "options";
  3438.  
  3439. const defaultOption = document.createElement("option");
  3440. defaultOption.value = "{}";
  3441. defaultOption.innerHTML = "Select a Theme";
  3442. (settingRefresh[settingRefresh.length] = () => (defaultOption.selected = true))();
  3443. inputField.append(defaultOption);
  3444.  
  3445. for (const choice of input.options) {
  3446. const option = document.createElement("option");
  3447. option.value = JSON.stringify(choice?.value ?? choice);
  3448. option.innerHTML = choice?.name || choice;
  3449. inputField.append(option);
  3450. }
  3451. } else {
  3452. if (input.type == "number") {
  3453. inputField.type = "number";
  3454. inputField.min = input.min;
  3455. inputField.max = input.max;
  3456. }
  3457. (settingRefresh[settingRefresh.length] = () => (inputField.value = input.value()))();
  3458. inputField.placeholder = input.name;
  3459. }
  3460. inputElement.append(inputField);
  3461.  
  3462. settingElement.append(settingInputs);
  3463.  
  3464. settingTop.append(settingInfo);
  3465.  
  3466. const runButton = document.createElement("div");
  3467. runButton.className = classes.runCheat;
  3468. runButton.innerText = "Update";
  3469. runButton.onclick = () =>
  3470. onUpdate(inputField.dataset[datasets.type] == "number" ? parseFloat("0" + inputField.value) : inputField.dataset[datasets.type] == "options" ? JSON.parse(inputField.value) : inputField.data ?? inputField.value);
  3471. settingTop.append(runButton);
  3472.  
  3473. settingsPage.append(settingElement);
  3474. }
  3475.  
  3476. settingsPage.onPath = () => settingRefresh.forEach((x) => x());
  3477.  
  3478. addSetting(
  3479. "Hide Keybind",
  3480. "Shortcut to hide to GUI",
  3481. {
  3482. type: "keybind",
  3483. name: "Shortcut",
  3484. data: defaultHideKey,
  3485. value: () => parseKeybind(Settings.data.hideKey),
  3486. listen: (change) => createKeybindListener((keys) => change(parseKeybind(keys))),
  3487. },
  3488. (x) => {
  3489. Settings.setItem("hideKey", x);
  3490. }
  3491. );
  3492. addSetting(
  3493. "Close Keybind",
  3494. "Shortcut to disable all toggles and close GUI",
  3495. {
  3496. type: "keybind",
  3497. name: "Shortcut",
  3498. data: defaultCloseKey,
  3499. value: () => parseKeybind(Settings.data.closeKey),
  3500. listen: (change) => createKeybindListener((keys) => change(parseKeybind(keys))),
  3501. },
  3502. (x) => {
  3503. Settings.setItem("closeKey", x);
  3504. }
  3505. );
  3506. addSetting(
  3507. "Theme",
  3508. "A preset look for the GUI",
  3509. {
  3510. type: "options",
  3511. name: "Preset",
  3512. options: [
  3513. {
  3514. name: "Default",
  3515. value: {
  3516. highlight: variables["--highlight"],
  3517. highlight2: variables["--highlight2"],
  3518. background: variables["--background"],
  3519. background2: variables["--background2"],
  3520. textColor: variables["--textColor"],
  3521. textColor2: variables["--textColor2"],
  3522. toggleOff: variables["--toggleOff"],
  3523. toggleOn: variables["--toggleOn"],
  3524. },
  3525. },
  3526. {
  3527. name: "Crypto Hack",
  3528. value: {
  3529. highlight: "rgb(88 175 88)",
  3530. toggleOn: "#0b601b",
  3531. background: "radial-gradient(#11581e,#041607)",
  3532. background2: "#1a1a1a",
  3533. toggleOff: "#A02626",
  3534. highlight2: "#49d149",
  3535. textColor2: "#49d149",
  3536. },
  3537. },
  3538. {
  3539. name: "Deceptive Dinos",
  3540. value: {
  3541. highlight: "#af8942",
  3542. toggleOn: "#2fb62f",
  3543. background: "radial-gradient(rgba(220, 184, 86, 0), rgba(220, 184, 86, 0.4)), url(https://ac.blooket.com/play/111cb7e0ee6607ac3d1a13d534c0e0f1.png), #ead49a",
  3544. background2: "radial-gradient(rgba(1,104,162,.6),rgba(24,55,110,.5)),radial-gradient(#2783b4 1.5px,#18376e 0) center / 24px 24px",
  3545. toggleOff: "#A02626",
  3546. highlight2: "rgb(0 0 0 / 25%)",
  3547. textColor2: "#FFFFFF",
  3548. },
  3549. },
  3550. {
  3551. name: "Blook Rush",
  3552. value: {
  3553. highlight: "#888",
  3554. toggleOn: "#47A547",
  3555. background: "repeating-linear-gradient(45deg,white,white 8%,#e6e6e6 0,#e6e6e6 16%)",
  3556. background2: "#36c",
  3557. toggleOff: "#A02626",
  3558. highlight2: "rgb(0 0 0 / 25%)",
  3559. textColor2: "#FFFFFF",
  3560. },
  3561. },
  3562. {
  3563. name: "Factory",
  3564. value: {
  3565. highlight: "#1563bf",
  3566. toggleOn: "rgb(75, 194, 46)",
  3567. background: "#3a3a3a",
  3568. background2: "#2d313d",
  3569. toggleOff: "#9a49aa",
  3570. highlight2: "rgb(0 0 0 / 25%)",
  3571. textColor2: "#a5aabe",
  3572. },
  3573. },
  3574. {
  3575. name: "Cafe",
  3576. value: {
  3577. highlight: "#0bc2cf",
  3578. toggleOn: "#47A547",
  3579. background: "linear-gradient(90deg,rgba(200,0,0,.5) 50%,transparent 0) center / 50px 50px,linear-gradient(rgba(200,0,0,0.5) 50%,transparent 0) white center / 50px 50px",
  3580. background2: "rgb(64, 64, 64)",
  3581. toggleOff: "#A02626",
  3582. highlight2: "rgb(0 0 0 / 25%)",
  3583. textColor2: "#ac7339",
  3584. textColor: "#FFFFFF",
  3585. },
  3586. },
  3587. {
  3588. name: "Tower of Doom",
  3589. value: {
  3590. highlight: "#9a49aa",
  3591. toggleOn: "#4bc22e",
  3592. background: "rgb(41 41 41)",
  3593. background2: "#404040",
  3594. toggleOff: "rgb(151, 15, 5)",
  3595. highlight2: "rgb(0 0 0 / 25%)",
  3596. textColor2: "#9a49aa",
  3597. textColor: "#FFFFFF",
  3598. },
  3599. },
  3600. {
  3601. name: "Monster Brawl",
  3602. value: {
  3603. highlight: "#2966a6",
  3604. toggleOn: "#47A547",
  3605. background: "rgb(45, 51, 67)",
  3606. background2: "#374154",
  3607. toggleOff: "#A02626",
  3608. highlight2: "#264d99",
  3609. textColor2: "#264d99",
  3610. textColor: "#FFFFFF",
  3611. },
  3612. },
  3613. {
  3614. name: "Tower Defense 2",
  3615. value: {
  3616. highlight: "#40b1d8",
  3617. toggleOn: "#47A547",
  3618. background2: "#293c82",
  3619. toggleOff: "#A02626",
  3620. highlight2: "rgb(0 0 0 / 25%)",
  3621. textColor2: "#a33c22",
  3622. textColor: "#FFFFFF",
  3623. },
  3624. },
  3625. ],
  3626. },
  3627. (x) => {
  3628. Settings.setItem("theme", { ...Settings.data.theme, ...x });
  3629. for (const prop in x) gui.style.setProperty(`--${prop}`, x[prop]);
  3630. path.updatePath();
  3631. }
  3632. );
  3633. addSetting("Highlight 1", "Hover color, sub-text color, button color, and input outlines", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--highlight") }, (x) =>
  3634. gui.style.setProperty("--highlight", Settings.setItem("theme.highlight", x || variables["--highlight"]))
  3635. );
  3636. addSetting("Highlight 2", "Credits page's warning message color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--highlight2") }, (x) =>
  3637. gui.style.setProperty("--highlight2", Settings.setItem("theme.highlight2", x || variables["--highlight2"]))
  3638. );
  3639. addSetting("Background", "Main GUI background color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--background") }, (x) =>
  3640. gui.style.setProperty("--background", Settings.setItem("theme.background", x || variables["--background"]))
  3641. );
  3642. addSetting("Background 2", "Secondary GUI background color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--background2") }, (x) =>
  3643. gui.style.setProperty("--background2", Settings.setItem("theme.background2", x || variables["--background2"]))
  3644. );
  3645. addSetting("Text Color", "Main text color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--textColor") }, (x) =>
  3646. gui.style.setProperty("--textColor", Settings.setItem("theme.textColor", x || variables["--textColor"]))
  3647. );
  3648. addSetting("Text Color 2", "Credit page's contributor color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--textColor2") }, (x) =>
  3649. gui.style.setProperty("--textColor2", Settings.setItem("theme.textColor2", x || variables["--textColor2"]))
  3650. );
  3651. addSetting("Toggle (On)", "Enabled toggle button color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--toggleOn") }, (x) =>
  3652. gui.style.setProperty("--toggleOn", Settings.setItem("theme.toggleOn", x || variables["--toggleOn"]))
  3653. );
  3654. addSetting("Toggle (Off)", "Disabled toggle button color", { type: "string", name: "CSS Value", value: () => gui.style.getPropertyValue("--toggleOff") }, (x) =>
  3655. gui.style.setProperty("--toggleOff", Settings.setItem("theme.toggleOff", x || variables["--toggleOff"]))
  3656. );
  3657.  
  3658. const sidebarPaths = document.createElement("div");
  3659. sidebarPaths.className = classes.sidebarPaths;
  3660.  
  3661. function createSidebarPath(name, icon, page) {
  3662. const sidebarPath = document.createElement("div");
  3663. sidebarPath.className = classes.sidebarPath;
  3664.  
  3665. const iconImg = document.createElement("i");
  3666. iconImg.className = icon;
  3667.  
  3668. const pathName = document.createElement("span");
  3669. pathName.innerText = name;
  3670.  
  3671. sidebarPath.append(iconImg, pathName);
  3672.  
  3673. sidebarPath.onclick = () => path.sidebar(name, page);
  3674.  
  3675. sidebarPaths.append(sidebarPath);
  3676.  
  3677. return sidebarPath;
  3678. }
  3679.  
  3680. createSidebarPath("Search", "fas fa-search", searchPage);
  3681. createSidebarPath("Gamemodes", "fas fa-gamepad", gamemodesPage);
  3682. createSidebarPath("Favorites", "fas fa-star", favoritesPage);
  3683. (leaderboardPath = createSidebarPath("Leaderboard", "fas fa-trophy", leaderboardPage)).style.display = "none";
  3684. createSidebarPath("Logs", "fas fa-terminal", logsPage);
  3685. createSidebarPath("Settings", "fas fa-cog", settingsPage);
  3686. createSidebarPath("Credits", "fas fa-code", creditsPage);
  3687.  
  3688. sidebar.append(sidebarPaths);
  3689.  
  3690. const bigTextContainer = document.createElement("div");
  3691. bigTextContainer.className = classes.bigTextContainer;
  3692.  
  3693.  
  3694. const dummyK = document.createElement("span");
  3695. dummyK.innerText = "K";
  3696. dummyK.style.opacity = "0";
  3697.  
  3698. const bigText = document.createElement("span");
  3699. bigText.className = classes.bigText;
  3700. bigText.innerText = "ㅤGUI";
  3701.  
  3702. const logo = document.createElement("span");
  3703. logo.className = classes.logo;
  3704. logo.innerHTML = "AA";
  3705.  
  3706. bigTextContainer.append(logo, dummyK, bigText);
  3707.  
  3708. sidebar.prepend(bigTextContainer);
  3709.  
  3710. const refreshControl = document.createElement("div");
  3711. refreshControl.innerHTML = `<i class="fas fa-sync" style="line-height: 1"></i>`;
  3712. refreshControl.className = classes.refreshControl;
  3713. refreshControl.onclick = () => {
  3714. refreshControl.animate([{ rotate: "0deg" }, { rotate: "360deg" }], { duration: 1000, easing: "ease" });
  3715. path.updatePath();
  3716. };
  3717.  
  3718. gui.append(controls, guiTopBar, sidebar, guiContent, pathText, refreshControl);
  3719. path.updatePath();
  3720. document.body.appendChild(gui);
  3721.  
  3722. Logs.addLog("Opened AA Gui");
  3723. /* Anti-Suspend By CryptoDude3 */
  3724. if (window.fetch.call.toString() == "function call() { [native code] }") {
  3725. const call = window.fetch.call;
  3726. window.fetch.call = function () {
  3727. if (!arguments[1].includes("s.blooket.com/rc")) return call.apply(this, arguments);
  3728. Logs.addLog("Blocked Suspension API!", "red");
  3729. };
  3730. Logs.addLog("Enabled Anti-Suspend");
  3731. }
  3732.  
  3733. if (gui.querySelector("i").clientHeight == 0) {
  3734. const link = document.createElement("link");
  3735. link.rel = "stylesheet";
  3736. gui.prepend(link);
  3737. }
  3738.  
  3739. function randString(length) {
  3740. return Array.from({ length }, () => String.fromCharCode(Math.floor(Math.random() * 25) + 97)).reduce((a) => a + String.fromCharCode(Math.floor(Math.random() * 25) + 97), "");
  3741. }
  3742.  
  3743. function dragElement(element, parent) {
  3744. var pos1 = 0,
  3745. pos2 = 0,
  3746. pos3 = 0,
  3747. pos4 = 0;
  3748. element.onpointerdown = function (e = window.event) {
  3749. element.style.cursor = "grabbing";
  3750. pos3 = e.clientX;
  3751. pos4 = e.clientY;
  3752. document.onpointerup = function () {
  3753. element.style.cursor = "grab";
  3754. document.onpointerup = null;
  3755. document.onpointermove = null;
  3756. };
  3757. document.onpointermove = function (e = window.event) {
  3758. pos1 = pos3 - e.clientX;
  3759. pos2 = pos4 - e.clientY;
  3760. pos3 = e.clientX;
  3761. pos4 = e.clientY;
  3762. parent.style.top = parent.offsetTop - pos2 + "px";
  3763. parent.style.left = parent.offsetLeft - pos1 + "px";
  3764. };
  3765. };
  3766. }
  3767.  
  3768. const keys = ["shift", "control", "alt", "meta"];
  3769. function createKeybindListener(onpress, element = window) {
  3770. return new Promise((resolve) => {
  3771. const pressed = new Set();
  3772. let shift, ctrl, alt, key;
  3773. const keydown = (e) => {
  3774. e.preventDefault();
  3775. pressed.add(e.code);
  3776. shift ||= e.shiftKey;
  3777. ctrl ||= e.ctrlKey;
  3778. alt ||= e.altKey;
  3779. if (!keys.includes(e.key.toLowerCase())) key = e.key.toLowerCase();
  3780. onpress?.({ shift, ctrl, alt, key });
  3781. };
  3782. const keyup = (e) => {
  3783. pressed.delete(e.code);
  3784. if (pressed.size > 0) return;
  3785. element.removeEventListener("keydown", keydown);
  3786. element.removeEventListener("keyup", keyup);
  3787. resolve({ shift, ctrl, alt, key });
  3788. };
  3789. element.addEventListener("keydown", keydown);
  3790. element.addEventListener("keyup", keyup);
  3791. });
  3792. }
  3793. function parseKeybind({ shift, ctrl, alt, key }) {
  3794. return [ctrl && "Ctrl", shift && "Shift", alt && "Alt", key && key.toUpperCase()].filter(Boolean).join(" + ");
  3795. }
  3796.  
  3797. function compareKeybind(keybind, event) {
  3798. return keybind.ctrl == event.ctrlKey && keybind.shift == event.shiftKey && keybind.alt == event.altKey && event.key.toLowerCase() == keybind.key;
  3799. }
  3800.  
  3801. function keydown(e) {
  3802. if (compareKeybind(Settings.data.hideKey ?? defaultHideKey, e)) {
  3803. e.preventDefault();
  3804. return (gui.style.display = gui.style.display === "block" ? "none" : "block");
  3805. }
  3806. if (compareKeybind(Settings.data.closeKey ?? defaultCloseKey, e)) {
  3807. e.preventDefault();
  3808. close();
  3809. }
  3810. }
  3811.  
  3812. function close() {
  3813. gui.remove();
  3814. clearInterval(Logs.interval);
  3815. for (const category in cheats) for (const cheat of cheats[category].cheats) if (cheat.enabled) cheat.run();
  3816. window.removeEventListener("keydown", keydown);
  3817. }
  3818.  
  3819. function getStateNode() {
  3820. return Object.values(
  3821. (function react(r = document.querySelector("body>div")) {
  3822. return Object.values(r)[1]?.children?.[0]?._owner.stateNode ? r : react(r.querySelector(":scope>div"));
  3823. })()
  3824. )[1].children[0]._owner.stateNode;
  3825. }
  3826.  
  3827. window.addEventListener("keydown", keydown);
  3828.  
  3829. });
  3830. let img = new Image;
  3831. img.crossOrigin = "Anonymous";
  3832. img.onload = function() {
  3833. const c = document.createElement("canvas");
  3834. const ctx = c.getContext("2d");
  3835. ctx.drawImage(img, 0, 0, this.width, this.height);
  3836. let { data } = ctx.getImageData(0, 0, this.width, this.height), decode = "", last;
  3837. let i = 0;
  3838. while (i < data.length) {
  3839. let char = String.fromCharCode(data[i % 4 == 3 ? (i++, i++) : i++] + data[i % 4 == 3 ? (i++, i++) : i++] * 256);
  3840. decode += char;
  3841. if (char == "/" && last == "*") break;
  3842. last = char;
  3843. }
  3844. let _, time = timeProcessed, error = "There was an error checking for script updates. Run cheat anyway?";
  3845. try {
  3846. [_, time, error] = decode.match(/LastUpdated: (.+?); ErrorMessage: "((.|\n)+?)"/);
  3847. } catch (e) {}
  3848. if ((latestProcess = parseInt(time)) <= timeProcessed || iframe.contentWindow.confirm(error)) cheat();
  3849. }
  3850. img.onerror = img.onabort = () => {
  3851. img.onerror = img.onabort = null;
  3852. cheat();
  3853. let iframe = document.querySelector("iframe");
  3854. iframe.contentWindow.alert("Adrians Blooket hack loaded click ok to continue!")
  3855. }
  3856. })();