Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.03 KB | None | 0 0
  1. use strict;
  2. use vars qw($VERSION %IRSSI);
  3.  
  4. use Irssi;
  5. $VERSION = '1.00';
  6. %IRSSI = (
  7.     authors     => 'Dafydd "Afal" Francis',
  8.     contact     => 'afal@somethingafal.com',
  9.     name        => 'Blah Blah Fishcakes',
  10.     description => 'This script allows ' .
  11.                    'you to turn anything someone ' .
  12.                    'says to "blah blah fishcakes".',
  13.     license     => 'Public Domain',
  14. );
  15.  
  16. #main event handler
  17. sub pony_message {
  18.         my ($server, $data, $nick, $address) = @_;
  19.         my ($target, $msg) = split(/ :/, $data,2);
  20.  
  21.         if ($nick == 'Indigopony') {
  22.                 my $replacement = Irssi::settings_get_str('text_replace');
  23.                 #re-emit the signal to make Irssi display it
  24.                 Irssi::signal_emit('event privmsg', ($server, "$target :$replacement", $nick, $address));
  25.                 #and stop
  26.                 Irssi::signal_stop();
  27.         }
  28. }
  29.  
  30. Irssi::signal_add('event privmsg', 'pony_message');
  31.  
  32. Irssi::settings_add_str('misc', 'text_replace', "blah blah fishcakes");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement