Warp to saveMap even when storageAuto_useChatCommand
Posted: 01 Apr 2013, 04:19
I noticed that when the "storageAuto_useChatCommand" is set, the bot will not warp to save map even when "saveMap_warpToBuyOrSell" is set to 1. This is a problem when Kore is in a highly aggressive map. Kore will do autostorage even when there are already monsters attacking it. The few codes I added will (hopefully) fix that issue. Kore will warp to the save map first before performing autostorage.
In CoreLogic.pm
I already tested it but it is not working most of the time. I am not sure though if it will make a conflict with other functions. I don't know if this will make sense to others but I find this useful. Hope it can be improved so I won't have to edit it manually every time I download a new version.
In CoreLogic.pm
Code: Select all
elsif (AI::action eq "storageAuto" && timeOut($timeout{'ai_storageAuto'})) {
# Main autostorage block
my $args = AI::args;
my $do_route;
#I added an additional check here (|| ($config{storageAuto_useChatCommand} && $config{'saveMap_warpToBuyOrSell'}))
if (!$config{storageAuto_useChatCommand} || ($config{storageAuto_useChatCommand} && $config{'saveMap_warpToBuyOrSell'}) ) {
# Stop if the specified NPC is invalid
$args->{npc} = {};
getNPCInfo($config{'storageAuto_npc'}, $args->{npc});
if (!defined($args->{npc}{ok})) {
$args->{done} = 1;
return;
}
if (!AI::args->{distance}) {
# Calculate variable or fixed (old) distance
if ($config{'storageAuto_minDistance'} && $config{'storageAuto_maxDistance'}) {
AI::args->{distance} = $config{'storageAuto_minDistance'} + round(rand($config{'storageAuto_maxDistance'} - $config{'storageAuto_minDistance'}));
} else {
AI::args->{distance} = $config{'storageAuto_distance'};
}
}