Иногда бот раз 5 пишет, что нету уха или скилла и идет пешком покуапть/продавать.
Но иногда тупо повисет и консоль усыпается бесконечными записями об отсутствии уха или телепорта.
Вот исправление:
src/AI/CoreLogic.pm
Блок ###AUTO-SELL###
Ищем
Код: Выделить всё
if ($args->{'warpedToSave'} && !$args->{'mapChanged'}) {
undef $args->{'warpedToSave'};
}
if ($config{'saveMap'} ne "" && $config{'saveMap_warpToBuyOrSell'} && !$args->{'warpedToSave'}
&& !$cities_lut{$field{'name'}.'.rsw'} && $config{'saveMap'} ne $field{name}) {
$args->{'warpedToSave'} = 1;
message T("Teleporting to auto-sell\n"), "teleport";
useTeleport(2);
$timeout{'ai_sellAuto'}{'time'} = time;
Код: Выделить всё
if ($args->{'warpedToSave'} && !$args->{'mapChanged'} && !timeOut($args->{warpStart}, 8)) {
undef $args->{'warpedToSave'};
}
if ($config{'saveMap'} ne "" && $config{'saveMap_warpToBuyOrSell'} && !$args->{'warpedToSave'}
&& !$cities_lut{$field{'name'}.'.rsw'} && $config{'saveMap'} ne $field{name}) {
$args->{'warpedToSave'} = 1;
# If we still haven't warped after a certain amount of time, fallback to walking
$args->{warpStart} = time unless $args->{warpStart};
message T("Teleporting to auto-sell\n"), "teleport";
useTeleport(2);
$timeout{'ai_sellAuto'}{'time'} = time;
Ищем
Код: Выделить всё
if ($args->{warpedToSave} && !$args->{mapChanged}) {
undef $args->{warpedToSave};
}
if ($config{'saveMap'} ne "" && $config{'saveMap_warpToBuyOrSell'} && !$args->{warpedToSave}
&& !$cities_lut{$field{'name'}.'.rsw'} && $config{'saveMap'} ne $field{name}) {
$args->{warpedToSave} = 1;
if ($needitem ne "") {
$msgneeditem = "Auto-buy: $needitem\n";
}
message T($msgneeditem."Teleporting to auto-buy\n"), "teleport";
useTeleport(2);
$timeout{ai_buyAuto_wait}{time} = time;
Код: Выделить всё
if ($args->{warpedToSave} && !$args->{mapChanged} && !timeOut($args->{warpStart}, 8)) {
undef $args->{warpedToSave};
}
if ($config{'saveMap'} ne "" && $config{'saveMap_warpToBuyOrSell'} && !$args->{warpedToSave}
&& !$cities_lut{$field{'name'}.'.rsw'} && $config{'saveMap'} ne $field{name}) {
$args->{warpedToSave} = 1;
if ($needitem ne "") {
$msgneeditem = "Auto-buy: $needitem\n";
}
# If we still haven't warped after a certain amount of time, fallback to walking
$args->{warpStart} = time unless $args->{warpStart};
message T($msgneeditem."Teleporting to auto-buy\n"), "teleport";
useTeleport(2);
$timeout{ai_buyAuto_wait}{time} = time;
Теперь бот 4 раза скажет, что нет уха или скила и пойдет пешком. Проверено, работает.