-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclearwin.pl
More file actions
34 lines (26 loc) · 795 Bytes
/
clearwin.pl
File metadata and controls
34 lines (26 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
$VERSION = "20030208";
%IRSSI = (
authors => "Obfuscoder",
contact => "obfuscoder\@obfusco.de",
name => "clearwins",
description => "clears all windows periodically",
license => "GPLv2",
changed => "$VERSION",
commands => "clearwin"
);
use Irssi 20020324;
use vars qw($timer $timeout);
sub clear_timeout {
my @wins = Irssi::windows();
for my $win (@wins) {
$win->command("sb clear");
}
print "Cleared.";
}
Irssi::settings_add_int($IRSSI{'name'}, 'cleartimer', 600);
$timeout = Irssi::settings_get_int('cleartimer');
print CLIENTCRAP '%B>>%n '.$IRSSI{name}." $VERSION loaded. Clearing every $timeout seconds.";
$timer = Irssi::timeout_add($timeout*1000, 'clear_timeout', 0);