Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/cheatGUI/src/hacks/beta.ts
Views: 723
// Beta Hacks12345// BEGIN IMPORTS6import { Swal, Toast, NumberInput, Input, Confirm } from "../utils/swal"; // Import Swal, Toast, NumberInput, Input, and Confirm from swal7import { category } from "../index"; // Import the Cheat GUI bases.8import Toggler from "../class/Toggler";9import Hack from "../class/Hack";10import { _, getItem, VERY_LARGE_NUMBER, prodigy, saveCharacter, player, current} from "../utils/util"; // Import prodigy typings, and VERY_LARGE_NUMBER11import { ids, itemify, runeify, getPet } from "../utils/hackify"; // Import runeify and some arrays12import { PopupInterval } from "../utils/popupCloser";13// END IMPORTS14151617// BEGIN BETA HACKS181920// Begin Switch Branch21new Hack(category.beta, "Switch Branch", "Loads a different branch of cheatGUI for you.").setClick(async () => {2223const branches_fetch : string = await (await fetch("https://api.github.com/repos/ProdigyPNP/ProdigyMathGameHacking/branches")).text()24let branches : Map<string, string> = new Map();2526JSON.parse(branches_fetch).forEach((e : any) => {27branches.set(e.name, e.name);28});2930const branch = await (await Swal.fire({31title: "Select Branch",32html: `Select which branch of ProdigyPNP you'd like to use.`,33input: "select",34inputOptions: branches,35})).value;3637if (!branch) return;3839return await eval(await (await fetch(`https://raw.githubusercontent.com/ProdigyPNP/ProdigyMathGameHacking/${branch}/cheatGUI/dist/bundle.js`)).text());40});41424344// Begin get all Runes45new Hack(category.beta, "Get all Runes [BETA]").setClick(async () => {46if (!(await Confirm.fire({47title: "Hang on!",48html: "This hack may damage your account with various bugs, for example you may be unable to do Rune Run.<br><br>Proceed?",49icon: "warning"50})).value) {51return;52}5354const amount = parseInt((await NumberInput.fire({55title: "Amount",56text: "How many of each would you like?",57icon: "question",58inputValidator: (res: any) => res ? "" : "Please select which you'd like to get."59})).value);60if (isNaN(amount)) return;61let mod;626364Array.from(_.instance.prodigy.gameContainer._inversifyContainer._bindingDictionary._map).forEach(e => {65try {66// @ts-expect-error67if (_.instance.prodigy.gameContainer.get(e[0]).battleData) {68// @ts-expect-error69mod = e[0];70}71} catch {72// @ts-expect-error73console.log(`Error for ${e[0]}`);74}75});7677_.instance.prodigy.gameContainer.get(mod).battleData._secureCharacterState._data.inventory.orb = runeify(_.gameData.orb, amount);78return Toast.fire("Runes Added!", "Your runes have been added!", "success");79});80// End get all Runes818283848586// Begin Edit Pet87new Hack(category.beta, "Edit Pet [BETA]", "Edit a pet.").setClick(async () => {88if (!(await Confirm.fire({89title: "Hang on!",90html: "This hack may damage your account with various bugs, for example you may be unable to do Rune Run.<br><br>Proceed?",91icon: "warning"92})).value) {93return console.log("Cancelled.");94}9596const pet = await getPet("Choose the pet to edit.");97if (pet === undefined) return;98const selected = player.kennel.data[pet];99const opt = await Swal.fire({100input: "select",101inputOptions: {102level: "Level",103attacks: "Attacks",104name: "Name"105},106title: "Edit Property",107text: "What do you want to edit?"108});109if (opt.value === undefined) return;110if (opt.value === "level") {111const level = await NumberInput.fire(112"Level Number",113"What level do you want to set your pet to?",114"question"115);116if (level.value === undefined) return;117selected.level = +level.value;118return Toast.fire("Success!", "The pet's level has been set.", "success");119} else if (opt.value === "attacks") {120const attackList = _.gameData.spell;121const div = document.createElement("div");122const select = document.createElement("select");123select.classList.add("selectSpell");124for (const spell of attackList) {125const spellElement = document.createElement("option");126spellElement.value = spell.ID.toString();127spellElement.innerText = `${spell.ID}: ${spell.name} (${spell.data.element}) - Damage: ${spell.data.damage}`;128select.options.add(spellElement);129}130div.append(select);131div.append(select.cloneNode(true));132const attacks = await Swal.fire({133title: "Attack List",134focusConfirm: false,135showCancelButton: true,136html: div,137preConfirm: () => {138return Array.prototype.slice139.call(document.querySelectorAll(".selectSpell"))140.map((x: HTMLSelectElement) => x.options[x.selectedIndex].value);141}142});143if (attacks.value === undefined) return;144(selected.foreignSpells as number[]).splice(0, 2, ...attacks.value.map((x: string) => +x));145return Toast.fire("Attacks updated!", "The attack list of the pet you selected has been edited.", "success");146} else if (opt.value === "name") {147const name = await Input.fire("Input Name", "What do you want to name the pet?", "question");148if (name.value === undefined) return;149selected.nickname = name.value;150return Toast.fire("Successfully renamed!", "The name of the pet has been changed.", "success");151}152});153// End Edit Pet154155156157158159// Begin Morph Player160new Hack(category.beta, "Morph Player [BETA]", "Morph into a pet, furnishing, or follow.").setClick(async () => {161162if (!(await Confirm.fire("This hack is in BETA", "Expect bugs, and it might not work properly.")).value) {163return console.log("Cancelled");;164}165166const morphType = await Swal.fire({167title: "Which morph type?",168input: "select",169inputOptions: {170pet: "Pet",171dorm: "Furniture",172follow: "Follow"173},174inputPlaceholder: "Morph Type",175inputValidator: res => res ? "" : "Please select a morph type.",176showCancelButton: true177});178179if (!morphType?.value) return;180181// swal inputOptions accepts an object, the property being the value it returns, the value being what it displays182// kinda weird to explain, just look at how morphType does it183// we want it to display a pretty string, and return the petID184const morphOptions = {};185// @ts-expect-error186_.gameData[morphType.value].forEach((morph) => morphOptions[morph.ID] = `${morph.name} (${morph.ID})`);187188const morphID = await Swal.fire({189title: "Which morph?",190input: "select",191inputOptions: morphOptions,192inputPlaceholder: "Morph ID",193inputValidator: res => res ? "" : "Please select a morph ID.",194showCancelButton: true195});196197if (!morphID.value) return;198player.getPlayerData().playerTransformation = {199transformType: morphType.value,200transformID: morphID.value,201maxTime: 60 * 60 * 1000,202timeRemaining: 60 * 60 * 1000203};204player.appearanceChanged = true;205206return Toast.fire("Morphed!", "You've been morphed.", "success");207});208// End Morph Player209210211212new Toggler(category.beta, "(client side) Toggle Invisibility [BETA]", "Lets you appear invisible on your own screen.").setEnabled(async () => {213// current.user.alpha = 0;214current.user.visible = false;215}).setDisabled(async() => {216current.user.visible = true;217});218219220// Begin Toggle Close Popups221new Toggler(category.beta, "Toggle Close Popups [BETA]", "Automatically closes popups in Prodigy.").setEnabled(async () => {222PopupInterval(true);223return Toast.fire("Enabled", "Toggle Close Popups is now enabled.", "success");224}).setDisabled(async() => {225PopupInterval(false);226return Toast.fire("Enabled", "Toggle Close Popups is now disabled.", "success");227});228// End Toggle Close Popups229230231232233// Begin Hypermax Account234new Hack(category.beta, "Hypermax Account [BETA]").setClick(async () => {235// Hypermax Account was made by gemsvidø.236237// ============================================238// PRE MAXING PROCESS239240241242if (!(await Confirm.fire({243title: "Hang on!",244html: "This hack will damage your account with various bugs, for example you may be unable to do Rune Run/Arena, amd you will recieve 418s and inavtivity kicks.<br><br>Proceed?",245icon: "warning"246})).value) {247return;248}249250251252253// ============================================254// PLAYER HACKS255256// Set the players gold to 09900000257player.data.gold = 9900000;258console.log("Set player gold to 9900000.")259260261// Set the players level to 100262const level = 100;263// @ts-expect-error264const h = level.value - 2;265const xpConstant = 1.042;266player.data.stars = Math.round((1 - Math.pow(xpConstant, h)) / (1 - xpConstant) * 20 + 10);267player.data.level = 100;268player.getLevel = () => {269return player.data.level;270};271console.log("Set player level to 100");272273274// Set the players bounty points to 100 (max)275player.data.bountyScore = 100;276console.log("Set player's bounty points to 100.");277278279// Set the players conjure cubes to 100 (max)280for (let i = 0; i < Math.min(99, 100); i++) {281prodigy.giftBoxController.receiveGiftBox(null, getItem("giftBox", 1));282}283console.log("Obtained 100 conjure cubes.");284285286// Set the player's wins to VERY_LARGE_NUMBER287player.data.win = VERY_LARGE_NUMBER;288console.log("Set player's wins to VERY_LARGE_NUMBER");289290291// Set the player's losses to -9223372036854775808 (Java long limit, ik its irrelevant)292player.data.loss = -9223372036854775808;293console.log("Set player's losses to -9223372036854775808.");294295296297// Set the players damage multiplier to VERY_LARGE_NUMBER298player.modifiers.damage = VERY_LARGE_NUMBER;299console.log("Enabled damage multiplier.");300301302// Set the players PVP health to VERY_LARGE_NUMBER303player.pvpHP = VERY_LARGE_NUMBER;304player.getMaxHearts = () => VERY_LARGE_NUMBER;305console.log("PvP health obtained.")306307308309310// Get all achievements311for (var i = 0; i < 100; i++) {312player.achievements.data.progress[i] = 10;313}314console.log("Obtained all achievements.");315316// Set the players dark tower floor to 100317player.data.tower = 100;318console.log("Set tower floor to 100.");319320// PLAYER HACKS321// ============================================322// ============================================323// BATTLE HACKS324325326// Max out the players HP327player.getMaxHearts = () => VERY_LARGE_NUMBER;328player.pvpHP = VERY_LARGE_NUMBER;329player.data.hp = VERY_LARGE_NUMBER;330console.log("Maxed out PvE health.");331332333// BATTLE HACKS334// ============================================335// ============================================336// INVENTORY HACKS337338339340// Get 990000 of all items341const num = 990000;342343ids.forEach(id => {344// @ts-expect-error345player.backpack.data[id] = itemify(_.gameData[id].filter(l => id === "follow" ? ![125, 126, 127, 128, 129, 134, 135, 136, 137].includes(l.ID) : l), num.value);346});347// @ts-expect-error348_.gameData.dorm.forEach(x =>349// @ts-expect-error350player.house.data.items[x.ID] = { A: [], N: num.value }351);352353// Remove bounty notes354// @ts-expect-error355const bountyIndex = () => player.backpack.data.item.findIndex(v => v.ID === 84 || v.ID === 85 || v.ID === 86);356while (bountyIndex() > -1) player.backpack.data.item.splice(bountyIndex(), 1);357Toast.fire("Success!", "All items added!", "success");358359console.log("All items added!");360361362363// Get all Mounts364player.backpack.data.mount = itemify(_.gameData.mount, 1);365console.log("Added all mounts.");366367368// Get 990000 of all furniture369const amt = 990000;370// @ts-expect-error371_.gameData.dorm.forEach(x =>372// @ts-expect-error373player.house.data.items[x.ID] = { A: [], N: amt.value }374);375console.log("Added 990000 of all furniture.");376377378// INVENTORY HACKS379// ============================================380// ============================================381// PET HACKS382383384// Get All Pets385386// add pets387// @ts-expect-error388_.gameData.pet.forEach(x => {389player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);390});391392// add encounter info393player.kennel._encounterInfo._data.pets = [];394_.gameData.pet.map((pet: {395ID: number396}) => {397player.kennel._encounterInfo._data.pets.push({398firstSeenDate: Date.now(),399ID: pet.ID,400timesBattled: 1,401timesRescued: 1402});403});404// Fix broken pets405// @ts-expect-error406player.kennel.petTeam.forEach(v => {407if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();408});409console.log("Added all pets.");410411412413414// Get all Mythical Epics415// @ts-expect-error416const mythepics = _.gameData.pet.filter(x => [158, 166, 168].includes(x.ID));417// @ts-expect-error418mythepics.forEach(x => {419player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);420});421// Fix broken pets422// @ts-expect-error423player.kennel.petTeam.forEach(v => {424if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();425});426console.log("Added Mythical Epics.");427428429430// Get all Legacy Epics431// @ts-expect-error432const legepics = _.gameData.pet.filter(x => [125, 126, 127, 128, 129, 130, 131, 132, 133].includes(x.ID));433// @ts-expect-error434legepics.forEach(x => {435player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);436});437// Fix broken pets438// @ts-expect-error439player.kennel.petTeam.forEach(v => {440if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();441});442console.log("Added Legacy Epics.");443444445// PET HACKS446// ============================================447// ============================================448// UTILITY HACKS449450451// Disable Inactivity Kick452_.constants.constants["GameConstants.Inactivity.LOG_OUT_TIMER_SECONDS"] = 0;453console.log("Inactivity Kick Disabled.");454455// 20x walkspeed456player._playerContainer.walkSpeed = 20;457console.log("Player walkspeed set to 20.");458459460// UTILITY HACKS461// ============================================462// ============================================463// RUNES464465466const amount = 100;467let mod;468Array.from(_.instance.prodigy.gameContainer._inversifyContainer._bindingDictionary._map).forEach(e => {469try {470// @ts-expect-error471if (_.instance.prodigy.gameContainer.get(e[0]).battleData) {472// @ts-expect-error473mod = e[0];474}475} catch {476// @ts-expect-error477console.log(`Error for ${e[0]}`);478}479});480481482_.instance.prodigy.gameContainer.get(mod).battleData._secureCharacterState._data.inventory.orb = runeify(_.gameData.orb, amount);483484485486487// RUNES488// ============================================489// ============================================490// EQUIP CELESTIAL GEAR491492493494player.equipment.setHat(200);495player.equipment.setBoots(93);496player.equipment.setOutfit(161);497player.equipment.setWeapon(196);498499500501502// EQUIP CELESTIAL GEAR503// ============================================504// ============================================505// POST MAXING PROCESS506507508// Save the player data to make sure that the max worked509saveCharacter();510console.log("Character Saved.");511512// Refresh the players appearance513player.appearanceChanged = true;514console.log("Appearance Refreshed.");515516517// Close all popups518_.instance.prodigy.open.menuCloseAll();519console.log("Popups closed.");520521// Save again after closing popups, for good measure.522saveCharacter();523console.log("Character Saved.");524525526// POST MAXING PROCESS527// ============================================528console.log("Max Account Successful.");529530return Toast.fire("Maxed!", `Check your backpack!`, "success");531});532// End Hypermax Account533534535536// END BETA HACKS537538539