- priority: 5 --> 9
- assigned_to: nobody --> leprykaun
Just found a really stupid error in 2.4.5 in the !lart
function. I would have noticed it sooner but I still
run 2.4 (I don't need the op stuff).
The error:
When you use '!lart name', there is no name inserted
into the lart, and you may get an error from the bot in
terminal.
The bug:
That I used local variables inside the if/else clause,
and they got lost on the way to the search/replace call
to add the targets name into the random lart.
The fix:
In bwentbot.pl, find the 'sub lart_call' subfunction
and delete it. Add the folowing code in its place...
------start code below here ------
#############################################################################
# @larts is an array of random larts used in
conjuntion with lart_call which
# responds to !lart by larting the 'target' requested
#############################################################################
sub lart_call {
my @arglist = @_;
my $target = "";
if ( !@arglist ) {
return "0";
}
else {
my $lart = $larts[ rand scalar @larts ];
# trying to lart the bot? fuck off ;)
if ($arglist[0] eq $mynick) {
$target = $nick;
}
else {
$target = $arglist[0];
}
# replace 'WHO' with the targets name in the
random lart
$lart =~ s/WHO/$target/g;
return $lart;
}
}
--------- end code above here ------
OR, delete the 'my' variable before both occurances of
'$target' in the if/else clause, and add 'my $target =
"" ' at the top of the function.
Sorry again about this, wish someone had reported it to
me sooner.
-Leprykaun