CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
ProdigyPNP

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: ProdigyPNP/ProdigyMathGameHacking
Path: blob/master/cheatGUI/src/hacks/patched.ts
Views: 723
1
// Patched Hacks
2
3
4
// BEGIN IMPORTS
5
import { Swal, Confirm, Toast } from "../utils/swal";
6
import { category} from "../index"; // Import the Cheat GUI bases.
7
import Hack from "../class/Hack";
8
import { _, prodigy, player } from "../utils/util"; // Import Prodigy typings and VERY_LARGE_NUMBER
9
// END IMPORTS
10
11
12
13
14
// BEGIN PATCHED HACKS
15
16
17
18
// Begin Arena Point Increaser
19
let interval: unknown | null = null;
20
21
new Hack(category.patched, "Arena Point Increaser [Patched]").setClick(async () => {
22
23
24
if (interval) {
25
return Swal.fire("Already Enabled", "Arena Point Increaser is already enabled.", "error");
26
} else if (!(await Confirm.fire("This hack is patched.", "Running it will probably do nothing.")).value) {
27
return console.log("Cancelled");
28
} else {
29
30
interval = setInterval(async () => {
31
const data = await (
32
await fetch(
33
`https://api.prodigygame.com/leaderboard-api/season/${prodigy.pvpNetworkHandler.seasonID}/user/${player.userID}/pvp?userID=${player.userID}`, {
34
headers: {
35
// @ts-expect-error
36
authorization: `Bearer ${prodigy.network.jwtAuthProvider.getToken()}`,
37
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
38
},
39
body: `seasonID=${prodigy.pvpNetworkHandler.seasonID}&action=win`,
40
method: "POST",
41
mode: "cors",
42
}
43
)
44
).text();
45
if (data !== "") {
46
const jsoned: {
47
points: number;
48
weeklyPoints: number;
49
modifiedDate: string;
50
seasonID: number;
51
numMatches: number;
52
} = JSON.parse(data);
53
console.log(`[API] ${jsoned.points} Points (+100)`);
54
} else console.log(`[API] Failed to add points.`);
55
}, 60500);
56
return Swal.fire("Enabled", "Arena Point Increaser has been enabled.", "success");
57
}
58
});
59
// End Arena Point Increaser
60
61
62
63
64
// Begin Disable Timeout Dialog
65
new Hack(category.patched, "Disable Timeout Dialog [Patched]").setClick(async () => {
66
if (!(await Confirm.fire("This hack is patched.", "Running it will probably do nothing.")).value) {
67
return console.log("Cancelled");
68
} else {
69
// @ts-expect-error
70
prodigy.debugMisc.disableTimeoutDialogue();
71
}
72
return Toast.fire("Enabled", "Timeout Dialog has been disabled.", "success");
73
});
74
// End Disable Timeout Dialog
75
76
77
78
79
80
81
/* Old Inventory hacks, replaced by Selector
82
83
const inventoryHack = (name: string, id: BackpackItemType, amount: number = 1) => {
84
new Hack(category.inventory, `Obtain All ${name}`).setClick(async () => {
85
if (!(await Confirm.fire(`Are you sure you want to get all ${name}?`)).value) return;
86
player.backpack.data[id] = itemify(_.gameData[id], amount);
87
Toast.fire(
88
`${name} Added!`,
89
`All ${name.toLowerCase()} have been added to your inventory!`,
90
"success"
91
);
92
});
93
};
94
inventoryHack("Boots", "boots");
95
inventoryHack("Buddies", "follow");
96
inventoryHack("Fossils", "fossil", VERY_LARGE_NUMBER);
97
inventoryHack("Hats", "hat");
98
inventoryHack("Items", "item", VERY_LARGE_NUMBER);
99
inventoryHack("Key Items", "key", VERY_LARGE_NUMBER);
100
inventoryHack("Math Town Frames", "mathTownFrame", VERY_LARGE_NUMBER);
101
inventoryHack("Math Town Interiors", "mathTownInterior", VERY_LARGE_NUMBER);
102
inventoryHack("Mounts", "mount");
103
inventoryHack("Outfits", "outfit");
104
inventoryHack("Relics", "relic");
105
inventoryHack("Spell Relics", "spellRelic");
106
inventoryHack("Weapons", "weapon");
107
inventoryHack("Currency", "currency", VERY_LARGE_NUMBER);
108
109
End Old Inventory Hacks */
110
111
// END PATCHED HACKS
112
113