diff options
| author | ailin-nemui | 2016-10-31 15:17:11 +0100 |
|---|---|---|
| committer | GitHub | 2016-10-31 15:17:11 +0100 |
| commit | e2d0dd57954ddca5f4c0b9581dcd48677d032e73 (patch) | |
| tree | 800759c7983fccfd1c7522e3c3630c8b3cef67f7 /scripts | |
| parent | 76786b9228c3bcfeb0eba86b8c7432168bcadbba (diff) | |
| parent | deae6f8abf891c7595594134b6aafbbcb0052ee9 (diff) | |
| download | scripts.irssi.org-e2d0dd57954ddca5f4c0b9581dcd48677d032e73.tar.bz2 | |
Merge pull request #316 from fullmetal1/gh-pages
various bugfixes from many months of usage
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/xdcc_autoget.pl | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/scripts/xdcc_autoget.pl b/scripts/xdcc_autoget.pl index 16f4639..57bcf65 100644 --- a/scripts/xdcc_autoget.pl +++ b/scripts/xdcc_autoget.pl @@ -50,7 +50,7 @@ use File::Copy; use Try::Tiny; use vars qw($VERSION %IRSSI); -$VERSION = "2.0"; +$VERSION = "2.1"; %IRSSI = ( name => "autoget", description => "XDCC Autoget, for automated searching and downloading of xdcc packs", @@ -143,7 +143,7 @@ sub ag_list sub ag_initserver #init server { - Irssi::signal_remove("server connected", "ag_server"); + Irssi::signal_remove("server connected", "ag_initserver"); $statusbarmessage = "Connected"; $server = $_[0]; if (!$runningflag) {Irssi::timeout_add_once(5000, sub { &ag_run; }, []);} @@ -270,11 +270,11 @@ sub ag_search #searches bots for packs $msgflag[$botcounter] = 0; #unset message flag so that ag_skip knows no important message has arrived if($episodicflag) { - my $searchterm; + my $searchterm = $terms[$termcounter[$botcounter]]; my @words = split(/#/, $terms[$termcounter[$botcounter]]); my $ep = sprintf("%.2d", $episode[$botcounter]); if ($#words > 0){$searchterm = "$words[0]$ep$words[1]";} - else {$searchterm = "$words[0] $ep";} + elsif ($words[0] ne $searchterm) {$searchterm = "$words[0] $ep";} ag_message("msg $bots[$botcounter] $findprefix $searchterm" ); push(@{$totags[$botcounter]}, Irssi::timeout_add_once($botdelay * 1000, sub { ag_skip($botcounter); } , [])); @@ -323,9 +323,9 @@ sub ag_getpacks #if ($m =~ m{#(\d+):}) my @temp = split(/[#,]/, $message); #split up the message into 'words' my $timeoutscleared = 0; - my $newpackflag = 1; foreach my $m (@temp) #find packs (#[NUMBER]: format) { + my $newpackflag = 1; if ($m =~ m/(\d+):(.+)/) { if (!$timeoutscleared) #reset timeouts if any packs are found @@ -339,7 +339,7 @@ sub ag_getpacks #if ($m =~ m{#(\d+):}) my $filename = $2; $filename =~ tr/[ ']/[__]/; if ($n eq "$bots[$botcounter] $1" or $n eq $filename) {$newpackflag = 0;} - last if ($n eq "$bots[$botcounter] $1"); + last if ($n eq "$bots[$botcounter] $1" or $n eq $filename); } if($newpackflag){push(@{$packs[$botcounter]}, $1);} #push all new pack numbers to list of packs } @@ -650,7 +650,6 @@ sub ag_parserem #parses remove arguments for deletion from file sub ag_add #add search terms { - ag_server; my @args = quotewords('\s+', 0, $_[0]); #split arguments (words in brackets not seperated) if ($#args < 0) { @@ -664,7 +663,6 @@ sub ag_add #add search terms sub ag_rem #remove ssearch terms { - ag_server; my @args = quotewords('\s+', 0, $_[0]); if ($#args < 0) { @@ -678,7 +676,6 @@ sub ag_rem #remove ssearch terms sub ag_botadd #add bots { - ag_server; my @args = quotewords('\s+', 0, $_[0]); if ($#args < 0) { @@ -692,7 +689,6 @@ sub ag_botadd #add bots sub ag_botrem #remove bots { - ag_server; my @args = quotewords('\s+', 0, $_[0]); if ($#args < 0) { |
