Posted by Cheez Thu 8th Mar 2007 14:12 - Syntax is Perl - 52 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
-
use strict;
-
use vars ($VERSION %IRSSI);
-
use Irssi;
-
-
$VERSION = '1.0';
-
%IRSSI = (
-
authors => "Chris \'Cheez\' Stretton",
-
contact => "cstretton\@gmail.com",
-
name => "keepnick",
-
description => "Changes to the given nick if that nick parts a channel",
-
licence => "Public Domain"
-
);
-
-
sub check_nick {
-
my ($server, $nick) = @_;
-
my $checkednick = Irssi::settings_get_str('keepnick_nick');
-
$_ = $nick;
-
if (/$checkednick/i) {
-
$server->command('nick ' . $checkednick);
-
}
-
}
-
-
sub keepnick_part {
-
my ($server, $channel, $nick, $address, $reason) = @_;
-
check_nick($server, $nick);
-
Irssi::signal_continue($server, $channel, $nick, $address, $reason);
-
}
-
-
sub keepnick_quit {
-
my ($server, $nick, $address, $reason) = @_;
-
check_nick($server, $nick);
-
Irssi::signal_continue($server, $nick, $address, $reason);
-
}
-
-
Irssi::settings_add_str("keepnick", "keepnick_nick", "");
-
-
Irssi::signal_add("message part", "keepnick_part");
-
Irssi::signal_add("message quit", "keepnick_quit");
PermaLink to this entry https://pastebin.co.uk/11564
Posted by Cheez Thu 8th Mar 2007 14:12 - Syntax is Perl - 52 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0