daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2012 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2. use Net::IRC;
  3. use PerlSpeak;
  4.  
  5. $irc = new Net::IRC;
  6.  
  7. $homechannel = "#nurds";
  8.  
  9. $ps = PerlSpeak->new();
  10. $ps->{tts_engine} = "festival";
  11.  
  12. $conn = $irc->newconn(Nick    => 'prutbot3',
  13.                       Server  => 'irc.oftc.net');
  14.  
  15. sub on_connect {
  16.         my $self = shift;
  17.  
  18.         $self->join($homechannel);
  19.         print ("connect!\n");
  20. }
  21.  
  22. sub on_msg {
  23.  
  24.         $event = $_[1];
  25.         my $self = shift;
  26.  
  27.         $input = $event->{args}[0];
  28.  
  29.         if ($input =~ /^(.)say(.*)/) {
  30.                 $ps->say($2);
  31.         }
  32.  
  33.         if ($input =~ /^(.)flash(.*)/) {
  34.                 $ps->say("hark hark hark hark hark hark");
  35.         }
  36.  
  37. }
  38.  
  39. $conn->add_handler('public', \&on_msg);
  40.  
  41. $conn->add_global_handler(376, \&on_connect);
  42.  
  43. $irc->start;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top