ろBOっと 中級者スレ[Pert32]

このエントリーをはてなブックマークに追加
17ネトゲ廃人@名無し
# 武器持ち替え
AUTOEQUIP: {
+$accessorytele = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_accessory_tele'});
+$accessorydef = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_accessory_def'});
+$arrowdef = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_arrow_def'});
+$recovery = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_weapon_recovery'});
+if (($config{'autoSwitch_accessory_def'} ne "") && ($config{'autoSwitch_accessory_tele'} ne "") && !$chars[$config{'char'}]{'inventory'}[$accessorydef]{'equipped'}) {
+sendUnequip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$accessorytele]{'index'}, $chars[$config{'char'}]{'inventory'}[$accessorytele]{'type_equip'}, 0);
+sleep(1);
+sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$accessorydef]{'index'}, $chars[$config{'char'}]{'inventory'}[$accessorydef]{'type_equip'}, 0);
+}
+if (($config{'autoSwitch_arrow_def'} ne "") && !$chars[$config{'char'}]{'inventory'}[$arrowdef]{'equipped'}) {
+sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$arrowdef]{'index'}, $chars[$config{'char'}]{'inventory'}[$arrowdef]{'type_equip'}, 0);
+}
+if (percent_hp(\%{$chars[$config{'char'}]}) <= $config{"autoSwitch_weapon_recovery_min"}) {
+$recoverymode = 1
+}
+if ($recoverymode == 1 && percent_hp(\%{$chars[$config{'char'}]}) >= $config{"autoSwitch_weapon_recovery_max"}) {
+$recoverymode = 0
+}
my $i = 0;
my $weapon, $shield;
# 特殊武器
-while ($config{"autoSwitch_weapon_$i"} ne "" && $config{"autoSwitch_target_$i"} ne "") {
+while ($config{"autoSwitch_weapon_$i"} ne "" && $config{"autoSwitch_target_$i"} ne "" && $recoverymode == 0) {
18ネトゲ廃人@名無し:03/08/04 12:36 ID:???
# デフォルト武器
-if ($config{'autoSwitch_weapon_def'} ne "") {
+if ($config{'autoSwitch_weapon_def'} ne "" && $recoverymode == 0) {
$weapon = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_weapon_def'});
if ($weapon ne "" && !$chars[$config{'char'}]{'inventory'}[$weapon]{'equipped'}) {
print "Auto equiping default weapon ".$config{'autoSwitch_weapon_def'}."\n";
sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$weapon]{'index'}, $chars[$config{'char'}]{'inventory'}[$weapon]{'type_equip'}, 0);
if ($chars[$config{'char'}]{'inventory'}[$weapon]{'type_equip'} eq 2 && $config{'autoSwitch_shield_def'} ne "") {
$shield = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_shield_def'});
if ($shield ne "" && !$chars[$config{'char'}]{'inventory'}[$shield]{'equipped'}) {
print "Auto equiping default shield ".$config{'autoSwitch_shield_def'}."\n";
sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$shield]{'index'}, $chars[$config{'char'}]{'inventory'}[$shield]{'type_equip'}, 0);
}
}
}
}
+if ($config{'autoSwitch_weapon_recovery'} ne "" && $recoverymode == 1 && !$chars[$config{'char'}]{'inventory'}[$recovery]{'equipped'}) {
+sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$recovery]{'index'}, $chars[$config{'char'}]{'inventory'}[$recovery]{'type_equip'}, 0);
+}

} #END OF BLOCK AUTOEQUIP
}
19ネトゲ廃人@名無し:03/08/04 12:40 ID:???
sub useTeleport {
my $level = shift;
my $invIndex = findIndex(\@{$chars[$config{'char'}]{'inventory'}}, "nameID", $level + 600);
+my $accessorytele = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_accessory_tele'});
+my $accessorydef = findIndexString_lc(\@{$chars[$config{'char'}]{'inventory'}}, "name", $config{'autoSwitch_accessory_def'});
if (!$config{'teleportAuto_useItem'} || $chars[$config{'char'}]{'skills'}{'AL_TELEPORT'}{'lv'}) {
+if (($config{'autoSwitch_accessory_def'} ne "") && ($config{'autoSwitch_accessory_tele'} ne "") && !$chars[$config{'char'}]{'inventory'}[$accessorytele]{'equipped'}) {
+sendUnequip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$accessorydef]{'index'}, $chars[$config{'char'}]{'inventory'}[$accessorydef]{'type_equip'}, 0);
+sleep(1);
+sendEquip(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$accessorytele]{'index'}, $chars[$config{'char'}]{'inventory'}[$accessorytele]{'type_equip'}, 0);
+}
sendTeleport(\$remote_socket, "Random") if ($level == 1);
sendTeleport(\$remote_socket, $config{'saveMap'}.".gat") if ($level == 2);
} elsif ($invIndex ne "") {
sendItemUse(\$remote_socket, $chars[$config{'char'}]{'inventory'}[$invIndex]{'index'}, $accountID);
} else {
print "Can't teleport or respawn - need wing or skill\n" if $config{'debug'};
}
}
20ネトゲ廃人@名無し:03/08/04 12:40 ID:???
#Configには
# 装備切り替え
autoSwitch_weapon_def +5 ハンターボウ
autoSwitch_arrow_def 銀の矢
autoSwitch_shield_def
autoSwitch_weapon_recovery +10 クワドロプルマリシャス コンポジットボウ
autoSwitch_weapon_recovery_min 70
autoSwitch_weapon_recovery_max 95
autoSwitch_accessory_def グローブ
autoSwitch_accessory_tele テレポート ベルト

アクセ、マリシャス、矢の自動装備をつけてみました、と
しょーもないコードでスマソ