# Save data to file
sub cmd_save_autoop {
my $file = Irssi::get_irssi_dir."/autoop";
- open FILE, "> $file" or return;
+ open FILE, ">", "$file" or return;
foreach my $item (@opitems) {
printf FILE ("%s\t%s\t%s\n", $item->{mask}, $item->{chan}, $item->{dynamic});
# Load data from file
sub cmd_load_autoop {
my $file = Irssi::get_irssi_dir."/autoop";
- open FILE, "< $file" or return;
+ open FILE, "<","$file" or return;
undef @opitems if (@opitems);
while (<FILE>) {
+use strict;
+use vars qw($VERSION %IRSSI);
$VERSION = "2.92";
%IRSSI = (
authors => "Timo Sirainen, Matti Hiljanen, Joost Vunderink, Bart Matthaei",
$last_mtime = $mtime;
my $f = gensym;
- return 0 if (!open($f, $mailfile));
+ return 0 if (!open($f, "<", $mailfile));
# count new mails only
my $internal_removed = 0;
# Contains code from centericq.pl (public domain) and imapbiff (GPL) and
# hence this is also GPL'd.
+use strict;
use vars qw($VERSION %IRSSI);
$VERSION = "0.5";
%IRSSI = (
use Irssi;
use Irssi::TextUI;
-
-
-use strict;
use IO::Socket;
# TODO : avoid requiring SSL when it's not in use?
#!/usr/bin/perl -w
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
changed => "Mon Mar 4 23:25:18 EET 2002"
);
-use strict;
-
sub getMessages( $ ) {
local *F;
- open(F, $_[0]) or return ();
+ open(F, "<", $_[0]) or return ();
my $inHeaders = 0;
my $headers;
my %result = ();
# >install Net::POP3
#
+use strict;
use Irssi;
use Net::POP3;
use vars qw($VERSION %IRSSI);
);
-
-
+my (%_mailcount, %_mailchecktimer);
sub cmd_checkmail
{
my $args = shift;
my ($user, $pass, $host) = split(/\;/, $args);
- my $i, $from, $subject, $head;
+ my ($i, $from, $subject, $head);
my $POP3TIMEOUT = Irssi::settings_get_int("pop3_timeout");
- my $pop = Net::POP3->new( $host, Timeout => $POP3TIMEOUT );
- $count = $pop->login($user, $pass);
+ my $pop = Net::POP3->new( $host, Timeout => $POP3TIMEOUT );
+ my $count = $pop->login($user, $pass);
if (!$count || !$pop)
{
my $args = shift;
my (@arg) = split(/\s+/, $args);
- if ((@arg[0] eq "add") && @arg[1] && @arg[2])
+ if (($arg[0] eq "add") && $arg[1] && $arg[2])
{
- if ($_mailchecktimer{@arg[1]})
+ if ($_mailchecktimer{$arg[1]})
{
- Irssi::print("Account " . @arg[1] . " is already being monitored.");
+ Irssi::print("Account " . $arg[1] . " is already being monitored.");
}
else
{
- start_check(@arg[1], @arg[2]);
+ start_check($arg[1], $arg[2]);
}
}
- elsif (@arg[0] eq "list")
+ elsif ($arg[0] eq "list")
{
Irssi::print("Active POP3 Accounts Being Monitored:");
foreach (keys %_mailchecktimer)
# * 30.05.2004
# first version of the script
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "0.2";
my $server = $dest->{server}; # get server and channel for target
my $channel = $server->channel_find($dest->{target});
- foreach $nick ($channel->nicks()) # walk through nicks
+ foreach my $nick ($channel->nicks()) # walk through nicks
{
$nick = $nick->{nick};
$nick =~ s/([\]\[])/\\$1/g; # ']' and '[' need masking
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = "0.3";
-
%IRSSI = (
'authors' => 'Gergely Nagy',
'contact' => 'algernon\@bonehunter.rulez.org',
my $count = 0;
local *CONF;
- open CONF, "< $file";
+ open CONF, "<", $file;
while (<CONF>)
{
$noshort{$_} = 1;
my $file = Irssi::get_irssi_dir."/unshortlist";
local *CONF;
- open CONF, "> $file";
+ open CONF, ">", $file;
foreach (keys %noshort)
{
print CONF $_ if ($noshort{$_});
#my ($data, $server, $item) = @_;
my $file = Irssi::get_irssi_dir."/monitor";
my ($net, $n, $k);
- open FILE, "> $file" or return;
+ open FILE, ">", $file or return;
foreach $net (keys %monitorlist) {
foreach $n (keys %{$monitorlist{$net}}) {
$monitorlist{$net}{$n}{lastseen} = time() if $monitorlist{$net}{$n}{mask_online};
#my ($data, $server, $item) = @_;
my $file = Irssi::get_irssi_dir."/monitor";
- open FILE, "< $file" or return;
+ open FILE, "<", $file or return;
%monitorlist = ();
while (<FILE>) {
chomp;
}
}
- open (f, $mpg123file) || return;
+ open (f, "<", $mpg123file) || return;
while ($mpg123linha=<f>) {
# $/set beep_msg_level HILIGHT
# $/set beep_cmd beep
-
+use strict;
+use vars qw($VERSION %IRSSI);
$VERSION = "0.9";
%IRSSI = (
authors => "Remco den Breeje",
use Irssi;
my $can_I_beep = 1;
+my ($timeout_tag, $autoaway_to_tag);
sub beep_overflow_timeout() {
$can_I_beep = 1;
#| line | char(255) | YES | | NULL | |
#+-----------+---------------+------+-----+---------+-------+
-
+use strict;
use DBI;
use Irssi;
use Irssi::Irc;
url => "http://nchip.ukkosenjyly.mine.nu/irssiscripts/",
);
-$dsn = 'DBI:mysql:ircurl:localhost';
-$db_user_name = 'tunnus';
-$db_password = 'salakala';
+my $dsn = 'DBI:mysql:ircurl:localhost';
+my $db_user_name = 'tunnus';
+my $db_password = 'salakala';
sub cmd_logurl {
my ($server, $data, $nick, $mask, $target) = @_;
- $d = $data;
+ my $d = $data;
if (($d =~ /(.{1,2}tp\:\/\/.+)/) or ($d =~ /(www\..+)/)) {
db_insert($nick, $target, $1);
}
my @list;
my $ignore = 2;
- open(FID, "/proc/net/dev");
+ open(FID, "<", "/proc/net/dev");
while (<FID>) {
if ($ignore > 0) {
sub getBytesOBSD() {
my @list;
- open(FID, "/usr/bin/netstat -nib|");
+ open(FID, "-|", "/usr/bin/netstat -nib");
while (<FID>) {
my $line = $_;
my @list;
my $olddev="";
- open(FID, "/usr/bin/netstat -nib|");
+ open(FID, "-|", "/usr/bin/netstat -nib");
while (<FID>) {
my $line = $_;
@list = split(" ", $line);
+use strict;
+use vars qw($VERSION %IRSSI);
$VERSION = "1.1";
%IRSSI = (
authors => "Roeland 'Trancer' Nieuwenhuis",
license => "Public Domain"
);
-use strict;
use Irssi;
# The channels the nicks are banned on (on which this script is active)
}
sub save_colors {
- open COLORS, ">$ENV{HOME}/.irssi/saved_colors";
+ open COLORS, ">", "$ENV{HOME}/.irssi/saved_colors";
foreach my $nick (keys %saved_colors) {
print COLORS "$nick:$saved_colors{$nick}\n";
if (-e $file) {
local *F;
- open(F, "<$file");
+ open(F, "<", $file);
local $/ = "\n";
while (<F>) {
if (-e $file) {
local *F;
- open(F, ">$file");
+ open(F, ">", $file);
for (my $n = 0; $n < @nickservnet; ++$n) {
print(F join("\t", $nickservnet[$n]->{name}, $nickservnet[$n]->{host}) . "\n");
my ($file) = @_;
- open(F, ">$file") or die "Can't create $file. Reason: $!";
+ open(F, ">", $file) or die "Can't create $file. Reason: $!";
}
sub new_nickserv_network {
if (-e $file) {
local *F;
- open(F, "<$file");
+ open(F, "<" ,$file);
local $/ = "\n";
while (<F>) {
if (-e $file) {
local *F;
- open(F, ">$file");
+ open(F, ">", $file);
for (my $n = 0; $n < @nickservauth; ++$n) {
print(F join("\t", $nickservauth[$n]->{ircnet}, $nickservauth[$n]->{nick}, $nickservauth[$n]->{pass}) . "\n");
my ($file) = @_;
my $umask = umask 0077; # save old umask
- open(F, ">$file") or die "Can't create $file. Reason: $!";
+ open(F, ">", $file) or die "Can't create $file. Reason: $!";
umask $umask;
}
sub add_nickname {
- my ($network, $nickname, $password) = split(" ", @_[0], 3);
+ my ($network, $nickname, $password) = split(" ", $_[0], 3);
my ($correct_network, $correct_nickname, $correct_password);
if ($network eq "" || $nickname eq "" || $password eq "") {
sub add_network {
- my ($network, $hostname) = split(" ", @_[0], 2);
+ my ($network, $hostname) = split(" ", $_[0], 2);
my ($correct_net, $correct_host);
if ($network eq "" || $hostname eq "") {
sub del_network {
- my ($ircnet) = split(" ", @_[0], 1);
+ my ($ircnet) = split(" ", $_[0], 1);
my ($ircnetindex);
if ($ircnet eq "") {
sub del_nickname {
- my ($ircnet, $nickname) = split(" ", @_[0], 2);
+ my ($ircnet, $nickname) = split(" ", $_[0], 2);
my ($nickindex);
if ($ircnet eq "" || $nickname eq "") {
# load colors from file
sub load_colors() {
- open(FID, "<".$ENV{HOME}."/.irssi/saved_colors") || return;
+ open(FID, "<", $ENV{HOME}."/.irssi/saved_colors") || return;
while (<FID>) {
chomp;
# save colors to file
sub save_colors() {
- open(FID, ">".$ENV{HOME}."/.irssi/saved_colors");
+ open(FID, ">", $ENV{HOME}."/.irssi/saved_colors");
print FID $_.":".$saved_colors{$_}."\n" foreach (keys(%saved_colors));
# 21.08.2001 bd@bc-bd.org :: added automatic whois
+use strict;
use Irssi;
+use vars qw($VERSION %IRSSI);
$VERSION="0.1.1";
%IRSSI = (
# DBM::Deep
# DBI
+use strict;
use Irssi;
use DBI;
use Data::Dumper;
# v1.01 - history:
# - fixed infinite loop when you weren't connected to server :)
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "1.01";
description => "Prints private notices from people in the channel where they are joined with you. Useful when you get lots of private notices from some bots.",
license => "Public Domain",
url => "http://irssi.org/",
- changed => "2002-03-04T22:47+0100",\r
- changes => "v1.01 - fixed infinite loop when you weren't connected to server :)"\r
+ changed => "2002-03-04T22:47+0100",
+ changes => "v1.01 - fixed infinite loop when you weren't connected to server :)"
);
my $insig = 0;
#
# Commands: /o <text> in a channel.
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
# script painfully made by Wohmatak :)
# ------------------------------------------------------------------------------
-
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
Irssi::settings_add_str("misc", "np_lang", "en");
Irssi::settings_add_int("misc", "show_npinfo", 1);
+my $message;
+
sub info {
### onload message
print "\ 2--- Wohmatak's Orpheus now playing script loaded! ---\ 2\nTo show now playing song, use /np command";
### check, whether lsof works
if (!`lsof -Fc -b -S 2`) { die "lsof command hasn't been found on your computer! Please check whether it is installed & has correct permissions... Orphamp deactivated";}
### lsof command
-$raw = `lsof -S 2 -n -P -b | grep mpg123 | grep -i mp3 | grep REG | tail -n 1`;
+my $raw = `lsof -S 2 -n -P -b | grep mpg123 | grep -i mp3 | grep REG | tail -n 1`;
### split after /
-@split = split(/\//,$raw);
+my @split = split(/\//,$raw);
### count the number of splits
-$pocet = $#split;
+my $pocet = $#split;
### filename into one variable & newline department
-$filename = "";
-for ($i=1; $i<=$pocet; ++$i) {
+my $filename = "";
+for (my $i=1; $i<=$pocet; ++$i) {
$filename .= "/";
-$filename .= @split[$i];
+$filename .= $split[$i];
}
chomp($filename);
## mp3info command, std_err to /dev/null
## (we don't want those ugly error messages in irssi window, do we?:)
- $artist = `mp3info -p %a "$filename" 2> /dev/null`;
- $song = `mp3info -p %t "$filename" 2> /dev/null`;
- $album = `mp3info -p %l "$filename" 2> /dev/null`;
+ my $artist = `mp3info -p %a "$filename" 2> /dev/null`;
+ my $song = `mp3info -p %t "$filename" 2> /dev/null`;
+ my $album = `mp3info -p %l "$filename" 2> /dev/null`;
if (!$album) { $album = "unknown album";}
- $year = `mp3info -p %y "$filename" 2> /dev/null`;
+ my $year = `mp3info -p %y "$filename" 2> /dev/null`;
if (!$year) { $year = "unknown year";}
## if there's no artist and song, display info from orpheus infopipe file (orpheus 1.4 needed)
if (!$artist && !$song)
{
- $nazev = `cat ~/.orpheus/currently_playing`;
+ my $nazev = `cat ~/.orpheus/currently_playing`;
$message = "prehrava \ 2".$nazev."\ 2";
}
print "mp3info is not installed! please get it if you want to use orphamp script (http://ibiblio.org/mp3info/)";
}
- $nazev = `cat ~/.orpheus/currently_playing`;
+ my $nazev = `cat ~/.orpheus/currently_playing`;
if (Irssi::settings_get_str("np_lang") eq "en")
{
$message = "listens to \ 2".$nazev."\ 2";
if ( $version =~ /^2.*/ ) {
$command .= " --indent=".Irssi::settings_get_str('osd_indent');
}
- open( OSDPIPE, $command )
+ open( OSDPIPE, "|-", $command )
or print "The OSD program can't be started, check if you have osd_cat installed AND in your path.";
OSDPIPE->autoflush(1);
}
+use strict;
use vars qw($VERSION %IRSSI);
use Irssi 20020120;
#
# Thomas Graf <irssi@reeler.org>
+use strict;
use Irssi;
use Irssi::Irc;
+use vars qw($VERSION %IRSSI);
$VERSION = "0.2";
%IRSSI = (
authors => 'Thomas Graf',
url => 'http://irssi.reeler.org/',
);
-use strict;
-
sub sig_ctcp_msg
{
my ($server, $args, $sender, $addr, $target) = @_;
# $Id: pager.pl,v 1.23 2003/01/27 09:45:16 jylefort Exp $
+use strict;
use Irssi 20020121.2020 ();
$VERSION = "1.1";
%IRSSI = (
return;
};
if ($where =~ /^-s/) {
- open (F, ">>$file") or do {
+ open (F, ">>", $file) or do {
$window->print("Paste: Cannot write savefile \"$file\"", $paste_use_level);
return;
};
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
unless ($sound =~ /^.*\.wav$/i) {$sound = $sound . ".*.wav"}
my $LISTING;
if ( -r $cachefile ) {
- if ($cachefile =~ /\.gz$/i) { open(LISTING, "zcat $cachefile |") }
- elsif ($cachefile =~ /\.bz2$/i) { open(LISTING, "bzcat $cachefile |") }
- else { open(LISTING, "cat $cachefile |") };
+ if ($cachefile =~ /\.gz$/i) { open(LISTING, "-|", "zcat $cachefile") }
+ elsif ($cachefile =~ /\.bz2$/i) { open(LISTING, "-|", "bzcat $cachefile") }
+ else { open(LISTING, "-|", "cat $cachefile") };
} else {
Irssi::print("Cache file not readable. Nani?!?");
return;}
my $tempsound = $wordlist[1];
$tempsound =~ s/[\r \001 \n]//;
IRC::print($tempsound);
- if (!open(TEMPFILE, $sounddir.$tempsound)) {
+ if (!open(TEMPFILE, "<", $sounddir.$tempsound)) {
IRC::send_raw("PRIVMSG $name :!$name $tempsound\r\n");
} else {
close(TEMPFILE);
$filename = strftime($filename, @lt, $zone);
$filename =~ s/(\[|\])/\\$1/g;
local *F;
- open(F, "<".bsd_glob($filename));
+ open(F, "<", bsd_glob($filename));
my $lines = Irssi::settings_get_int('queryresume_lines');
foreach (<F>) {
unless (/^--- Log/) {
my ($data, $server, $channel) = @_;
return if ($data ne "");
- open (f, $quitfile) || return;
+ open (f, "<", $quitfile) || return;
my $lines = 0; while(<f>) { $lines++; };
my $line = int(rand($lines))+1;
sub cmd_quit {
my ($data, $server, $channel) = @_;
- open(f,$quitfile);
+ open(f,"<",$quitfile);
my @contenido = <f>;
close(f);
#the next must be checked
my $file = Irssi::settings_get_str("quiz_file");
- if (open(QS, "<$file")) { #open for QS
+ if (open(QS, "<", $file)) { #open for QS
@{$game->{'questions'}}=sort <QS>;
close(QS);
Irssi::print("Loaded questions");
my $file2 = Irssi::settings_get_str("used_file");
- if (open(QS2, "<$file2")) { #open for QS2
+ if (open(QS2, "<", $file2)) { #open for QS2
@{$game->{'used_questions'}}=sort <QS2>;
close(QS2);
#save used questions
my $file2 = Irssi::settings_get_str("used_file");
- if (open(QS2, ">$file2")) {
+ if (open(QS2, ">", $file2)) {
my $line;
@{$game->{'used_questions'}}=sort @{$game->{'used_questions'}};
foreach $line (@{$game->{'used_questions'}}){
# get_irssi_dir() instead of $ENV[]. imported.
#
+use strict;
use Irssi 20011116;
use Irssi::Irc;
+use vars qw($VERSION %IRSSI);
$VERSION = '1.13';
%IRSSI = (
undef @awayreasons;
if (-f $reasonfile) {
Irssi::print("=> Trying to read awayreasons from $reasonfile");
- open F, $reasonfile;
+ open F, "<", $reasonfile;
# this actually makes the while() work like a while and not
# like a read() .. ie, stopping at each \n.
# adding to current environment.
push(@awayreasons, $reason);
# and also saving it for later.
- open(F, ">> $reasonsfile");
+ open(F, ">>", $reasonsfile);
print F $reason;
close F;
Irssi::print("Added: $reason");
my $namefile = glob Irssi::settings_get_str('random_realname_file');
- open (FILE, $namefile) || return;
+ open (FILE, "<", $namefile) || return;
my $lines = 0; while(<FILE>) { $lines++; };
my $line = int(rand($lines))+1;
#
# 2002 Thomas Graf <irssi@reeler.org>
+use strict;
use Irssi;
use Irssi::Irc;
+use vars qw($VERSION %IRSSI);
$VERSION = "0.1";
%IRSSI = (
## to redirect last message to current channel/query:
## /RELM
+use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
changed => "Fri Mar 15 15:09:42 CET 2002"
);
+my %relm;
+
sub cmd_relm {
my ($args, $server, $winit) = @_;
my $ircnet = lc($server->{tag});
$which = scalar(@{$relm{lc($ircnet)}}) unless ($which);
- unless (@relm{$ircnet}) {
+ unless ($relm{$ircnet}) {
Irssi::print("%R>>%n Nothing in relm buffer on $ircnet.", MSGLEVEL_CRAP);
return;
}
#!/usr/bin/perl -w
+use strict;
use Irssi 20010120.0250 ();
+use vars qw($VERSION %IRSSI);
$VERSION = "1";
%IRSSI = (
authors => 'David Leadbeater',
# so you can do mode #channel +o whoever
# but it will allow any command, yes it's dangerous if someone knows the
# password they can access just about anything your user account can....
-use strict;
# put a crypted password here
my $password = "pp00000000";
my($login,$remote);