-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwear.pl
40 lines (34 loc) · 1.68 KB
/
wear.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## external wear item
$Wearing=substr($player{'object'},4,length($player{'object'}));
if (length($form{'j'})==2) {
$class=substr($form{'j'},0,1); $class=~s/[^A-Z]//g;
$type=substr($form{'j'},1,1); $type=~s/[^0-9a-z]//g;
if ($player{'inven'}=~/$class$type/) {
if ($type ne "") {
if ($class eq "L") {
$Wearing=substr($Wearing,0,index($Wearing,"L")).substr($Wearing,index($Wearing,"L")+2,length($Wearing));
$Wearing=substr($Wearing,0,index($Wearing,"M")).substr($Wearing,index($Wearing,"M")+2,length($Wearing));
$Wearing=substr($Wearing,0,index($Wearing,"S")).substr($Wearing,index($Wearing,"S")+2,length($Wearing));
$Wearing.="$class$type";
}
if ($class eq "M") {
$Wearing=substr($Wearing,0,index($Wearing,"L")).substr($Wearing,index($Wearing,"L")+2,length($Wearing));
$Wearing=substr($Wearing,0,index($Wearing,"M")).substr($Wearing,index($Wearing,"M")+2,length($Wearing));
$Wearing=substr($Wearing,0,index($Wearing,"S")).substr($Wearing,index($Wearing,"S")+2,length($Wearing));
$Wearing.="$class$type";
}
if ($class eq "S") {
$Wearing=substr($Wearing,0,index($Wearing,"L")).substr($Wearing,index($Wearing,"L")+2,length($Wearing));
$Wearing=substr($Wearing,0,index($Wearing,"M")).substr($Wearing,index($Wearing,"M")+2,length($Wearing));
$Wearing=substr($Wearing,0,index($Wearing,"S")).substr($Wearing,index($Wearing,"S")+2,length($Wearing));
$Wearing.="$class$type";
}
}
$player{'object'}.='L' if length($player{'object'})<4;
$player{'object'}=substr($player{'object'},0,4).$Wearing;
print "dinv=1\n";
do "token.pl";
}
}
$form{'c'}="refresh";
1;