When you're referring to docs i guess you meant these lines:
// Now we split the character ID number into two portions with a binary
// shift operation. If you don't understand what this does, just copy it.
@card3 = @charid & 65535;
@card4 = @charid >> 16;
If that is the case then i think it would be possible to retrieve it (assuming we're operating on a 32bit system):
@card3 is storing the LAST 16 bits of the character's ID
@card4 is storing the FIRST 16 bits of the character's ID
So you'll just need to perform a left shift by 16 bits and perform a bitwise OR
@crafter_char_id = (@inventorylist_card4[.@i] << 16) | @inventorylist_card3[.@i];
Let me know if that works