Prodigy-Hacking / ProdigyMathGameHacking

Prodigy Hacking: Hacking for the right reasons. | Questions? Ask on our Discord. https://discord.gg/XQDfbfq
https://prodigyhacking.com
Other
17 stars 10 forks source link

Get Asset #565

Closed PatheticMustan closed 3 years ago

PatheticMustan commented 3 years ago

tbh, I've been procrastinating a lot of the features like #564, and whatnot, because I have literally no idea how to get assets

I really want to figure out an easy way to get the asset of any given item, like hair, or robe. AFAIK, these items are fetched separately, but I'm not totally sure. There are also some cases that use spritesheets, so whoever figures it out will have to deal with that too.

ArcerionDev commented 3 years ago

I know how to fetch most of those, I have the src on that bot I made

ArcerionDev commented 3 years ago

give me a sec

ArcerionDev commented 3 years ago

ok so, we rip the object's gameData like this

let gameAPIdata = await (await fetch('https://api.prodigygame.com/game-api/status')).json()
 let version = gameAPIdata.data.prodigyGameFlags.gameDataVersion
 let data = await (await fetch('https://cdn.prodigygame.com/game/data/production/'+version+'/data.json')).json()
ArcerionDev commented 3 years ago

(or we use the gameData in the game directly, doesn't matter) then, we take the data for the object. let's call the object obj. Then, we make a call to the CDN, which does require parameters, so we determine them from the gameData. It should look something like this: https://cdn.prodigygame.com/game/assets/v1_cache/single-images/icon-${obj.type}-${obj.ID}/${obj.metadata.vIcon}/icon-${obj.type}-${obj.ID}.png And there we go! We can get a raw asset like so: img (https://cdn.prodigygame.com/game/assets/v1_cache/single-images/icon-hat-1/2/icon-hat-1.png)

ArcerionDev commented 3 years ago

I used this here: https://github.com/ArcerionDev/ProdigyMathGameBot

ArcerionDev commented 3 years ago

Note: these are the icons, if you want the actual assets used by the player, replace icon with player in the url

ArcerionDev commented 3 years ago

eg player: player icon: icon

PatheticMustan commented 3 years ago

Alright, ty arc

hellonearth311 commented 3 years ago

how do i do wands? when i try to wand "access denied" xml file no styling thingy shows up.

ArcerionDev commented 3 years ago

I'll make a function for this

Protuber commented 3 years ago

r

Protuber commented 3 years ago

r

Protuber commented 3 years ago

r

ArcerionDev commented 3 years ago

was resolved earlier