★RO kore情報交換所 中級者のマクロ(11体目)★
100 :
99:
sub useWeaponsChange {
my $monsterID = shift;
my $i = 1;
my $weaponName;
# useWeapons_1 & _2 の両方がない場合にはこのロジックを使わない
if ($config{'useWeapons_1'} ne "" || $config{'useWeapons_2'} ne ""){
$weaponName = $config{'useWeapons_1'};
while(1){
last if (!$config{"targetMonster_$i"});
if ($monsters{$monsterID}{'name'} =~ /\Q$config{"targetMonster_$i"}/){
$weaponName = $config{'useWeapons_2'};
print "Use Weapon : $weaponName\n" if ($config{'debug'});
last;
}
$i++;
}
for ($i = 0; $i < @equipment; $i++) {
print "Search Equip Item : $chars[$config{'char'}]{'inventory'}[$equipment[$i]]{'name'}\n" if ($config{'debug'} == 2);
if ($weaponName =~ /\Q$chars[$config{'char'}]{'inventory'}[$equipment[$i]]{'name'}\E/){
print "Equip Check Succesed : $chars[$config{'char'}]{'inventory'}[$equipment[$i]]{'name'}\n" if ($config{'debug'});
if (!$chars[$config{'char'}]{'inventory'}[$equipment[$i]]{'equipped'}){
print "Equip Packet Sended!\n" if ($config{'debug'});
sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$equipment[$i]]{'index'}, $chars[$config{'char'}]{'inventory'}[$equipment[$i]]{'type_equip'}, 0);
}
last;
}
}
}
}