Creating Hacks
To create hacks for Prodigy X you have to use the extension method.
Firstly pick the category you want to create a hack for. Currently, the categories are:
- Battle
- Inventory
- Pet
- Player
- Utility
Once you picked the category, go into that category file.
In the scope of withCategory
you can use the hack
and toggle
functions.
Hack Function
The hack function is used to create a hack as a button.
To create a hack you will need a name, a description and a function.
The function accepts 3 parameters:
- hack: The game object. On the extension, this is equal to
_.game
. - player: The player object. On the extension, this is equal to
_.player
. - gameData: Data about the game. On the extension, this is equal to
_.gameData
.
Example
The example below shows how the hack Set Gold
was created.
src/hacks/player.tsx | |
---|---|
- Initialize the hack.
- Ask the user for the amount of gold. Reference the alerts page for more information.
- Set the amount of gold.
- Alert the user that the amount of gold has been set. Reference the alerts page for more information.
The hack function also accepts an extensionOnly
parameter.
Example
The example below shows how to make a Set Gold
hack only available on the extension.
src/hacks/player.tsx | |
---|---|
- Tell the cheat menu to only load this hack on the extension build.
Toggle Function
The toggle function is used to create a hack, with an enabled and disabled state.
To create a toggler you will need a name, a function, and a get default value function.
The function accepts 4 parameters:
- hack: The game object. On the extension, this is equal to
_.game
. - player: The player object. On the extension, this is equal to
_.player
. - gameData: Data about the game. On the extension, this is equal to
_.gameData
. - toggleState: The current state of the toggler.
The get default value function accepts 2 parameters:
- hack: The game object. On the extension, this is equal to
_.game
. - player: The player object. On the extension, this is equal to
_.player
.
Example
The example below shows how the toggler Instant Kill
was created.
- Initialize the toggler.
- Change the damage multiplier depending on whether the toggler was toggled or not.
- Alert the user that the damage multiplier has been changed. Reference the alerts page for more information.
- If the damage modifier is already set to 1e9, make the toggler toggled.
The toggle function also accepts an extensionOnly
parameter.