Improved QDB. Also, You can now define how many results are returned by QDB SEARCH/MORE at a time with qdb_search_resnum in the config.

This commit is contained in:
Elijah Perrault committed 2011-02-19 21:02:31 -07:00
1 parent 9ff384866e
commit 24ab4aaf9a
5 files changed
+16 -7

No files matched your search

+2 -1
View File
@@ -15,7 +15,8 @@ In this alpha5 release, we have added:
* LinkTitle module for returning the page title of links sent to a channel. * LinkTitle module for returning the page title of links sent to a channel.
* Added core command MODLIST. * Added core command MODLIST.
* Added SEARCH and MORE to QDB. * Added SEARCH and MORE to QDB. Amount of results returned at a time with
qdb_search_resnum in the config.
Bug fixes: Bug fixes:
+2
View File
@@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev 3.0 Indev
=============================================================================== ===============================================================================
* You can now define how many results are returned by QDB SEARCH/MORE at a
time with qdb_search_resnum in the config.
* Added SEARCH and MORE to QDB. * Added SEARCH and MORE to QDB.
* Killed EMODS in the starter script and updated MODS * Killed EMODS in the starter script and updated MODS
* Added core command MODLIST. * Added core command MODLIST.
+1 -1
View File
@@ -13,7 +13,7 @@ our $ANSWER = 0;
sub _init sub _init
{ {
# Create the 8BALL and RIGBALL commands. # Create the 8BALL and RIGBALL commands.
cmd_add('8BALL', 0, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return 0; cmd_add('8BALL', 3, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return 0;
cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return 0; cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return 0;
# Success. # Success.
+3 -1
View File
@@ -4,7 +4,7 @@
package M::LinkTitle; package M::LinkTitle;
use strict; use strict;
use warnings; use warnings;
use LWP::UserAgent; #use LWP::UserAgent;
use HTML::Entities; use HTML::Entities;
use API::Std qw(hook_add hook_del); use API::Std qw(hook_add hook_del);
use API::IRC qw(privmsg); use API::IRC qw(privmsg);
@@ -40,6 +40,7 @@ sub gettitle
# We've got a match, connect to the server. # We've got a match, connect to the server.
my $srv = $1; my $srv = $1;
# Create an instance of LWP::UserAgent. # Create an instance of LWP::UserAgent.
require LWP::UserAgent;
my $ua = LWP::UserAgent->new(); my $ua = LWP::UserAgent->new();
$ua->agent('Auto IRC Bot'); $ua->agent('Auto IRC Bot');
$ua->timeout(3); $ua->timeout(3);
@@ -59,6 +60,7 @@ sub gettitle
privmsg($src->{svr}, $chan, "\2Title:\2 $title"); privmsg($src->{svr}, $chan, "\2Title:\2 $title");
} }
} }
Class::Unload->unload('LWP::UserAgent');
} }
} }
+8 -4
View File
@@ -5,7 +5,7 @@ package M::QDB;
use strict; use strict;
use warnings; use warnings;
use feature qw(switch); use feature qw(switch);
use API::Std qw(cmd_add cmd_del trans has_priv match_user); use API::Std qw(cmd_add cmd_del trans has_priv conf_get match_user);
use API::IRC qw(privmsg notice); use API::IRC qw(privmsg notice);
our @BUFFER; our @BUFFER;
@@ -151,9 +151,11 @@ sub cmd_qdb
} }
# Return four quotes. # Return four quotes.
privmsg($src->{svr}, $src->{chan}, "Results for \2$expr\2:"); privmsg($src->{svr}, $src->{chan}, "\2$#BUFFER\2 results for \2$expr\2:");
my $i = 0; my $i = 0;
while ($i <= 3) { my $si = 3;
if (conf_get('qdb_search_resnum')) { $si = (conf_get('qdb_search_resnum'))[0][0] - 1; }
while ($i <= $si) {
if (!defined $BUFFER[0]) { if (!defined $BUFFER[0]) {
last; last;
} }
@@ -171,7 +173,9 @@ sub cmd_qdb
# Return four quotes. # Return four quotes.
my $i = 0; my $i = 0;
while ($i <= 3) { my $si = 3;
if (conf_get('qdb_search_resnum')) { $si = (conf_get('qdb_search_resnum'))[0][0] - 1; }
while ($i <= $si) {
if (!defined $BUFFER[0]) { if (!defined $BUFFER[0]) {
last; last;
} }