All pastes #773002 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-14 05:44 UTC
rendered paste body
IRC::add_message_handler("PRIVMSG", "privmsg_handler");

open ( SHOBON"<xchatscripts/Shobon" );
 chomp( @SHOBON = <SHOBON> );
        close SHOBON;

sub privmsg_handler {
   $thingy = $_[0];
   $_ = $thingy;
( $nick, $user, $host, $hook, $channel, $say ) = (m/:(\S+)!(\S+)\@(\S+)\s(\w+)\s(\S+)\s:(.*)/);
  if ($say =~ /^!shobon$/i ) {
         $answer = $SHOBON[rand @SHOBON];
            IRC::send_raw ( "PRIVMSG $channel :$answer\n" );
}
   return 0;
}