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:
1 parent
9ff384866e
commit
24ab4aaf9a
5 files changed
+16
-7
No files matched your search
@@ -15,7 +15,8 @@ In this alpha5 release, we have added:
|
||||
|
||||
* LinkTitle module for returning the page title of links sent to a channel.
|
||||
* 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:
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log
|
||||
|
||||
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.
|
||||
* Killed EMODS in the starter script and updated MODS
|
||||
* Added core command MODLIST.
|
||||
|
||||
@@ -13,7 +13,7 @@ our $ANSWER = 0;
|
||||
sub _init
|
||||
{
|
||||
# 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;
|
||||
|
||||
# Success.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package M::LinkTitle;
|
||||
use strict;
|
||||
use warnings;
|
||||
use LWP::UserAgent;
|
||||
#use LWP::UserAgent;
|
||||
use HTML::Entities;
|
||||
use API::Std qw(hook_add hook_del);
|
||||
use API::IRC qw(privmsg);
|
||||
@@ -40,6 +40,7 @@ sub gettitle
|
||||
# We've got a match, connect to the server.
|
||||
my $srv = $1;
|
||||
# Create an instance of LWP::UserAgent.
|
||||
require LWP::UserAgent;
|
||||
my $ua = LWP::UserAgent->new();
|
||||
$ua->agent('Auto IRC Bot');
|
||||
$ua->timeout(3);
|
||||
@@ -59,6 +60,7 @@ sub gettitle
|
||||
privmsg($src->{svr}, $chan, "\2Title:\2 $title");
|
||||
}
|
||||
}
|
||||
Class::Unload->unload('LWP::UserAgent');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -5,7 +5,7 @@ package M::QDB;
|
||||
use strict;
|
||||
use warnings;
|
||||
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);
|
||||
our @BUFFER;
|
||||
|
||||
@@ -151,9 +151,11 @@ sub cmd_qdb
|
||||
}
|
||||
|
||||
# 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;
|
||||
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]) {
|
||||
last;
|
||||
}
|
||||
@@ -171,7 +173,9 @@ sub cmd_qdb
|
||||
|
||||
# Return four quotes.
|
||||
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]) {
|
||||
last;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user