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/beta.ts
Views: 723
1
// Beta Hacks
2
3
4
5
6
// BEGIN IMPORTS
7
import { Swal, Toast, NumberInput, Input, Confirm } from "../utils/swal"; // Import Swal, Toast, NumberInput, Input, and Confirm from swal
8
import { category } from "../index"; // Import the Cheat GUI bases.
9
import Toggler from "../class/Toggler";
10
import Hack from "../class/Hack";
11
import { _, getItem, VERY_LARGE_NUMBER, prodigy, saveCharacter, player, current} from "../utils/util"; // Import prodigy typings, and VERY_LARGE_NUMBER
12
import { ids, itemify, runeify, getPet } from "../utils/hackify"; // Import runeify and some arrays
13
import { PopupInterval } from "../utils/popupCloser";
14
// END IMPORTS
15
16
17
18
// BEGIN BETA HACKS
19
20
21
// Begin Switch Branch
22
new Hack(category.beta, "Switch Branch", "Loads a different branch of cheatGUI for you.").setClick(async () => {
23
24
const branches_fetch : string = await (await fetch("https://api.github.com/repos/ProdigyPNP/ProdigyMathGameHacking/branches")).text()
25
let branches : Map<string, string> = new Map();
26
27
JSON.parse(branches_fetch).forEach((e : any) => {
28
branches.set(e.name, e.name);
29
});
30
31
const branch = await (await Swal.fire({
32
title: "Select Branch",
33
html: `Select which branch of ProdigyPNP you'd like to use.`,
34
input: "select",
35
inputOptions: branches,
36
})).value;
37
38
if (!branch) return;
39
40
return await eval(await (await fetch(`https://raw.githubusercontent.com/ProdigyPNP/ProdigyMathGameHacking/${branch}/cheatGUI/dist/bundle.js`)).text());
41
});
42
43
44
45
// Begin get all Runes
46
new Hack(category.beta, "Get all Runes [BETA]").setClick(async () => {
47
if (!(await Confirm.fire({
48
title: "Hang on!",
49
html: "This hack may damage your account with various bugs, for example you may be unable to do Rune Run.<br><br>Proceed?",
50
icon: "warning"
51
})).value) {
52
return;
53
}
54
55
const amount = parseInt((await NumberInput.fire({
56
title: "Amount",
57
text: "How many of each would you like?",
58
icon: "question",
59
inputValidator: (res: any) => res ? "" : "Please select which you'd like to get."
60
})).value);
61
if (isNaN(amount)) return;
62
let mod;
63
64
65
Array.from(_.instance.prodigy.gameContainer._inversifyContainer._bindingDictionary._map).forEach(e => {
66
try {
67
// @ts-expect-error
68
if (_.instance.prodigy.gameContainer.get(e[0]).battleData) {
69
// @ts-expect-error
70
mod = e[0];
71
}
72
} catch {
73
// @ts-expect-error
74
console.log(`Error for ${e[0]}`);
75
}
76
});
77
78
_.instance.prodigy.gameContainer.get(mod).battleData._secureCharacterState._data.inventory.orb = runeify(_.gameData.orb, amount);
79
return Toast.fire("Runes Added!", "Your runes have been added!", "success");
80
});
81
// End get all Runes
82
83
84
85
86
87
// Begin Edit Pet
88
new Hack(category.beta, "Edit Pet [BETA]", "Edit a pet.").setClick(async () => {
89
if (!(await Confirm.fire({
90
title: "Hang on!",
91
html: "This hack may damage your account with various bugs, for example you may be unable to do Rune Run.<br><br>Proceed?",
92
icon: "warning"
93
})).value) {
94
return console.log("Cancelled.");
95
}
96
97
const pet = await getPet("Choose the pet to edit.");
98
if (pet === undefined) return;
99
const selected = player.kennel.data[pet];
100
const opt = await Swal.fire({
101
input: "select",
102
inputOptions: {
103
level: "Level",
104
attacks: "Attacks",
105
name: "Name"
106
},
107
title: "Edit Property",
108
text: "What do you want to edit?"
109
});
110
if (opt.value === undefined) return;
111
if (opt.value === "level") {
112
const level = await NumberInput.fire(
113
"Level Number",
114
"What level do you want to set your pet to?",
115
"question"
116
);
117
if (level.value === undefined) return;
118
selected.level = +level.value;
119
return Toast.fire("Success!", "The pet's level has been set.", "success");
120
} else if (opt.value === "attacks") {
121
const attackList = _.gameData.spell;
122
const div = document.createElement("div");
123
const select = document.createElement("select");
124
select.classList.add("selectSpell");
125
for (const spell of attackList) {
126
const spellElement = document.createElement("option");
127
spellElement.value = spell.ID.toString();
128
spellElement.innerText = `${spell.ID}: ${spell.name} (${spell.data.element}) - Damage: ${spell.data.damage}`;
129
select.options.add(spellElement);
130
}
131
div.append(select);
132
div.append(select.cloneNode(true));
133
const attacks = await Swal.fire({
134
title: "Attack List",
135
focusConfirm: false,
136
showCancelButton: true,
137
html: div,
138
preConfirm: () => {
139
return Array.prototype.slice
140
.call(document.querySelectorAll(".selectSpell"))
141
.map((x: HTMLSelectElement) => x.options[x.selectedIndex].value);
142
}
143
});
144
if (attacks.value === undefined) return;
145
(selected.foreignSpells as number[]).splice(0, 2, ...attacks.value.map((x: string) => +x));
146
return Toast.fire("Attacks updated!", "The attack list of the pet you selected has been edited.", "success");
147
} else if (opt.value === "name") {
148
const name = await Input.fire("Input Name", "What do you want to name the pet?", "question");
149
if (name.value === undefined) return;
150
selected.nickname = name.value;
151
return Toast.fire("Successfully renamed!", "The name of the pet has been changed.", "success");
152
}
153
});
154
// End Edit Pet
155
156
157
158
159
160
// Begin Morph Player
161
new Hack(category.beta, "Morph Player [BETA]", "Morph into a pet, furnishing, or follow.").setClick(async () => {
162
163
if (!(await Confirm.fire("This hack is in BETA", "Expect bugs, and it might not work properly.")).value) {
164
return console.log("Cancelled");;
165
}
166
167
const morphType = await Swal.fire({
168
title: "Which morph type?",
169
input: "select",
170
inputOptions: {
171
pet: "Pet",
172
dorm: "Furniture",
173
follow: "Follow"
174
},
175
inputPlaceholder: "Morph Type",
176
inputValidator: res => res ? "" : "Please select a morph type.",
177
showCancelButton: true
178
});
179
180
if (!morphType?.value) return;
181
182
// swal inputOptions accepts an object, the property being the value it returns, the value being what it displays
183
// kinda weird to explain, just look at how morphType does it
184
// we want it to display a pretty string, and return the petID
185
const morphOptions = {};
186
// @ts-expect-error
187
_.gameData[morphType.value].forEach((morph) => morphOptions[morph.ID] = `${morph.name} (${morph.ID})`);
188
189
const morphID = await Swal.fire({
190
title: "Which morph?",
191
input: "select",
192
inputOptions: morphOptions,
193
inputPlaceholder: "Morph ID",
194
inputValidator: res => res ? "" : "Please select a morph ID.",
195
showCancelButton: true
196
});
197
198
if (!morphID.value) return;
199
player.getPlayerData().playerTransformation = {
200
transformType: morphType.value,
201
transformID: morphID.value,
202
maxTime: 60 * 60 * 1000,
203
timeRemaining: 60 * 60 * 1000
204
};
205
player.appearanceChanged = true;
206
207
return Toast.fire("Morphed!", "You've been morphed.", "success");
208
});
209
// End Morph Player
210
211
212
213
new Toggler(category.beta, "(client side) Toggle Invisibility [BETA]", "Lets you appear invisible on your own screen.").setEnabled(async () => {
214
// current.user.alpha = 0;
215
current.user.visible = false;
216
}).setDisabled(async() => {
217
current.user.visible = true;
218
});
219
220
221
// Begin Toggle Close Popups
222
new Toggler(category.beta, "Toggle Close Popups [BETA]", "Automatically closes popups in Prodigy.").setEnabled(async () => {
223
PopupInterval(true);
224
return Toast.fire("Enabled", "Toggle Close Popups is now enabled.", "success");
225
}).setDisabled(async() => {
226
PopupInterval(false);
227
return Toast.fire("Enabled", "Toggle Close Popups is now disabled.", "success");
228
});
229
// End Toggle Close Popups
230
231
232
233
234
// Begin Hypermax Account
235
new Hack(category.beta, "Hypermax Account [BETA]").setClick(async () => {
236
// Hypermax Account was made by gemsvidø.
237
238
// ============================================
239
// PRE MAXING PROCESS
240
241
242
243
if (!(await Confirm.fire({
244
title: "Hang on!",
245
html: "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?",
246
icon: "warning"
247
})).value) {
248
return;
249
}
250
251
252
253
254
// ============================================
255
// PLAYER HACKS
256
257
// Set the players gold to 09900000
258
player.data.gold = 9900000;
259
console.log("Set player gold to 9900000.")
260
261
262
// Set the players level to 100
263
const level = 100;
264
// @ts-expect-error
265
const h = level.value - 2;
266
const xpConstant = 1.042;
267
player.data.stars = Math.round((1 - Math.pow(xpConstant, h)) / (1 - xpConstant) * 20 + 10);
268
player.data.level = 100;
269
player.getLevel = () => {
270
return player.data.level;
271
};
272
console.log("Set player level to 100");
273
274
275
// Set the players bounty points to 100 (max)
276
player.data.bountyScore = 100;
277
console.log("Set player's bounty points to 100.");
278
279
280
// Set the players conjure cubes to 100 (max)
281
for (let i = 0; i < Math.min(99, 100); i++) {
282
prodigy.giftBoxController.receiveGiftBox(null, getItem("giftBox", 1));
283
}
284
console.log("Obtained 100 conjure cubes.");
285
286
287
// Set the player's wins to VERY_LARGE_NUMBER
288
player.data.win = VERY_LARGE_NUMBER;
289
console.log("Set player's wins to VERY_LARGE_NUMBER");
290
291
292
// Set the player's losses to -9223372036854775808 (Java long limit, ik its irrelevant)
293
player.data.loss = -9223372036854775808;
294
console.log("Set player's losses to -9223372036854775808.");
295
296
297
298
// Set the players damage multiplier to VERY_LARGE_NUMBER
299
player.modifiers.damage = VERY_LARGE_NUMBER;
300
console.log("Enabled damage multiplier.");
301
302
303
// Set the players PVP health to VERY_LARGE_NUMBER
304
player.pvpHP = VERY_LARGE_NUMBER;
305
player.getMaxHearts = () => VERY_LARGE_NUMBER;
306
console.log("PvP health obtained.")
307
308
309
310
311
// Get all achievements
312
for (var i = 0; i < 100; i++) {
313
player.achievements.data.progress[i] = 10;
314
}
315
console.log("Obtained all achievements.");
316
317
// Set the players dark tower floor to 100
318
player.data.tower = 100;
319
console.log("Set tower floor to 100.");
320
321
// PLAYER HACKS
322
// ============================================
323
// ============================================
324
// BATTLE HACKS
325
326
327
// Max out the players HP
328
player.getMaxHearts = () => VERY_LARGE_NUMBER;
329
player.pvpHP = VERY_LARGE_NUMBER;
330
player.data.hp = VERY_LARGE_NUMBER;
331
console.log("Maxed out PvE health.");
332
333
334
// BATTLE HACKS
335
// ============================================
336
// ============================================
337
// INVENTORY HACKS
338
339
340
341
// Get 990000 of all items
342
const num = 990000;
343
344
ids.forEach(id => {
345
// @ts-expect-error
346
player.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);
347
});
348
// @ts-expect-error
349
_.gameData.dorm.forEach(x =>
350
// @ts-expect-error
351
player.house.data.items[x.ID] = { A: [], N: num.value }
352
);
353
354
// Remove bounty notes
355
// @ts-expect-error
356
const bountyIndex = () => player.backpack.data.item.findIndex(v => v.ID === 84 || v.ID === 85 || v.ID === 86);
357
while (bountyIndex() > -1) player.backpack.data.item.splice(bountyIndex(), 1);
358
Toast.fire("Success!", "All items added!", "success");
359
360
console.log("All items added!");
361
362
363
364
// Get all Mounts
365
player.backpack.data.mount = itemify(_.gameData.mount, 1);
366
console.log("Added all mounts.");
367
368
369
// Get 990000 of all furniture
370
const amt = 990000;
371
// @ts-expect-error
372
_.gameData.dorm.forEach(x =>
373
// @ts-expect-error
374
player.house.data.items[x.ID] = { A: [], N: amt.value }
375
);
376
console.log("Added 990000 of all furniture.");
377
378
379
// INVENTORY HACKS
380
// ============================================
381
// ============================================
382
// PET HACKS
383
384
385
// Get All Pets
386
387
// add pets
388
// @ts-expect-error
389
_.gameData.pet.forEach(x => {
390
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
391
});
392
393
// add encounter info
394
player.kennel._encounterInfo._data.pets = [];
395
_.gameData.pet.map((pet: {
396
ID: number
397
}) => {
398
player.kennel._encounterInfo._data.pets.push({
399
firstSeenDate: Date.now(),
400
ID: pet.ID,
401
timesBattled: 1,
402
timesRescued: 1
403
});
404
});
405
// Fix broken pets
406
// @ts-expect-error
407
player.kennel.petTeam.forEach(v => {
408
if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();
409
});
410
console.log("Added all pets.");
411
412
413
414
415
// Get all Mythical Epics
416
// @ts-expect-error
417
const mythepics = _.gameData.pet.filter(x => [158, 166, 168].includes(x.ID));
418
// @ts-expect-error
419
mythepics.forEach(x => {
420
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
421
});
422
// Fix broken pets
423
// @ts-expect-error
424
player.kennel.petTeam.forEach(v => {
425
if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();
426
});
427
console.log("Added Mythical Epics.");
428
429
430
431
// Get all Legacy Epics
432
// @ts-expect-error
433
const legepics = _.gameData.pet.filter(x => [125, 126, 127, 128, 129, 130, 131, 132, 133].includes(x.ID));
434
// @ts-expect-error
435
legepics.forEach(x => {
436
player.kennel.addPet(x.ID.toString(), VERY_LARGE_NUMBER, 26376, 100);
437
});
438
// Fix broken pets
439
// @ts-expect-error
440
player.kennel.petTeam.forEach(v => {
441
if (v && (v as any).assignRandomSpells)(v as any).assignRandomSpells();
442
});
443
console.log("Added Legacy Epics.");
444
445
446
// PET HACKS
447
// ============================================
448
// ============================================
449
// UTILITY HACKS
450
451
452
// Disable Inactivity Kick
453
_.constants.constants["GameConstants.Inactivity.LOG_OUT_TIMER_SECONDS"] = 0;
454
console.log("Inactivity Kick Disabled.");
455
456
// 20x walkspeed
457
player._playerContainer.walkSpeed = 20;
458
console.log("Player walkspeed set to 20.");
459
460
461
// UTILITY HACKS
462
// ============================================
463
// ============================================
464
// RUNES
465
466
467
const amount = 100;
468
let mod;
469
Array.from(_.instance.prodigy.gameContainer._inversifyContainer._bindingDictionary._map).forEach(e => {
470
try {
471
// @ts-expect-error
472
if (_.instance.prodigy.gameContainer.get(e[0]).battleData) {
473
// @ts-expect-error
474
mod = e[0];
475
}
476
} catch {
477
// @ts-expect-error
478
console.log(`Error for ${e[0]}`);
479
}
480
});
481
482
483
_.instance.prodigy.gameContainer.get(mod).battleData._secureCharacterState._data.inventory.orb = runeify(_.gameData.orb, amount);
484
485
486
487
488
// RUNES
489
// ============================================
490
// ============================================
491
// EQUIP CELESTIAL GEAR
492
493
494
495
player.equipment.setHat(200);
496
player.equipment.setBoots(93);
497
player.equipment.setOutfit(161);
498
player.equipment.setWeapon(196);
499
500
501
502
503
// EQUIP CELESTIAL GEAR
504
// ============================================
505
// ============================================
506
// POST MAXING PROCESS
507
508
509
// Save the player data to make sure that the max worked
510
saveCharacter();
511
console.log("Character Saved.");
512
513
// Refresh the players appearance
514
player.appearanceChanged = true;
515
console.log("Appearance Refreshed.");
516
517
518
// Close all popups
519
_.instance.prodigy.open.menuCloseAll();
520
console.log("Popups closed.");
521
522
// Save again after closing popups, for good measure.
523
saveCharacter();
524
console.log("Character Saved.");
525
526
527
// POST MAXING PROCESS
528
// ============================================
529
console.log("Max Account Successful.");
530
531
return Toast.fire("Maxed!", `Check your backpack!`, "success");
532
});
533
// End Hypermax Account
534
535
536
537
// END BETA HACKS
538
539