PostBox Folder

Newbie Spellweaver
Joined
Aug 31, 2012
Messages
77
Reaction score
1
Hello, so ive been using ItemDistributor.exe for sending out items on players, i am planning on integrating it via web either php/asp but i cannot seem to figure out how to retrieve the specific name of the folder into which the user belongs into.

e.g

Romel (Account) - "PostBox/123/romel.dat"

The question is where or how to find the "123" name of the folder.

Thanks.
 
Newbie Spellweaver
Joined
May 9, 2012
Messages
65
Reaction score
24

you can use this to return the folder number
Code:
function numDir($name)
    {
        $character=array
        (
            "0"=>"48",
            "1"=>"49",
            "2"=>"50",
            "3"=>"51",
            "4"=>"52",
            "5"=>"53",
            "6"=>"54",
            "7"=>"55",
            "8"=>"56",
            "9"=>"57",

            "a"=>"65",
            "b"=>"66",
            "c"=>"67",
            "d"=>"68",
            "e"=>"69",
            "f"=>"70",
            "g"=>"71",
            "h"=>"72",
            "i"=>"73",
            "j"=>"74",
            "k"=>"75",
            "l"=>"76",
            "m"=>"77",
            "n"=>"78",
            "o"=>"79",
            "p"=>"80",
            "q"=>"81",
            "r"=>"82",
            "s"=>"83",
            "t"=>"84",
            "u"=>"85",
            "v"=>"86",
            "w"=>"87",
            "x"=>"88",
            "y"=>"89",
            "z"=>"90",

            "A"=>"65",
            "B"=>"66",
            "C"=>"67",
            "D"=>"68",
            "E"=>"69",
            "F"=>"70",
            "G"=>"71",
            "H"=>"72",
            "I"=>"73",
            "J"=>"74",
            "K"=>"75",
            "L"=>"76",
            "M"=>"77",
            "N"=>"78",
            "O"=>"79",
            "P"=>"80",
            "Q"=>"81",
            "R"=>"82",
            "S"=>"83",
            "T"=>"84",
            "U"=>"85",
            "V"=>"86",
            "W"=>"87",
            "X"=>"88",
            "Y"=>"89",
            "Z"=>"90",
        );

        for($i=0;$i<strlen($name);$i++)
        {
            $total+=$character[$name[$i]];
            if($total>=256)
                $total=$total-256;
        }

        return $total;
    }
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
77
Reaction score
1


Thank you man. now i can get the folder number.
 
RZA-PT | KilroyPT
Joined
Aug 27, 2007
Messages
936
Reaction score
85

this is over complicated. each characters value is its ascii value.

Code:
function numDir($name){ 
   $total = 0;  
    for($i=0;$i<strlen($name);$i++) {       
        $total+=ord(strtoupper($name[$i]));
        if($total>=256) {
            $total=$total-256;
        }
    }
    return $total;
}
that is all it needs

I have a php script that does it all, will share here shortly


edit: here is the complete functional script.

I have stripped out my security protections for obvious reasons so you should add some to stop players sending themselves gifts.




About: Takes
5/6 GET/POST values:
user (account), chName (character, use *** if its for any char on the account), itCode (item code, use gg101/gg102 for gold and exp), spec (item spec, or qty for gold/exp), msg (what it shows as the message with the item) and val (use for value for gold/exp, will overwrite spec if its set)

Will check if the character exists on that account (if you specify the char name),
also logs all events of use.

returns the message in json format so that its easy to use with AJAX.
 
Last edited:
Joined
Jul 24, 2006
Messages
884
Reaction score
581
Just a fun little side note, you can also add a password to the postbox, so you can not get the item unless you have it

Password goes at the end.

 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
77
Reaction score
1
Just a fun little side note, you can also add a password to the postbox, so you can not get the item unless you have it

Password goes at the end.


oohh hahahaha this is nice a little verification code.
 

Attachments

You must be registered for see attachments list
RZA-PT | KilroyPT
Joined
Aug 27, 2007
Messages
936
Reaction score
85
yea i found that by accident too lol. if you dont put the message in quotation marks "" then it becomes the code, or you can put it after the message too.
 
Newbie Spellweaver
Joined
Oct 14, 2021
Messages
6
Reaction score
0
Colud I change the item name by postbox system?
I want to sign the unique name for postbox item
 
Newbie Spellweaver
Joined
Jul 25, 2023
Messages
28
Reaction score
1
Please tell me how to add items to the website. My website only has a registration section