Method of installation.
-----------------------
-- Move blootbot.config to blootbot.config.used
-- Copy sample.config to blootbot.config
+- Move files/sample/sample.config to files/blootbot.config
- Edit files/blootbot.config, modify to taste.
+- Edit files/blootbot.chan to set which channels to join.
- Edit files/ircII.server to modify list of IRC servers to connect.
-- Depends on:
+
+- Install the following Perl modules:
- Net::IRC perl module
- Debian: (apt-get install libnet-irc-perl)
- WWW::Search
- HTML::Parser
- Debian: (apt-get install libhtml-parser-perl)
-- Choice of database
+- Choose your database:
- MySQL (see INSTALL.mysql)
- PgSQL (see INSTALL.pgsql, DOES NOT WORK YET)
- Berkeley DBM (see INSTALL.dbm)
INSTALL.mysql
----------------
-- Debian: (apt-get install mysql-server)
-- Debian: (apt-get install libdbd-mysql-perl)
+- Install a MySQL server and the DBI Perl modules.
+ - Debian: (apt-get install mysql-server libdbd-mysql-perl)
- run 'mysqladmin -u root -p create <DB NAME>'
- run 'setup/setup.pl'
to mysql.
ADDITIONAL NOTES:
- HOW TO ADD NEW USER MANUALLY
- CREATE DATABASE @DBNAME@
- INSERT INTO user VALUES ('localhost','@USER@',password('@PASS@'),
- 'Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N');
- INSERT INTO db VALUES ('localhost','@DBNAME@','@USER@',
- 'Y','Y','Y','Y','Y','N','N','N','N','N');
- GRANT SELECT,INSERT,UPDATE,DELETE ON @DBNAME@ TO @USER@
- FLUSH PRIVILEGES
+-----------------
+ You can add a new user manually by connecting to MySQL and performing these
+ commands:
+
+ $ mysql -u root -p
+
+ mysql> CREATE DATABASE blootbot;
+ mysql> GRANT USAGE ON *.* TO 'user'@'localhost' IDENTIFIED BY 'yourpassword';
+ mysql> GRANT ALL PRIVILEGES ON blootbot.* TO 'user'@'localhost';
+
+for the mysql that are on apt the bot (#debian@OPN), they are available
+at http://emu.res.cmu.edu/~apt/blootbot/apt.sql.bz2
- alternatively, move the files from patches/
- mv patches/Google.pm /usr/lib/perl5/WWW/Search/
- - mv patches/Connections.pm /usr/lib/perl5/Net/IRC/
+
+UPDATE
+----------------------
+you now not need to patch Net::IRC for the forking patch, it's done
+inside the bot code. Unfortunately, Net::IRC 0.70 has buggy code that
+does not detect DCC CHAT properly. To fix the problems identified,
+download the debs (convert to tarball if on non-debian system) from:
+http://nyip.net/~apt/
knowledge needs to fix it up or at least unify the module with mysql.
INSTALLATION
- - Read INSTALL and INSTALL.patches
- - Copy files/sample.config to files/blootbot.config
- - Edit files/blootbot.config
- - ./blootbot
-
+ - Read the included INSTALL file
NOTICE
Be warned that this bot consumes quite a lot of memory upon start
-#v1: blootbot -- blootbot -- written Sun Jan 28 20:36:31 2001
+#v1: blootbot -- blootbot -- written Sat Feb 9 17:51:31 2002
#debian-bots
- ++freshmeat
+ +allowTelling
+autojoin
- -freshmeat
+ +babelfish
+ factoidDeleteDelay 7
+ ircTextCounters heh hah :) ? hi lol
+joinfloodCheck
limitcheckInterval 10
limitcheckPlus 10
+ +news
+ newsDefaultExpire 7
+ +newsKeepRead
+ +newsNotifyAll
+ +rootWarn
+ rootWarnMode aggressive
+
+#nophear
+ +autojoin
_default
+allowConv
+allowDNS
- -babelfish
+ +chanlimitcheck
+ chanlimitcheckInterval 10
+ chanlimitcheckPlus 10
+cookie
+countdown
+debian
+debianExtra
debianRefreshInterval 7
+dict
+ +factoidArguments
floodMessages 10:30
floodRepeat 2:10
+freshmeat
- -freshmeatForFactoid
freshmeatRefreshInterval 24
- -insult
+ +insult
+karma
+kernel
+lart
+nickometer
+perlMath
+quote
- -randomFactoid
- -randomQuote
- +rootWarn
- rootWarnMode passive
+search
+seen
seenFlushInterval 60
+tell
+topic
+units
- +uptime
+userinfo
+wwwsearch
part: D: Leave a channel (DCC only)
part: U: ## <#channel>
part: E: ## #debian
+part: NOTE: /kick is an alternative
seen: D: Report last seen time for somebody
seen: U: ## <nick>
dollar variables: D: To be used in factoids
dollar variables: $date - ...
dollar variables: $time - ...
-dollar variables: $who - nick that caused the factoid to be retrieved
-dollar variables: $username - the username, not the nick
-dollar variables: $host - ...
-dollar variables: $channel - ...
+dollar variables: $who - nick of factoid requester
+dollar variables: $username - username of factoid requester
+dollar variables: $host - hostname of factoid requester
+dollar variables: $channel - channel from which the factoid was requested
dollar variables: $lastspeaker - ...
dollar variables: $factoid - ...
nickometer: E: ## #debian-bots
news: D: News functin
-news: U: ## [chan] add
-news: U: ## [chan] del
-news: U: ## [chan] mod
-news: U: ## [chan] set
+news: U: ## [chan] <add,del,mod,set,latest,read,help>
news add: D: Add news items
news add: U: news [chan] add <title>
news mod: E: news [chan] mod <item> s/<from>/<to>/[g]
news mod: E: news mod 1 s/test/Test/
news mod: E: news mod test s/test/Test/g
+
+tell: D: Tell someone about a factoid or command
+tell: U: tell <who> -?about <what>
+tell: E: tell me about blootbot
+tell: E: tell someone -about testing
I give up, what is it?
I don't know, could you explain it?
I'm not sure, is it larger than a breadbox?
+ parse error: dunno what the heck you're talking about
+ are you smoking crack?
# moron reply.
moron
-#v1: blootbot -- blootbot -- written Sun Jan 28 20:36:30 2001
+#v1: blootbot -- blootbot -- written Sat Feb 9 17:51:31 2002
_default
---FLAGS +mrt
+--FLAGS mrt
--HOSTS *!*@*
-stuph
---FLAGS +mrt
---HOSTS
-
xk
---FLAGS +mrsteon
---HOSTS *!root@*.home.org
---HOSTS *!xk@*.home.org
---PASS AAH2sny6Y3Y7Y
-
-::* bans
-- *!*@*.il:+0:+0:0:980679318:you jews suck
+--FLAGS mrsteon
+--HOSTS *!xk@superbox.home.org
+--PASS 5K/rmJPzwxJhU
CREATE TABLE stats (
nick VARCHAR(20) NOT NULL,
type VARCHAR(8) NOT NULL,
+ channel VARCHAR(16) NOT NULL DEFAULT "PRIVATE",
+ time INT UNSIGNED DEFAULT 'UNIX_TIMESTAMP()',
counter SMALLINT UNSIGNED DEFAULT '0',
- PRIMARY KEY (nick,type)
+ PRIMARY KEY (nick,type,channel)
);
$itc =~ s/([^\w\s])/\\$1/g;
my $z = join '|', split ' ', $itc;
+ if ($msgType eq "privmsg" and $message =~ / ($mask{chan})$/) {
+ &DEBUG("ircTC: privmsg detected; chan = $1");
+ $chan = $1;
+ }
+
if ($message =~ /^_stats(\s+(\S+))$/i) {
&textstats_main($2);
return;
# File: Irc Servers list.
sub loadIRCServers {
- my ($file) = $bot_config_dir."/ircII.servers";
+ my ($file) = $bot_config_dir."/blootbot.servers";
@ircServers = ();
%ircPort = ();
my ($self, $event) = @_;
my @args = $event->args;
- &DEBUG("on_chanfull: args => @args");
+ &status(">>> chanfull/$b_blue$args[1]$ob");
+
&joinNextChan();
}
my ($self, $event) = @_;
my @args = $event->args;
- &DEBUG("on_inviteonly: args => @args");
+ &status(">>> inviteonly/$b_cyan$args[1]$ob");
+
&joinNextChan();
}
sub on_banned {
my ($self, $event) = @_;
my @args = $event->args;
+ my $chan = $args[1];
+
+ &status(">>> banned/$b_blue$chan$ob $b_cyan$args[0]$ob");
- &DEBUG("on_banned: args => @args");
&joinNextChan();
}
$file =~ s/##DIST/$dist/g;
my $update = 0;
- if ( -f $file) {
+ if ( -f $file ) {
my $last_refresh = (stat $file)[9];
$update++ if (time() - $last_refresh > $refresh);
} else {
s/##DIST/$dist/g;
next unless ( -f "$debian_dir/$_" );
- push(@files, "$debian_dir/$_" );
+ push(@files, "$debian_dir/$_");
}
if (!scalar @files) {
$regex =~ s/\?/./g;
open(IN,"zegrep -h '$grepRE' $files |");
+ # wonderful abuse of last and next and unless ;)
while (<IN>) {
- if (/^\.?\/?(.*?)[\t\s]+(\S+)\n$/) {
- my ($file,$package) = ("/".$1,$2);
- if ($query =~ /[\/\*\\]/) {
- next unless (eval { $file =~ /$regex/ });
- return unless &checkEval($@);
- } else {
- my ($basename) = $file =~ /^.*\/(.*)$/;
- next unless (eval { $basename =~ /$regex/ });
- return unless &checkEval($@);
- }
- next if ($query !~ /\.\d\.gz/ and $file =~ /\/man\//);
- next if ($front and eval { $file !~ /^\/$query/ });
- return unless &checkEval($@);
+ last if ($found > 100);
+
+ next unless if (/^\.?\/?(.*?)[\t\s]+(\S+)\n$/);
- $contents{$package}{$file} = 1;
- $found++;
+ my ($file,$package) = ("/".$1,$2);
+ if ($query =~ /[\/\*\\]/) {
+ next unless (eval { $file =~ /$regex/ });
+ return unless &checkEval($@);
+ } else {
+ my ($basename) = $file =~ /^.*\/(.*)$/;
+ next unless (eval { $basename =~ /$regex/ });
+ return unless &checkEval($@);
}
+ next if ($query !~ /\.\d\.gz/ and $file =~ /\/man\//);
+ next if ($front and eval { $file !~ /^\/$query/ });
+ return unless &checkEval($@);
- last if ($found > 100);
+ $contents{$package}{$file} = 1;
+ $found++;
}
close IN;
}
my $file = "$::param{tempDir}/$::who.txt";
- if (!open(OUT,">$file")) {
+ if (!open OUT, ">$file") {
&::ERROR("Debian: cannot write file for dcc send.");
return;
}
&::WARN("sD: package == NULL?");
next;
}
+
$desc{$package} = $desc;
$package = "";
+
} else {
&::WARN("debian: invalid line: '$_'. (2)");
}
### STATIC URL.
my %ftp = &::ftpList("llug.sep.bnl.gov", "/pub/debian/Incoming/");
- if (!open(PKG,">$pkgfile")) {
+ if (!open PKG, ">$pkgfile") {
&::ERROR("cannot write to pkg $pkgfile.");
return 0;
}
- if (!open(IDX,">$idxfile")) {
+ if (!open IDX, ">$idxfile") {
&::ERROR("cannot write to idx $idxfile.");
return 0;
}
next;
}
- open(IN,"zcat $file 2>&1 |");
+ open(IN, "zcat $file 2>&1 |");
if (! -e $file) {
&::DEBUG("deb: iS: $file does not exist.");
&DebianDownload($dist, &fixDist($dist, %urlpackages) );
&::status("Debian: generating index for '$dist'.");
- if (!open(OUT,">$idx")) {
+ if (!open OUT, ">$idx") {
&::ERROR("cannot write to $idx.");
return 0;
}
&::DEBUG("deb: validPackage($package, $dist) called.") if ($debug);
my $error = 0;
- while (!open(IN, $debian_dir. "/Packages-$dist.idx")) {
+ while (!open IN, $debian_dir."/Packages-$dist.idx") {
if ($error) {
&::ERROR("Packages-$dist.idx does not exist (#1).");
return;
my $file = $debian_dir."/Packages-$dist.idx";
my @files;
my $error = 0;
- my $warn = 0;
-
- if ($query =~ tr/A-Z/a-z/) {
- $warn++;
- }
+ my $warn = ($query =~ tr/A-Z/a-z/) ? 1 : 0;
&::status("Debian: Search package matching '$query' in '$dist'.");
- unlink $file if ( -z $file);
+ unlink $file if ( -z $file );
- while (!open(IN, $file)) {
+ while (!open IN, $file) {
if ($dist eq "incoming") {
&::DEBUG("deb: sP: dist == incoming; calling gI().");
&generateIncoming();
### TODO: what should we do if the sar wasn't done.
$new{$debian_dir."/".$key} = $val;
}
+
return %new;
}
sub DebianFind {
- ### H-H-H-HACK HACK HACK :)
+ # HACK! HACK! HACK!
my ($str) = @_;
my ($dist, $query) = &getDistroFromStr($str);
my @results = sort &searchPackage($str);
### TODO: remove the following loop (check if dir exists before)
while (1) {
last if (opendir(DEBIAN, $debian_dir));
+
if ($error) {
&::ERROR("dC: cannot opendir debian.");
return;
}
+
mkdir $debian_dir, 0755;
$error++;
}
### TODO: reorder.
use vars qw(
$bot_misc_dir $bot_pid $bot_base_dir $bot_src_dir
+ $bot_data_dir $bot_config_dir $bot_state_dir $bot_run_dir
$answer $correction_plausible $talkchannel $bot_release
$statcount $memusage $user $memusageOld $bot_version $dbh
$shm $host $msg $noreply $conn $irc $learnok $nick $ident
if (!open(FILE, $file)) {
&ERROR("FAILED loadConfig ($file): $!");
- &status("Please copy files/sample.config to files/blootbot.config");
- &status(" and edit files/blootbot.config, modify to tastes.");
+ &status("Please read the INSTALL file on how to install and setup this file.");
exit 0;
}