2019-06-26 09:34:19 -07:00
|
|
|
#!/usr/bin/env perl
|
2010-03-17 06:36:54 +00:00
|
|
|
#
|
|
|
|
# File: pbot.pl
|
|
|
|
# Author: pragma_
|
|
|
|
#
|
|
|
|
# Purpose: IRC Bot (3rd generation)
|
|
|
|
########################
|
|
|
|
|
2017-03-05 21:33:31 +00:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2019-07-10 18:40:53 -07:00
|
|
|
use feature 'unicode_strings';
|
|
|
|
|
2010-03-17 06:36:54 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2019-12-19 23:29:56 -08:00
|
|
|
my $bothome;
|
|
|
|
BEGIN {
|
|
|
|
use File::Basename;
|
|
|
|
$bothome = -l __FILE__ ? dirname readlink __FILE__ : dirname __FILE__;
|
|
|
|
unshift @INC, $bothome;
|
|
|
|
}
|
2010-03-17 06:36:54 +00:00
|
|
|
|
2019-06-26 09:34:19 -07:00
|
|
|
my %config = (
|
2019-12-21 19:04:39 -08:00
|
|
|
# Path to data directory
|
|
|
|
data_dir => "$bothome/data",
|
2014-02-05 01:10:56 +00:00
|
|
|
|
2019-12-21 19:04:39 -08:00
|
|
|
# Path to directory containing command-line modules
|
|
|
|
module_dir => "$bothome/modules",
|
2014-02-05 01:10:56 +00:00
|
|
|
|
2019-12-21 19:04:39 -08:00
|
|
|
# Path to directory containing loadable plugins
|
|
|
|
plugin_dir => "$bothome/Plugins",
|
2014-02-05 01:10:56 +00:00
|
|
|
|
2019-12-21 19:04:39 -08:00
|
|
|
# Path to log file
|
|
|
|
log_file => "$bothome/log/log",
|
2014-02-05 01:10:56 +00:00
|
|
|
|
|
|
|
# -----------------------------------------------------
|
|
|
|
# The bot can export the latest factoids and quotegrabs to an HTML
|
|
|
|
# document. If you run a webserver or something similiar, you may
|
|
|
|
# wish to set the following items ending with 'path' to point to
|
|
|
|
# a suitable location for the webserver, and to set the items
|
|
|
|
# ending with 'site' to the public-facing URL where the files
|
|
|
|
# may be viewed in a browser.
|
|
|
|
# -----------------------------------------------------
|
2019-12-21 19:04:39 -08:00
|
|
|
export_factoids_path => "$bothome/factoids.html", # change to a path in your webroot
|
|
|
|
export_factoids_site => 'http://your.website.com/factoids.html',
|
2014-02-05 01:10:56 +00:00
|
|
|
|
2019-12-21 19:04:39 -08:00
|
|
|
export_quotegrabs_path => "$bothome/quotegrabs.html", # change to a path in your webroot
|
|
|
|
export_quotegrabs_site => 'http://your.website.com/quotegrabs.html',
|
2014-02-05 01:10:56 +00:00
|
|
|
);
|
|
|
|
|
2010-05-25 03:03:23 +00:00
|
|
|
# Create and initialize bot object
|
2019-12-19 23:29:56 -08:00
|
|
|
use PBot::PBot;
|
2010-03-17 06:36:54 +00:00
|
|
|
my $pbot = PBot::PBot->new(%config);
|
|
|
|
|
2010-05-25 03:03:23 +00:00
|
|
|
# Start the bot main loop; doesn't return
|
2010-03-22 07:33:44 +00:00
|
|
|
$pbot->start();
|