Hexidecimal to Decimal autogenerated file names

Programming related discussions related to game research
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

Hexidecimal to Decimal autogenerated file names

Post by happydance »

hello new member here, I've been learning to make my own script for about a week now and still a lot to learn...


I've made this noob script to extract the pack files... but my problem is the names are on hexadecimal, I was wondering how can I make it export to decimal file names for easy file arrage on windows.

Code: Select all

endian little

for i = 0 < 5693
FindLoc FILES string "PACK" 0x0
xmath SIZEloc "FILES + 24" 
goto SIZEloc
get SIZE long
putarray 0 i FILES
putarray 1 i SIZE

string NAME p= "Package_%05x.pack" i

log NAME FILES SIZE
next i
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Hexidecimal to Decimal autogenerated file names

Post by aluigi »

'x' -> 'd':

Code: Select all

string NAME p= "Package_%05d.pack" i

http://www.cplusplus.com/reference/cstdio/printf/
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

Re: Hexidecimal to Decimal autogenerated file names

Post by happydance »

thanks its working great now! :)