Skip to content

Instantly share code, notes, and snippets.

@LifeIsPain
Created August 4, 2013 08:29
Show Gist options
  • Save LifeIsPain/6149694 to your computer and use it in GitHub Desktop.
Save LifeIsPain/6149694 to your computer and use it in GitHub Desktop.
XChat Script to disable auto reconnecting when disconnected with a k-line or z-line
# Name: disable_reconnect_on_kline.pl
# Version: 001
# Author: LifeIsPain < idontlikespam (at) orvp [dot] net >
# Date: 2013-08-04
# Description: Disable auto reconnecting when disconnected with a k-line or z-line
# Version History
# 001 2013-05-04 Initial Version, requested in #xchat
use Xchat qw(:all);
register('Disable reconnect on k-line', '001', 'Disable auto reconnecting when disconnected by k-line');
hook_server('QUIT', \&self_quit_check);
sub self_quit_check {
my $self = get_info('nick');
if ($_[0][0] =~ /^:\Q$self\E(?:!|$)/ && $_[0][2] =~ /^:.-line/i) {
if (get_prefs('net_auto_reconnect')) {
command('set net_auto_reconnect 0');
command('timer 1 set net_auto_reconnect 1');
}
}
return EAT_NONE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment