Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hack] Edit Kennel #148

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cheatGUI/dist/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cheatGUI/dist/bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*! (c) 2023 ProdigyPNP */
5 changes: 3 additions & 2 deletions cheatGUI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "Prodigy Hack GUI",
"main": "dist/bundle.js",
"scripts": {
"build": "webpack --config webpack.config.js && rm dist/bundle.js.LICENSE.txt && touch dist/bundle.js.LICENSE.txt && echo \"/*! (c) 2023 ProdigyPNP */\" >> dist/bundle.js.LICENSE.txt",
"dev": "node hot-reload.mjs",
"setup": "pnpm install",
"build": "pnpm webpack --config webpack.config.js",
"server": "node hot-reload.mjs"
"postinstall": "cp -r ./node_modules/sweetalert2-neutral ./node_modules/sweetalert2"
},
"repository": {
"type": "git",
Expand Down
5 changes: 0 additions & 5 deletions cheatGUI/src/hacks/inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ new Hack(category.inventory, "Selector (Basic)").setClick(async () => {
input: "select",
inputOptions: names,
inputPlaceholder: "Select...",
// @ts-expect-error
inputValidator: res => res ? "" : "Please select which you'd like to obtain.",
showCancelButton: true
}).then(async val => {
Expand Down Expand Up @@ -106,7 +105,6 @@ new Hack(category.inventory, "Selector (Advanced)", "Choose a specific object an
input: "select",
inputOptions: names,
inputPlaceholder: "Select...",
// @ts-expect-error
inputValidator: res => res ? "" : "Please select which you'd like to obtain.",
showCancelButton: true
}).then(async val => {
Expand All @@ -120,7 +118,6 @@ new Hack(category.inventory, "Selector (Advanced)", "Choose a specific object an
input: "select",
inputOptions: objs,
inputPlaceholder: "Select...",
// @ts-expect-error
inputValidator: res => res ? "" : "Please select which you'd like to get.",
showCancelButton: true
}).then(async spec => {
Expand Down Expand Up @@ -181,13 +178,11 @@ new Hack(category.inventory, "Obtain All Mounts", "This gives you all of the mou

// Begin Remove Item
new Hack(category.inventory, "Remove item").setClick(async () => {
// @ts-expect-error
const category = await Swal.fire({
title: "What category would you like to remove an item from?",
input: "select",
inputOptions: names,
inputPlaceholder: "Select...",
// @ts-expect-error
inputValidator: res => res ? "" : "Please select which you'd like to obtain.",
showCancelButton: true
});
Expand Down
45 changes: 44 additions & 1 deletion cheatGUI/src/hacks/pets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { category } from "../index"; // Import the Cheat GUI bases.
import Hack from "../class/Hack";
import { _, VERY_LARGE_NUMBER, player } from "../utils/util"; // Import Prodigy typings and VERY_LARGE_NUMBER
import { getPet } from "../utils/hackify"; // Import getPet
import { GetAction, SelectSlot } from "../utils/kennel";
// END IMPORTS


Expand Down Expand Up @@ -138,7 +139,6 @@ new Hack(category.pets, "Clear Pets").setClick(async () => {

// Begin Add Pet
new Hack(category.pets, "Add Pet", "Adds a pet from a list.").setClick(async () => {
// @ts-expect-error
const pet = await Swal.fire({
input: "select",
// @ts-expect-error
Expand Down Expand Up @@ -201,6 +201,49 @@ new Hack(category.pets, "Delete Pet", "Delete a pet.").setClick(async () => {
// End Delete Pet


// Begin Edit Kennel
new Hack(category.pets, "Edit Kennel", "Allows you to directly edit your pets.").setClick(async () => {


const action = await GetAction();
if (action === null) return;


const slot = await SelectSlot();
if (slot === null) return;


// @ts-expect-error
console.log(s(parseInt(KennelSlot.value)));

});
// End Edit Kennel


let TEMP_BACKUP : any | null = null;

// Begin Backup Kennel
new Hack(category.pets, "Backup Kennel [No save on reload]", "Makes a backup of your kennel to a variable that doesn't save on reload.").setClick(async () => {
TEMP_BACKUP = _.player.kennel._petTeam;
return Toast.fire("Backed up!", "Your kennel is now backed up to the local storage.", "success");
});
// End Backup Kennel


// Begin Restore Kennel
new Hack(category.pets, "Restore Kennel", "Restores a backup of your kennel from a variable... if you have one.").setClick(async () => {
if (TEMP_BACKUP === null) {
return Swal.fire({
title: "No backup found",
html: "There is no backup of your kennel currently. Make sure to back up your kennel before trying to load it.",
icon: "error"
});
} else {
_.player.kennel._petTeam = TEMP_BACKUP;
return Toast.fire("Restored!", "Your kennel backup should be restored", "success");
}
});
// End Restore Kennel


// END PET HACKS
1 change: 1 addition & 0 deletions cheatGUI/src/hacks/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ new Hack(category.player, "Change Name", "Change the name of your wizard.").setC
}
});
if (name.value === undefined) return;
// @ts-expect-error
if (name.value[3] === "null") name.value[3] = null;
[
player.name.data.firstName,
Expand Down
3 changes: 2 additions & 1 deletion cheatGUI/src/hacks/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ new Hack(category.utility, "Close all popups", "Closes all popups in Prodigy.").
// End Close all Popups


// userID grabber
new Hack(category.utility, "Grab UserID of all players on screen", "Shows you the UserID and name of every player currently shown on the screen.").setClick(async () => {
const users : object = current.playerList;
if (Object.keys(users).length === 0) {
Expand All @@ -41,7 +42,7 @@ new Hack(category.utility, "Grab UserID of all players on screen", "Shows you th
return Swal.fire({title: "All players on the screen:", html: contents, icon: "info" });
}
});

// End userID grabber



Expand Down
2 changes: 2 additions & 0 deletions cheatGUI/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ menuleft.classList.add("menu-left");
menu.append(menuleft);

let firstCategory = true;

function addArea (title: string) {

const area = document.createElement("div");

if (firstCategory == false) {
Expand Down
14 changes: 14 additions & 0 deletions cheatGUI/src/utils/divide.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** divide a string into parts */
export default function divide (target : string, amount : number) : Array<string> {

let output : Array<string> = new Array;
let parts : number = Math.floor(target.length / amount);
let start : number = 0;

while (start < target.length) {
output.push(target.substring(start, start+parts));
start += parts;
}

return output;
}
7 changes: 4 additions & 3 deletions cheatGUI/src/utils/hackify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ export const runeify = (item, amount) =>
ID: x.ID,
quantity: amount
// @ts-expect-error
})).filter(v => v !== undefined);
}).filter(v => v !== undefined)
);


// Get member module
export function getMemberModule () {
export function getMemberModule () : string {
return _.player.hasMembership.toString().split("\"")[1];
}

Expand Down Expand Up @@ -106,4 +107,4 @@ export const getPet = async (text: string): Promise<number | undefined> => {
text: text
});
return pet.value;
};
};
44 changes: 44 additions & 0 deletions cheatGUI/src/utils/kennel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Swal } from "./swal";

export async function GetAction () : Promise<"Copy" | "Remove" | null> {

const options = new Map<string, string>();
options.set("Copy", `Copy a slot to another slot`);
options.set("Remove", `Completley empty one slot`);


const KennelAction = await Swal.fire({
input: "select",
inputOptions: options,
title: "Select Action",
text: "Select an action to perform on the Kennel",
});

if (!KennelAction.value) return null;


return KennelAction.value;
}

export async function SelectSlot () : Promise<0 | 1 | 2 | null> {

const options = new Map<string, string>();
// sorry if it's unreadable, unminify this yourself. what it does is it get's the pet's name (ex. "Magmayhem"), says "Player" if it's the player, or "null", if it's empty.
const s = ((num : 0 | 1 | 2) : any => { return (_.player.kennel._petTeam[num]) ? ((_.player.kennel._petTeam[num].source) ? _.player.kennel._petTeam[num].source.name : ((_.player.kennel._petTeam[num]._userDataPlatform) ? "Player" : "null")) : "null"; });
options.set("0", `[0] Center - ${s(0)}`);
options.set("1", `[1] Top - ${s(1)}`);
options.set("2", `[2] Bottom - ${s(2)}`); // This doesn't do null checks, because we might want to ASSIGN to a null slot.


const KennelSlot = await Swal.fire({
input: "select",
inputOptions: options,
title: "Select Slot",
text: "Select a slot to edit",
});

if (!KennelSlot.value) return null;

// @ts-expect-error TypeScript doesn't realize that we can only parseInt this into 0, 1, or 2.
return parseInt(KennelSlot.value);
}
6 changes: 4 additions & 2 deletions cheatGUI/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */

/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"paths": {
"sweetalert2": ["./node_modules/sweetalert2-neutral"]
}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [""], /* Type declaration files to be included in compilation. */
Expand Down