If you're asking how to read the profile (which I think you are), I have made a script that does this. As a result, you can then pull a list of skill IDs with their corresponding skill level. I have listed this in the
Wiki, but I've also posted some source on
Sourceforge. It requires a few functions to make things a bit easier to convert from ASCII (which is how the blob is stored) to integers (signed or unsigned depending on the data). Here's the main stuff you'll need:
First, the
functions:
Code:
1 <?php
2
3 // convert an input string into it's binary equivalent.
4 function asc2bin($asciiInput, $byteLength=8) {
5 // Numerical data is reverse ASCII, so we need to turn it around
6 $asciiRev = strrev($asciiInput);
7
8 $binaryOutput = '';
9 $strSize = strlen($asciiRev);
10
11 for($x=0; $x<$strSize; $x++)
12 {
13 $charBin = decbin(ord($asciiRev{$x}));
14 $charBin = str_pad($charBin, $byteLength, '0', STR_PAD_LEFT);
15 $binaryOutput .= $charBin;
16 }
17
18 return $binaryOutput;
19 }
28 // Convert ASCII to unsigned integer (requires asc2bin)
29 function asc2uint($asciiInput) {
30 if ($decimalOutput = bindec(asc2bin($asciiInput))) {
31 return $decimalOutput;
32 } else {
33 return "0";
34 }
35 }
36
37 // Convert ASCII to a Hex representation of its string (requires asc2bin)
38 function asc2hex($asciiInput) {
39 if ($hexOutput = bin2hex(asc2bin($asciiInput))) {
40 return $hexOutput;
41 }
42 }
Next, the
code to pull the profile & spit out the skills:
Code:
1 <?php
2 $query_profile = "SELECT profile FROM character_ WHERE id=" . $_GET["id"];
3 $result_profile = mysql_query($query_profile,$db);
4 $db_row_profile = mysql_fetch_array($result_profile);
5
6 $profileResult = $db_row_profile["profile"];
178 // skills[75]
179 for ($x = 0; $x <= 74; $x++) {
180 $Profile["skills"][$x] = asc2uint(substr($profileResult,$x*4+4796,4));
181 };
300 ?>
You can then access the skills by using
$Profile[skills][x] where
x is the number associated with the skill (which there are actually
74 including Frenzy). If you want
just the skills, you could probably simplify the function by just using
ord() to convert each character to a number, but it could also cause more problems.
On a side note, if you're looking to pull any other information from the profile, the script I made, listed above, splits everything up from the profile into a nice array. I've modified it since to also convert the extprofile blob, but I haven't updated it to CVS yet. If you want to use any of it for any tools you're making, feel free, since I have it published under the GNU GPL.
In any case, hope this helps.