Last active
February 25, 2017 19:11
-
-
Save resilar/16b6e0b6f81745ecf1d5d95e583e1741 to your computer and use it in GitHub Desktop.
irssi script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Irssi; | |
our $VERSION = '0.0.6283185307'; | |
our %IRSSI = ( | |
authors => 'def', | |
contact => 'def <[email protected]>', | |
name => 'spoiler', | |
description => 'Colorize lines of idiots with black on black text', | |
license => 'Public domain', | |
); | |
# /load spoiler.pl | |
# /set spoiler_nicks lamia | |
# /set -clear spoiler_nicks | |
my @spoiler_nicks; | |
sub message_public { | |
my ($server, $msg, $nick, $address, $target) = @_; | |
my $color = ''; | |
$color = "\0031,1" if (grep $_ eq $nick, @spoiler_nicks); | |
$server->command('/^format pubmsg {pubmsgnick $2 {pubnick $0}}' . $color . '$1'); | |
} | |
sub setup_changed { @spoiler_nicks = split /\s+|,/, Irssi::settings_get_str('spoiler_nicks'); } | |
Irssi::signal_add('message public', 'message_public'); | |
Irssi::signal_add_last('setup changed', 'setup_changed'); | |
Irssi::settings_add_str('spoiler', 'spoiler_nicks' => ''); | |
setup_changed(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment