From: Andres S. <di...@us...> - 2005-04-09 17:20:08
|
Update of /cvsroot/tuxaator/tuxaator/Plugins/Talk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13936/Plugins/Talk Modified Files: Plugin.pm Log Message: incorporated the compliment plugin into the talk plugin Index: Plugin.pm =================================================================== RCS file: /cvsroot/tuxaator/tuxaator/Plugins/Talk/Plugin.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Plugin.pm 9 Apr 2005 17:11:09 -0000 1.11 --- Plugin.pm 9 Apr 2005 17:19:29 -0000 1.12 *************** *** 86,89 **** --- 86,93 ---- "restricted" => 1, "level" => 2}, + "!compliment" => + {"action" => "do_compliment", + "restricted" => 0, + "level" => 0}, ); *************** *** 158,161 **** --- 162,179 ---- } + sub do_compliment { + my $self = shift; + my $event = pop @_; + my $victim = join " " => @_; + if ( (length($victim) == 0) || (length($victim) > 30) ) + { + $victim = $event->nick; + }; + + my $message = make_random_string('compliment.txt', + victim => $victim); + $self->{'core'}->queue($event, $message); + } + # wrapper for a random quote generator, is executed 60 seconds after the bot joins the |