Advertisement
Guest User

*Houhou*

a guest
Nov 24th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.08 KB | None | 0 0
  1. use Irssi;
  2. use strict;
  3. use utf8;
  4. use vars qw($VERSION %IRSSI);
  5.  
  6. $VERSION = "1.02";
  7. %IRSSI = (
  8.         authors     => 'GentilBoulet',
  9.         name        => 'houou',
  10.         description => 'Simple *houhou* script',
  11.         license     => 'Public Domain',
  12.         changed     => 'Tue Mar 02 14:38:20 CEST 2012'
  13. );
  14.  
  15. my %times=();
  16.  
  17. sub is_houhou_speaking {
  18.         my ($server, $msg, $nick, $address, $target) = @_;
  19.         my $houhou="houhou";
  20.         my $match = 0;
  21.         while($msg=~/($houhou)/gi)
  22.         {
  23.                 $match++;
  24.         }
  25.         if ($match>0)
  26.         {
  27.                 if($target=~/ensiie|anidb|anidb-dev|arise/)
  28.                 {
  29.                         return 0;
  30.                 }
  31.                 {
  32.                         return houhou($server,$nick,$target);
  33.                 }
  34.         }
  35.         return 0;
  36. }
  37.  
  38. sub houhou {
  39.         my ($server, $nick, $target) = @_;
  40.  
  41.         my $output="*houhou*";
  42.         $server->command('msg '.$target.' '.$output);
  43.  
  44.         return 0;
  45. }
  46.  
  47.  
  48. Irssi::signal_add("message public", "is_houhou_speaking");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement