Skip to content

Instantly share code, notes, and snippets.

@MikeRixWolfe
Last active October 5, 2016 17:36
Show Gist options
  • Select an option

  • Save MikeRixWolfe/b239351610eb711f1e7e442cf16036a0 to your computer and use it in GitHub Desktop.

Select an option

Save MikeRixWolfe/b239351610eb711f1e7e442cf16036a0 to your computer and use it in GitHub Desktop.
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.01';
%IRSSI = (
authors => 'Mike Wolfe',
contact => 'bears@ccowmu.org',
name => 'noxd',
description => 'deal with idiots',
license => 'GPLv3',
);
sub sig_printtext {
my ($server, $data, $nick, $address) = @_;
my ($target, $text) = split(/ :/, $data, 2);
if ($text =~ m/x.?D+/i) {
$text =~ s/x.?D+/I AM AN IDIOT/ig;
Irssi::signal_stop();
Irssi::signal_remove('event privmsg', 'sig_printtext');
Irssi::signal_emit('event privmsg', $server, $target." :".$text, $nick, $address);
Irssi::signal_add('event privmsg', 'sig_printtext');
}
}
Irssi::signal_add('event privmsg', 'sig_printtext');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment