From: Andres S. <di...@us...> - 2005-04-09 17:11:18
|
Update of /cvsroot/tuxaator/tuxaator/Plugins/Talk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9126/Plugins/Talk Modified Files: Plugin.pm Log Message: incorporated the insult plugin into the talk plugin Index: Plugin.pm =================================================================== RCS file: /cvsroot/tuxaator/tuxaator/Plugins/Talk/Plugin.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Plugin.pm 9 Apr 2005 16:53:20 -0000 1.10 --- Plugin.pm 9 Apr 2005 17:11:09 -0000 1.11 *************** *** 3,7 **** package Talk; #use base qw(Tuxaator::Plugin); - use Data::Dumper; # Random-path sayings --- 3,6 ---- *************** *** 83,86 **** --- 82,89 ---- "restricted" => 1, "level" => 3}, + "!insult" => + {"action" => "do_insult", + "restricted" => 1, + "level" => 2}, ); *************** *** 141,144 **** --- 144,161 ---- } + sub do_insult { + my $self = shift; + my $event = pop @_; + my $victim = join " " => @_; + if ( (length($victim) == 0) || (length($victim) > 30) ) + { + $victim = $event->nick; + }; + + my $message = make_random_string('insult.txt', + victim => $victim); + $self->{'core'}->queue($event, $message); + } + # wrapper for a random quote generator, is executed 60 seconds after the bot joins the |