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.
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;
}
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; }
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; }
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;
}
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.