statement in sub ai_SkillUse
Code: Select all
sub ai_skillUse {
return if ($char->{muted});
my %args = (
skillHandle => shift,
lv => shift,
maxCastTime => { time => time, timeout => shift },
minCastTime => { time => time, timeout => shift },
target => shift,
y => shift,
tag => shift,
ret => shift,
waitBeforeUse => { time => time, timeout => shift },
prefix => shift
);
$args{giveup}{time} = time;
$args{giveup}{timeout} = $timeout{ai_skill_use_giveup}{timeout};
if ($args{y} ne "") {
$args{x} = $args{target};
delete $args{target};
}
AI::queue("skill_use", \%args);
}
maxCastTime => { time => time, timeout => shift },
minCastTime => { time => time, timeout => shift },
waitBeforeUse => { time => time, timeout => shift },
$args{giveup}{time} = time;
They will get incorrect time value, the decimal is truncated.
And then, the "timeOut" will get wrong result from these time values.
So, the AI.pm should add a line "use Time::HiRes qw(time);" after "use strict;", such as :
Code: Select all
......
# moved into this package.
package AI;
use strict;
use Time::HiRes qw(time);
use Globals;
use Utils qw(binFind);
........
I make my Monk bot has most 90% ComboSkill, even more high !