sub ag_getmsg #runs when bot sends privmsg. Avoid talking to bots to keep this from sending useless shit that breaks things
{
- my $message = @_[1];
- my $botname = @_[2];
+ my $message = $_[1];
+ my $botname = $_[2];
$botname =~ tr/[A-Z]/[a-z]/;
$bots[$botcounter] =~ tr/[A-Z]/[a-z]/;
sub ag_message
{
- (my $message) = @_[0];
+ (my $message) = $_[0];
if ($server != Irssi::active_server()) {&ag_server;}
$server->command("$message");
}
sub ag_uniq #only returns unique entries
{
my %seen;
- grep !$seen{$_}++, @_;
+ grep !$seen{$_}++, _;
}
sub ag_addfinished #save finished downloads
{
- my $filename = @_[0];
+ my $filename = $_[0];
open(finished, ">>", $cachefilename);
print finished $bots[$botcounter] . " " . $packs[$packcounter] . "\n"; #print pack to file
print finished $filename . "\n"; #print name to file
unlink "$file";
open(temp, "<", "/tmp/temp");
open(searches, ">", $file);
- my %hTmp;
while (my $sLine = <temp>) #remove duplicate lines
{
next if $sLine =~ m/^\s*$/; #remove empty lines. Without this, still destroys empty lines except for the first one.
sub ag_add #add search terms
{
&ag_server;
- my @args = quotewords('\s+', 0, @_[0]); #split arguments (words in brackets not seperated)
+ my @args = quotewords('\s+', 0, $_[0]); #split arguments (words in brackets not seperated)
if ($#args < 0)
{
Irssi::print "AG | too few arguments";
sub ag_rem #remove ssearch terms
{
&ag_server;
- my @args = quotewords('\s+', 0, @_[0]);
+ my @args = quotewords('\s+', 0, $_[0]);
if ($#args < 0)
{
Irssi::print "AG | too few arguments";
sub ag_botadd #add bots
{
&ag_server;
- my @args = quotewords('\s+', 0, @_[0]);
+ my @args = quotewords('\s+', 0, $_[0]);
if ($#args < 0)
{
Irssi::print "AG | too few arguments";
sub ag_botrem #remove bots
{
&ag_server;
- my @args = quotewords('\s+', 0, @_[0]);
+ my @args = quotewords('\s+', 0, $_[0]);
if ($#args < 0)
{
Irssi::print "AG | too few arguments";