Inv K column value

Joined
Oct 19, 2008
Messages
802
Reaction score
102
the K0,K1 etc in decimal is like: 465436699
hex of it would be: 1bbe001b

Now its made of item type and ncount and then there is the last 2 bytes.

They seem to increase for each identical item looted by same person ( a kind of serial).

But it becomes a problem when u face a inv search php script.

Is there any specific formula/way to calculate it without having to loop through all 256 values.

Since if you face 1000+ accounts x100 inv slots and then each slot would have to be checked 256 times ... its extremely slow.
Could strip the decimal string and ignore the serial, but that results in lots of false positives (it ends up matching other similar decimal values).
 
Just strip it out.

In my dupechecker (same as inventory scan i guess) I use something similar to :-

x = hexdec(substr(sprintf("%08x",$k),0,6). "00")

So x will just be the item without the inventory slot (last 2 digits) - then compare this against your search item
 
Upvote 0
well stripping the value off in hex results in wrong decimal value. so you have to strip last 3 digits in decimal. That however, with most php functions results in a problem where it matches wrong values.
like strpos and such wont work since they would return if its also in the middle somewhere.
using.
substr comparing works... until u face stuff like ore and resource etc. - shorter codes.

Even if i end up using lenght of the string im comparing to to strip the substr to matching length - u get still wrong values mixed in.
Like getting ore mixed in with t4 gems and such.


Stupid inv system -_-
 
Upvote 0
stripping the value off in hex is right.

1) Get your 'K' value from the database
2) Convert it to hex (make sure its 8 digits long, so pad it out if needed) = 01234567
3) Split that number into three parts 0123 (is the ncount) 45 (is the type) 67 (is the inv slot)
4) You may want to convert the last 2 digits back to decimal 00-FF -> 0-255.

Simple
 
Upvote 0
Back